* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f8fafc;
    color: #1e293b;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Premium Color Palette */
:root {
    --bg-primary: #f8fafc;
    --bg-card: #ffffff;
    --border-light: #e9eef3;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --accent: #6366f1;
    --accent-dark: #4f46e5;
    --accent-light: #eef2ff;
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.02), 0 2px 4px rgba(0, 0, 0, 0.02);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0, 0, 0, 0.02);
    --shadow-lg: 0 12px 24px -8px rgba(0, 0, 0, 0.05), 0 4px 8px rgba(0, 0, 0, 0.02);
    --shadow-hover: 0 20px 32px -12px rgba(0, 0, 0, 0.08);
    --radius-card: 20px;
    --radius-element: 14px;
    --radius-sm: 10px;
}

/* Header */
.header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

.header-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0.875rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: -0.02em;
}

.logo span {
    font-weight: 500;
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9375rem;
    transition: color 0.2s ease;
}

.nav a:hover,
.nav a.active {
    color: var(--accent);
}

.auth {
    display: flex;
    gap: 0.75rem;
}

.btn-auth {
    padding: 0.5rem 1.125rem;
    border-radius: 2rem;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn-signin {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
}

.btn-signin:hover {
    background: var(--bg-primary);
    border-color: var(--accent);
}

.btn-signup {
    background: var(--accent);
    color: white;
}

.btn-signup:hover {
    background: var(--accent-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0.5rem;
    font-size: 1.25rem;
}

/* Main Container */
.main-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 2rem;
}

/* 3-Column Layout */
.layout-grid {
    display: grid;
    grid-template-columns: 280px 1fr 320px;
    gap: 1.75rem;
    margin-bottom: 3rem;
}

/* Sidebar Cards */
.sidebar-left,
.sidebar-right {
    align-self: start;
    position: sticky;
    top: 90px;
}

.sidebar-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-card);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 1.5rem;
}

.category-group {
    margin-bottom: 1.25rem;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.625rem 0;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: color 0.2s;
}

.category-header:hover {
    color: var(--accent);
}

.category-header i:first-child {
    margin-right: 0.5rem;
}

.chevron {
    transition: transform 0.25s ease;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.chevron.rotated {
    transform: rotate(180deg);
}

.category-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    padding-left: 1.5rem;
}

.category-content.open {
    max-height: 300px;
}

.category-content a {
    display: block;
    padding: 0.625rem 0.75rem;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.875rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.category-content a i {
    margin-right: 0.5rem;
    width: 1.25rem;
    font-size: 0.8125rem;
}

.category-content a:hover,
.category-content a.active {
    background: var(--accent-light);
    color: var(--accent);
    font-weight: 500;
}

/* Insights Card */
.insights-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.insight-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-light);
}

.insight-item:last-child {
    border-bottom: none;
}

.insight-item i {
    font-size: 1.25rem;
    color: var(--accent);
}

.insight-item strong {
    font-size: 0.875rem;
    display: block;
    margin-bottom: 0.25rem;
}

.insight-item p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Tool Area */
.tool-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.tool-header {
    padding: 1.75rem 2rem 1rem 2rem;
    border-bottom: 1px solid var(--border-light);
}

.tool-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--accent);
    background: var(--accent-light);
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    margin-bottom: 0.75rem;
}

.tool-header h1 {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.tool-description {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.5;
}

/* Input Card */
.input-card {
    padding: 1.75rem 2rem;
    border-bottom: 1px solid var(--border-light);
}

/* Search Section */
.search-section {
    margin-bottom: 1.5rem;
}

.search-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.search-field label {
    font-weight: 600;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.search-input-wrapper {
    display: flex;
    gap: 0.5rem;
}

.search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-element);
    font-size: 0.875rem;
    transition: all 0.2s;
    font-family: inherit;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.search-btn {
    padding: 0.75rem 1.25rem;
    background: var(--accent);
    border: none;
    border-radius: var(--radius-element);
    color: white;
    cursor: pointer;
    transition: all 0.2s;
}

.search-btn:hover {
    background: var(--accent-dark);
}

.country-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-element);
    font-size: 0.875rem;
    font-family: inherit;
    background: white;
    cursor: pointer;
}

.country-select:focus {
    outline: none;
    border-color: var(--accent);
}

/* Analysis Options */
.analysis-options {
    margin-bottom: 1.5rem;
}

.analysis-options label {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.analysis-buttons {
    display: flex;
    gap: 1rem;
}

.analysis-btn {
    flex: 1;
    padding: 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-element);
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-family: inherit;
}

.analysis-btn i {
    font-size: 1.25rem;
    color: var(--accent);
}

.analysis-btn.active {
    border-color: var(--accent);
    background: var(--accent-light);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

.analysis-badge {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Time Range */
.time-range {
    margin-bottom: 1.5rem;
}

.time-range label {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.range-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.range-btn {
    padding: 0.5rem 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: 2rem;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
    font-family: inherit;
}

.range-btn:hover {
    border-color: var(--accent);
}

.range-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* Generate Button */
.btn-generate {
    width: 100%;
    padding: 0.875rem;
    background: var(--accent);
    border: none;
    border-radius: var(--radius-element);
    color: white;
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: inherit;
}

.btn-generate:hover {
    background: var(--accent-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* Output Card */
.output-card {
    padding: 1.75rem 2rem;
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.output-header span:first-child {
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    background: var(--accent-light);
    color: var(--accent);
    border-radius: 2rem;
}

/* Analysis Results */
.analysis-results {
    margin-bottom: 1rem;
}

.result-card {
    background: var(--bg-primary);
    border-radius: var(--radius-element);
    padding: 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border-light);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-light);
}

.result-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
}

.result-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
}

.result-metric {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.metric-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

.metric-label {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.metric-value {
    font-weight: 600;
    color: var(--text-primary);
}

.trend-up {
    color: var(--success);
}

.trend-down {
    color: var(--danger);
}

/* Loading State */
.loading-state {
    padding: 3rem;
    text-align: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-light);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Right Sidebar Content */
.sidebar-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Rank List */
.rank-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.rank-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
}

.rank {
    width: 28px;
    height: 28px;
    background: var(--accent-light);
    color: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
}

.rank-info {
    flex: 1;
}

.rank-info strong {
    font-size: 0.875rem;
    display: block;
}

.rank-info span {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* News List */
.news-list {
    list-style: none;
}

.news-list li {
    margin-bottom: 0.875rem;
    padding-bottom: 0.875rem;
    border-bottom: 1px solid var(--border-light);
}

.news-list li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.news-list a {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
    transition: color 0.2s;
}

.news-list a i {
    font-size: 0.6875rem;
    color: var(--accent);
}

.news-list a:hover {
    color: var(--accent);
}

.news-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
    display: block;
    margin-left: 1.25rem;
}

/* Currency Card */
.currency-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.currency-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-light);
}

.currency-item:last-child {
    border-bottom: none;
}

.trend {
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.trend.up {
    color: var(--success);
}

.trend.down {
    color: var(--danger);
}

.update-time {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 0.75rem;
    text-align: center;
}

/* FAQ Section */
.faq-section {
    margin-top: 2rem;
    padding: 2rem 0;
}

.faq-header {
    text-align: center;
    margin-bottom: 2rem;
}

.faq-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.faq-header p {
    color: var(--text-secondary);
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.faq-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-card);
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.faq-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: var(--text-primary);
}

.faq-question span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.faq-question span i {
    color: var(--accent);
}

.faq-chevron {
    transition: transform 0.25s ease;
    color: var(--text-muted);
}

.faq-card.open .faq-chevron {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.5;
    margin-top: 0;
}

.faq-card.open .faq-answer {
    max-height: 150px;
    margin-top: 0.75rem;
}

/* Footer */
.footer {
    border-top: 1px solid var(--border-light);
    background: var(--bg-card);
    margin-top: 3rem;
    padding: 2rem 2rem 1.5rem;
}

.footer-content {
    max-width: 1440px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-brand .logo {
    margin-bottom: 0.25rem;
}

.footer-brand p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.footer-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--accent);
}

.footer-copyright {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Mobile Drawer */
.mobile-drawer {
    position: fixed;
    top: 0;
    right: -320px;
    width: 320px;
    height: 100%;
    background: var(--bg-card);
    z-index: 1000;
    transition: right 0.3s ease;
    box-shadow: var(--shadow-lg);
    padding: 1.5rem;
    overflow-y: auto;
}

.mobile-drawer.open {
    right: 0;
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-light);
}

.close-drawer {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0.5rem;
}

.drawer-nav {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.drawer-nav a {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.drawer-nav a i {
    width: 1.25rem;
    color: var(--accent);
}

.drawer-nav a.active {
    color: var(--accent);
}

.drawer-divider {
    height: 1px;
    background: var(--border-light);
    margin: 1rem 0;
}

.drawer-categories .category-group {
    margin-bottom: 1rem;
}

.drawer-categories .category-header {
    padding: 0.5rem 0;
}

.drawer-categories .category-header i:first-child {
    margin-right: 0.5rem;
}

.drawer-categories .category-content {
    padding-left: 1.75rem;
}

.drawer-categories .category-content a i {
    margin-right: 0.5rem;
    width: 1.25rem;
}

.drawer-auth {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.drawer-auth button {
    padding: 0.75rem;
    border-radius: var(--radius-element);
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: inherit;
}

.drawer-auth .btn-signin {
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-primary);
}

.drawer-auth .btn-signup {
    background: var(--accent);
    color: white;
    border: none;
}

.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    z-index: 999;
    display: none;
}

.drawer-overlay.active {
    display: block;
}

/* Responsive */
@media (max-width: 1024px) {
    .layout-grid {
        grid-template-columns: 240px 1fr 280px;
        gap: 1.25rem;
    }
}

@media (max-width: 768px) {
    .header-container {
        padding: 0.75rem 1.25rem;
    }
    
    .nav,
    .auth {
        display: none;
    }
    
    .hamburger {
        display: block;
    }
    
    .main-container {
        padding: 1.25rem;
    }
    
    .layout-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .sidebar-left {
        display: none;
    }
    
    .sidebar-right {
        order: 2;
        position: static;
    }
    
    .tool-area {
        order: 1;
    }
    
    .tool-header,
    .input-card,
    .output-card {
        padding: 1.25rem;
    }
    
    .tool-header h1 {
        font-size: 1.5rem;
    }
    
    .search-grid {
        grid-template-columns: 1fr;
    }
    
    .analysis-buttons {
        flex-direction: column;
    }
    
    .analysis-btn {
        text-align: center;
        align-items: center;
    }
    
    .faq-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-links {
        justify-content: center;
    }
    
    .range-buttons {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .tool-card {
        border-radius: var(--radius-element);
    }
    
    .faq-card {
        padding: 1rem;
    }
    
    .result-metric {
        grid-template-columns: 1fr;
    }
}