/* ========================================
   CSS Variables & Base Styles
   ======================================== */
:root {
    /* Colors */
    --primary: #0066FF;
    --primary-dark: #0052CC;
    --primary-light: #3385FF;
    --secondary: #6B46C1;
    --accent: #8B5CF6;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #0066FF 0%, #8B5CF6 100%);
    --gradient-hero: linear-gradient(135deg, #0066FF 0%, #6B46C1 50%, #8B5CF6 100%);
    --gradient-card: linear-gradient(135deg, #F8FAFC 0%, #F1F5F9 100%);
    
    /* Text Colors */
    --text-primary: #1E293B;
    --text-secondary: #64748B;
    --text-light: #94A3B8;
    
    /* Background Colors */
    --bg-primary: #FFFFFF;
    --bg-secondary: #F8FAFC;
    --bg-tertiary: #F1F5F9;
    
    /* Status Colors */
    --success: #10B981;
    --error: #EF4444;
    --warning: #F59E0B;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    
    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ========================================
   Reset & Base
   ======================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-family);
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   Typography
   ======================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
    margin-bottom: 1rem;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-dark);
}

/* ========================================
   Layout
   ======================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ========================================
   Header
   ======================================== */
.header {
    background: var(--bg-primary);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 1rem 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.logo span {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--primary);
}

/* ========================================
   Hero Section
   ======================================== */
.hero {
    background: var(--gradient-hero);
    padding: 4rem 0;
    color: white;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 800;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 3rem;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
}

.stat-label {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* ========================================
   Ad Placeholder
   ======================================== */
.ad-placeholder {
    background: var(--bg-tertiary);
    border: 2px dashed var(--text-light);
    border-radius: var(--radius-md);
    padding: 3rem;
    text-align: center;
    color: var(--text-light);
    margin: 2rem auto;
    max-width: 728px;
}

/* ========================================
   Calculator Section
   ======================================== */
.calculator-section {
    padding: 4rem 0;
}

.calculator-wrapper {
    max-width: 800px;
    margin: 0 auto;
}

.calculator-card {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    box-shadow: var(--shadow-xl);
}

.calculator-title {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

.section-subtitle {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

/* Rate Selection */
.rate-selection {
    margin-bottom: 2rem;
}

.rate-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.rate-btn {
    background: var(--bg-secondary);
    border: 2px solid var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.rate-btn:hover {
    border-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.rate-btn.active {
    background: var(--gradient-primary);
    border-color: var(--primary);
    color: white;
}

.rate-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.rate-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.rate-btn.active .rate-label {
    color: white;
    opacity: 0.9;
}

/* Custom Rate */
.custom-rate {
    margin-top: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.custom-rate-input {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.custom-rate-input input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: var(--font-family);
}

.input-suffix {
    font-weight: 600;
    color: var(--text-secondary);
}

/* Calculator Inputs */
.calculator-inputs {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1.5rem;
    align-items: center;
    margin-bottom: 2rem;
}

.conversion-arrow {
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-field {
    width: 100%;
    padding: 1rem;
    padding-right: 2.5rem;
    border: 2px solid var(--bg-tertiary);
    border-radius: var(--radius-md);
    font-size: 1.25rem;
    font-family: var(--font-family);
    font-weight: 600;
    transition: border-color 0.3s ease;
}

.input-field:focus {
    outline: none;
    border-color: var(--primary);
}

.input-currency {
    position: absolute;
    right: 1rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-secondary);
    pointer-events: none;
}

.input-help {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* Results Card */
.results-card {
    background: var(--gradient-card);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.results-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.results-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: white;
    border-radius: var(--radius-sm);
}

.result-row.highlight {
    background: var(--gradient-primary);
    color: white;
}

.result-label {
    font-size: 0.875rem;
    font-weight: 500;
}

.result-value {
    font-size: 1.25rem;
    font-weight: 700;
}

/* Action Buttons */
.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-family);
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid var(--bg-tertiary);
}

/* ========================================
   Rates Section
   ======================================== */
.rates-section {
    padding: 4rem 0;
    background: var(--bg-primary);
}

.section-title {
    text-align: center;
    margin-bottom: 1rem;
}

.section-description {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.rates-table-wrapper {
    overflow-x: auto;
}

.rates-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.rates-table thead {
    background: var(--gradient-primary);
    color: white;
}

.rates-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
}

.rates-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--bg-tertiary);
}

.rates-table tbody tr:last-child td {
    border-bottom: none;
}

.rates-table tbody tr:hover {
    background: var(--bg-secondary);
}

/* ========================================
   Guide Section
   ======================================== */
.guide-section {
    padding: 4rem 0;
}

.guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.guide-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    transition: transform 0.3s ease;
}

.guide-card:hover {
    transform: translateY(-4px);
}

.guide-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.guide-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.guide-text {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.formula-box {
    background: var(--bg-secondary);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin: 1rem 0;
    font-family: 'Courier New', monospace;
}

.formula-box code {
    display: block;
    margin: 0.5rem 0;
    color: var(--text-primary);
    font-weight: 600;
}

.guide-example {
    font-size: 0.875rem;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    padding: 1rem;
    border-radius: var(--radius-sm);
    margin-top: 1rem;
}

/* ========================================
   Examples Section
   ======================================== */
.examples-section {
    padding: 4rem 0;
    background: var(--bg-primary);
}

.examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.example-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transition: transform 0.3s ease;
}

.example-card:hover {
    transform: translateY(-4px);
}

.example-header {
    background: var(--gradient-primary);
    color: white;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.example-icon {
    font-size: 2rem;
}

.example-title {
    font-size: 1.25rem;
}

.example-content {
    padding: 1.5rem;
}

.example-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--bg-tertiary);
}

.example-detail:last-child {
    border-bottom: none;
}

.example-detail.highlight {
    background: var(--bg-secondary);
    margin: 0 -1.5rem;
    padding: 0.75rem 1.5rem;
    border-bottom: none;
}

.example-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.example-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* ========================================
   FAQ Section
   ======================================== */
.faq-section {
    padding: 4rem 0;
}

.faq-grid {
    display: grid;
    gap: 1.5rem;
    max-width: 900px;
    margin: 0 auto;
}

.faq-item {
    background: white;
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.faq-question {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.faq-answer {
    color: var(--text-secondary);
    line-height: 1.8;
}

.faq-answer ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.faq-answer li {
    margin: 0.5rem 0;
}

/* ========================================
   Footer
   ======================================== */
.footer {
    background: var(--text-primary);
    color: white;
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-title {
    font-size: 1.125rem;
    margin-bottom: 1rem;
}

.footer-text {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.8;
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin: 0.5rem 0;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
}

.footer-disclaimer {
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* ========================================
   Toast Notification
   ======================================== */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--success);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    opacity: 0;
    transform: translateY(100px);
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 2000;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   Responsive Design
   ======================================== */

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-stats {
        gap: 2rem;
    }
}

/* Mobile (< 768px) */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    /* Header */
    .nav {
        display: none;
    }
    
    .logo {
        font-size: 1.25rem;
    }
    
    /* Hero */
    .hero {
        padding: 3rem 0;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    /* Calculator */
    .calculator-card {
        padding: 1.5rem;
    }
    
    .rate-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .calculator-inputs {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .conversion-arrow {
        transform: rotate(90deg);
    }
    
    .action-buttons {
        grid-template-columns: 1fr;
    }
    
    /* Typography */
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.25rem; }
    
    /* Guide & Examples */
    .guide-grid,
    .examples-grid {
        grid-template-columns: 1fr;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
    }
    
    .toast {
        right: 1rem;
        left: 1rem;
        bottom: 1rem;
    }
}

/* Small Mobile (< 480px) */
@media (max-width: 480px) {
    html {
        font-size: 14px;
    }
    
    .rate-buttons {
        grid-template-columns: 1fr;
    }
    
    .input-field {
        font-size: 1rem;
        padding: 0.875rem;
    }
    
    .btn {
        padding: 0.875rem 1rem;
        font-size: 0.875rem;
    }
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
    .header,
    .nav,
    .hero,
    .ad-placeholder,
    .action-buttons,
    .footer,
    .toast {
        display: none !important;
    }
    
    .calculator-card,
    .results-card {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    body {
        background: white;
    }
}

/* ========================================
   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-width: 0;
}

/* Focus Styles */
*:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ========================================
   Animations
   ======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease;
}
