/* Advanced Crypto Exchange Frontend Styles */
/* Integrates with existing user-theme.css and mobile-responsive.css */

/* ===== HERO SECTION ENHANCEMENTS ===== */
.hero-section {
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 50%, var(--lemon-green-light) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="%23E0F0E0" stroke-width="0.5" opacity="0.3"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.5;
    z-index: 0;
}

.hero-content {
    max-width: 1200px;
    position: relative;
    z-index: 1;
}

.hero-logo {
    margin-bottom: 40px;
    animation: fadeInUp 0.8s ease-out;
}

.hero-logo .logo {
    font-size: 42px;
    justify-content: center;
    margin-bottom: 12px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-title {
    font-size: 72px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 24px;
    line-height: 1.1;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hero-title .highlight {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}

.hero-subtitle {
    font-size: 28px;
    color: var(--text-secondary);
    margin-bottom: 50px;
    line-height: 1.4;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

/* ===== CRYPTO CONVERTER SECTION ===== */
.crypto-converter-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 40px;
    margin: 60px auto;
    max-width: 600px;
    box-shadow: var(--shadow-heavy);
    animation: fadeInUp 0.8s ease-out 0.6s both;
    position: relative;
    overflow: hidden;
}

.crypto-converter-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
}

.converter-header {
    text-align: center;
    margin-bottom: 32px;
}

.converter-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.converter-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
}

.converter-form {
    display: grid;
    gap: 24px;
}

.converter-input-group {
    position: relative;
}

.converter-label {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.converter-input {
    width: 100%;
    padding: 16px 20px;
    font-size: 24px;
    font-weight: 600;
    border: 2px solid var(--border);
    border-radius: 16px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: all 0.3s ease;
    text-align: center;
}

.converter-input:focus {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 4px rgba(50, 205, 50, 0.1);
    outline: none;
}

.crypto-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.crypto-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: var(--bg-card);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.crypto-option:hover {
    border-color: var(--primary-green);
    transform: translateY(-2px);
    box-shadow: var(--shadow-light);
}

.crypto-option.selected {
    border-color: var(--primary-green);
    background: var(--lemon-green-light);
    box-shadow: var(--shadow-medium);
}

.crypto-option.selected::after {
    content: '✓';
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    background: var(--primary-green);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.crypto-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    color: white;
}

.crypto-icon.btc { background: #f7931a; }
.crypto-icon.eth { background: #627eea; }
.crypto-icon.usdt { background: #26a17b; }
.crypto-icon.usdc { background: #2775ca; }
.crypto-icon.shib { background: #ffa409; }

.crypto-symbol {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.crypto-price {
    font-size: 12px;
    color: var(--text-secondary);
}

.converter-result {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    margin-top: 24px;
}

.result-label {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.result-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-green);
    margin-bottom: 8px;
}

.result-rate {
    font-size: 14px;
    color: var(--text-muted);
}

.buy-now-btn {
    width: 100%;
    padding: 20px;
    font-size: 20px;
    font-weight: 700;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 24px;
    box-shadow: var(--shadow-medium);
}

.buy-now-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-heavy);
}

.buy-now-btn:active {
    transform: translateY(0);
}

/* ===== PRICE TICKER ===== */
.price-ticker-section {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 20px 0;
    margin: 60px 0;
    overflow: hidden;
    position: relative;
}

.ticker-container {
    display: flex;
    animation: scroll 30s linear infinite;
    gap: 40px;
}

.ticker-item {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 200px;
    padding: 12px 20px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.ticker-crypto-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    color: white;
}

.ticker-info {
    flex: 1;
}

.ticker-symbol {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.ticker-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-green);
}

.ticker-change {
    font-size: 12px;
    font-weight: 500;
}

.ticker-change.positive {
    color: var(--primary-green);
}

.ticker-change.negative {
    color: var(--accent-red);
}

/* ===== FEATURES SHOWCASE ===== */
.features-section {
    padding: 80px 20px;
    background: var(--bg-secondary);
}

.features-container {
    max-width: 1200px;
    margin: 0 auto;
}

.features-header {
    text-align: center;
    margin-bottom: 60px;
}

.features-title {
    font-size: 48px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.features-subtitle {
    font-size: 20px;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 40px 32px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.feature-card:hover::before {
    transform: scaleX(1);
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-heavy);
}

.feature-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: white;
}

.feature-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.feature-description {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ===== STATISTICS SECTION ===== */
.stats-section {
    padding: 80px 20px;
    background: var(--bg-primary);
}

.stats-container {
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
}

.stats-title {
    font-size: 48px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 60px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
}

.stat-item {
    padding: 32px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    transition: all 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-medium);
}

.stat-value {
    font-size: 48px;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
}

.stat-label {
    font-size: 18px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-100%);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.pulse-animation {
    animation: pulse 2s ease-in-out infinite;
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
    .hero-title {
        font-size: 48px;
    }
    
    .hero-subtitle {
        font-size: 20px;
    }
    
    .crypto-converter-section {
        margin: 40px 16px;
        padding: 24px;
        border-radius: 16px;
    }
    
    .converter-title {
        font-size: 24px;
    }
    
    .converter-input {
        font-size: 20px;
        padding: 14px 16px;
    }
    
    .crypto-selector {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .features-title,
    .stats-title {
        font-size: 32px;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .feature-card {
        padding: 32px 24px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
    
    .stat-value {
        font-size: 36px;
    }
    
    .ticker-container {
        animation-duration: 20s;
    }
    
    .ticker-item {
        min-width: 160px;
        padding: 8px 12px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 36px;
    }
    
    .hero-subtitle {
        font-size: 18px;
    }
    
    .crypto-converter-section {
        padding: 20px;
    }
    
    .converter-title {
        font-size: 20px;
    }
    
    .crypto-selector {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .features-title,
    .stats-title {
        font-size: 28px;
    }
}

/* ===== DARK MODE ADJUSTMENTS ===== */
[data-theme="dark"] .hero-section::before {
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="%23404040" stroke-width="0.5" opacity="0.3"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
}

[data-theme="dark"] .ticker-container {
    background: var(--bg-secondary);
}

/* ===== LOADING STATES ===== */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--border);
    border-top-color: var(--primary-green);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== ACCESSIBILITY ===== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus states */
.crypto-option:focus,
.buy-now-btn:focus {
    outline: 2px solid var(--primary-green);
    outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
