/* Reset & Base Variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-dark: #0a0a0f;
    --card-bg: rgba(20, 20, 30, 0.6);
    --text-main: #ffffff;
    --text-muted: #8892b0;
    --neon-accent: #00ff9d;
    --neon-danger: #ff0055;
    --glass-border: rgba(255, 255, 255, 0.08);
    --input-bg: rgba(0, 0, 0, 0.5);
}

body {
    font-family: 'Space Grotesk', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    background: radial-gradient(circle at top right, #1a1a2e 0%, #0a0a0f 60%);
    min-height: 100vh;
}

.hidden {
    display: none !important;
}

/* Typography & Layout */
.app-container {
    max-width: 500px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    margin-bottom: 30px;
    padding-top: 20px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1.8rem;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(0, 255, 157, 0.3);
}

.tagline {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 5px;
}

/* Glassmorphism Cards */
.glassmorphism {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.card {
    padding: 25px;
    margin-bottom: 25px;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: flex;
    gap: 15px;
}

.half {
    flex: 1;
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: #e2e8f0;
    font-weight: 500;
}

label i {
    color: var(--neon-accent);
    margin-right: 5px;
}

input {
    width: 100%;
    padding: 14px;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: white;
    /* Forcing text color to white */
    color-scheme: dark;
    /* Crucial for date picker icon and text in dark mode */
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    transition: all 0.2s ease;
}

/* Specifically target date pseudo-elements if needed for some browsers */
input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
}

input:focus {
    outline: none;
    border-color: var(--neon-accent);
    box-shadow: 0 0 10px rgba(0, 255, 157, 0.2);
}

.input-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Search Dropdown */
.search-container {
    position: relative;
}

.suggestions-list {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-height: 280px;
    overflow-y: auto;
    background: #1e1e2d;
    /* Slightly lighter for better contrast */
    border: 1px solid rgba(0, 255, 157, 0.3);
    border-radius: 12px;
    margin-top: 5px;
    list-style: none;
    z-index: 100;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.8);
}

.suggestions-list li {
    padding: 14px 18px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background 0.2s;
}

.suggestions-list li:hover {
    background: rgba(0, 255, 157, 0.15);
}

.coin-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

/* Buttons */
.generate-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(90deg, #00b09b, #96c93d);
    color: #000;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.2s;
    font-family: inherit;
    margin-top: 10px;
}

.generate-btn:hover:not(:disabled) {
    box-shadow: 0 0 20px rgba(0, 255, 157, 0.4);
}

.generate-btn:active:not(:disabled) {
    transform: translateY(2px);
}

.generate-btn:disabled {
    background: #2a2a35;
    color: #555;
    cursor: not-allowed;
    box-shadow: none;
}

/* Spinner */
.loading-container {
    text-align: center;
    padding: 40px 0;
}

.cyber-spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 15px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-left-color: var(--neon-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

/* Result Area */
.capture-area {
    padding: 20px;
    background: linear-gradient(180deg, rgba(20, 20, 30, 0.8) 0%, rgba(10, 10, 15, 0.9) 100%);
    border-radius: 16px;
    position: relative;
    border: 1px solid rgba(0, 255, 157, 0.2);
}

.result-title {
    font-size: 1.2rem;
    font-weight: 500;
    text-align: center;
    margin-bottom: 20px;
    line-height: 1.4;
}

.highlight {
    color: var(--neon-accent);
    font-weight: 700;
}

.highlight-coin {
    color: #f7931a;
    /* Bitcoin orange by default, can be dynamic */
    font-weight: 700;
}

.result-box {
    text-align: center;
    margin-bottom: 20px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
}

.result-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.result-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--neon-accent);
    word-break: break-word;
}

.profit-loss-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 700;
    margin-top: 10px;
    background: rgba(0, 255, 157, 0.2);
    color: var(--neon-accent);
}

.profit-loss-badge.loss {
    background: rgba(255, 0, 85, 0.2);
    color: var(--neon-danger);
}

.result-value.loss {
    color: var(--neon-danger);
}

.stats-row {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.stat-value {
    font-size: 1rem;
    font-weight: 500;
}

.watermark {
    text-align: right;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.2);
    margin-top: 10px;
    font-style: italic;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.action-buttons button {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: opacity 0.2s;
}

.twitter-bg {
    background: #000000;
    color: white;
    border: 1px solid #333;
}

.twitter-bg:hover {
    background: #111;
}

.telegram-bg {
    background: #229ED9;
    color: white;
    border: none;
}

.telegram-bg:hover {
    background: #0088CC;
}

.reddit-bg {
    background: #FF4500;
    color: white;
    border: none;
}

.reddit-bg:hover {
    background: #e03d00;
}

.copy-bg {
    background: #4ade80;
    color: #064e3b;
    border: none;
}

.copy-bg:hover {
    background: #22c55e;
}

.retry-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.retry-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.footer {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 40px;
}

.disclaimer {
    margin-top: 5px;
    font-size: 0.7rem;
    opacity: 0.6;
}

/* Monetization Styles */
.affiliate-banner {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.affiliate-banner p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.affiliate-btn {
    display: inline-block;
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    text-decoration: none;
    font-weight: 700;
    border-radius: 12px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.affiliate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
}

.donation-section {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    display: inline-block;
    max-width: 400px;
    width: 100%;
}

.donation-section p {
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--text-color);
}

.crypto-addresses {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.address-item {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.75rem;
}

.coin-badge {
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: 10px;
    font-size: 0.7rem;
}

.coin-badge.eth {
    background: #627eea;
    color: white;
}

.coin-badge.btc {
    background: #f7931a;
    color: white;
}

.address-item code {
    color: var(--text-muted);
    user-select: all;
    word-break: break-all;
    font-family: monospace;
    flex-grow: 1;
}

.copy-address-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    margin-left: 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.copy-address-btn:hover {
    color: var(--primary-color);
    background: rgba(46, 204, 113, 0.1);
}

.copy-address-btn.copied {
    color: var(--primary-color);
}