@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap');

:root {
    /* Canadian Red/Maple Theme - UNIQUE */
    --canada-red: #dc2626;
    --canada-dark-red: #991b1b;
    --canada-burgundy: #7f1d1d;
    --accent-gold: #f59e0b;

    --text-dark: #1f2937;
    --text-gray: #4b5563;
    --text-muted: #6b7280;
    --text-light: #9ca3b8;

    --bg-white: #ffffff;
    --bg-gray: #f9fafb;
    --bg-red-light: #fef2f2;
    --bg-red-lighter: #fee2e2;

    --border-gray: #e5e7eb;
    --border-red: #fca5a5;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 24px rgba(220, 38, 38, 0.15);

    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;

    --transition: 0.2s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    color: var(--text-dark);
    background: var(--bg-gray);
    line-height: 1.6;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header - Canadian Style */
header {
    background: var(--bg-white);
    border-bottom: 4px solid var(--canada-red);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--canada-red);
}

.global-badge {
    background: linear-gradient(135deg, var(--canada-red), var(--canada-dark-red));
    color: white;
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Hero Banner - Slim & Clean */
.hero-banner {
    background: linear-gradient(135deg, var(--canada-red) 0%, var(--canada-burgundy) 100%);
    color: white;
    padding: 48px 0;
    text-align: center;
}

.hero-banner h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 12px;
}

.hero-banner p {
    font-size: 1.1rem;
    opacity: 0.95;
}

/* UNIQUE: Split-Screen Calculator Layout */
.calculator-section {
    padding: 48px 0;
}

.calc-wrapper {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 32px;
    align-items: start;
}

/* Left Panel - Input & Province Selector */
.input-panel {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.panel-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-gray);
}

.panel-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-dark);
}

/* Country & Currency Selects */
.country-select,
.state-select,
.currency-select {
    width: 100%;
    padding: 14px;
    border: 2px solid var(--border-gray);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    background: var(--bg-gray);
    cursor: pointer;
    transition: all var(--transition);
}

.country-select:hover,
.state-select:hover,
.currency-select:hover {
    border-color: var(--canada-red);
}

.country-select:focus,
.state-select:focus,
.currency-select:focus {
    outline: none;
    border-color: var(--canada-red);
    background: white;
}

/* Calculation Mode Switch */
.calc-mode-switch {
    display: flex;
    gap: 12px;
}

.mode-btn {
    flex: 1;
    padding: 14px;
    border: 2px solid var(--border-gray);
    background: var(--bg-gray);
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.mode-btn:hover {
    border-color: var(--canada-red);
}

.mode-btn.active {
    background: var(--canada-red);
    border-color: var(--canada-dark-red);
    color: white;
}

/* Amount Input */
.amount-input-group {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-gray);
    border: 3px solid var(--border-gray);
    border-radius: var(--radius);
    padding: 0 16px;
    transition: border-color var(--transition);
}

.amount-input-group:focus-within {
    border-color: var(--canada-red);
    background: white;
}

.currency-symbol {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--canada-red);
}

#amountInput {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 2rem;
    font-weight: 700;
    padding: 16px 12px;
    color: var(--text-dark);
    outline: none;
}

#amountInput::placeholder {
    color: var(--text-light);
}

.currency-code {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
}

.input-hint {
    margin-top: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Calculate Button */
.btn-calculate {
    background: linear-gradient(135deg, var(--canada-red), var(--canada-dark-red));
    color: white;
    border: none;
    padding: 18px 32px;
    border-radius: var(--radius);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: var(--shadow-lg);
    transition: all var(--transition);
}

.btn-calculate:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(220, 38, 38, 0.25);
}

/* Right Panel - Results (Sticky) */
.results-panel {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    padding: 32px;
    box-shadow: var(--shadow-lg);
    border: 2px solid var(--border-red);
    position: sticky;
    top: 100px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--bg-gray);
}

.results-header h3 {
    font-size: 1.3rem;
    font-weight: 700;
}

.selected-province {
    background: var(--bg-red-lighter);
    color: var(--canada-red);
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Main Result Display */
.result-main {
    text-align: center;
    padding: 24px;
    background: linear-gradient(135deg, var(--bg-red-light) 0%, var(--bg-red-lighter) 100%);
    border-radius: var(--radius-lg);
    margin-bottom: 28px;
}

.result-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-value-large {
    font-size: 3rem;
    font-weight: 800;
    color: var(--canada-red);
    line-height: 1;
}

/* Breakdown Card */
.breakdown-card {
    background: var(--bg-gray);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
}

.breakdown-card h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-dark);
}

.breakdown-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    font-size: 0.95rem;
}

.breakdown-row span {
    color: var(--text-gray);
}

.breakdown-row strong {
    color: var(--text-dark);
    font-weight: 600;
}

.tax-row {
    color: var(--canada-red);
}

.tax-row span {
    color: var(--text-gray);
}

.tax-row strong {
    color: var(--canada-red);
}

.breakdown-divider {
    height: 2px;
    background: var(--border-gray);
    margin: 12px 0;
}

.total-row {
    border-top: 2px solid var(--canada-red);
    padding-top: 16px !important;
    margin-top: 8px;
}

.total-row span,
.total-row strong {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--canada-red);
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.btn-action {
    background: var(--bg-gray);
    border: 2px solid var(--border-gray);
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-gray);
    transition: all var(--transition);
}

.btn-action:hover {
    background: var(--canada-red);
    border-color: var(--canada-dark-red);
    color: white;
}

/* Rates Table Section */
.rates-section {
    padding: 60px 0;
    background: var(--bg-white);
}

.rates-section h2 {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 40px;
    color: var(--text-dark);
}

.rates-table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.rates-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-white);
}

.rates-table thead {
    background: linear-gradient(135deg, var(--canada-red), var(--canada-dark-red));
    color: white;
}

.rates-table th {
    padding: 16px 20px;
    text-align: left;
    font-weight: 600;
    font-size: 0.95rem;
}

.rates-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-gray);
}

.rates-table tbody tr:hover {
    background: var(--bg-red-light);
}

.rates-table tbody tr:last-child td {
    border-bottom: none;
}

/* Footer */
footer {
    background: var(--text-dark);
    color: white;
    padding: 24px 0;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .calc-wrapper {
        grid-template-columns: 1fr;
    }

    .results-panel {
        position: static;
    }
}

@media (max-width: 768px) {
    .hero-banner h1 {
        font-size: 2rem;
    }

    .province-grid {
        grid-template-columns: 1fr;
    }

    .calc-mode-switch {
        flex-direction: column;
    }

    #amountInput {
        font-size: 1.5rem;
    }

    .result-value-large {
        font-size: 2.2rem;
    }

    .quick-actions {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .rates-table {
        font-size: 0.85rem;
    }

    .rates-table th,
    .rates-table td {
        padding: 12px 10px;
    }
}

/* History Section */
.history-section {
    padding: 60px 0;
    background: var(--bg-red-light);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-item {
    background: var(--bg-white);
    padding: 20px;
    border-radius: var(--radius);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    animation: slideIn 0.3s ease-out;
}

.history-info {
    display: flex;
    gap: 20px;
}

.history-meta {
    display: flex;
    flex-direction: column;
}

.history-country {
    font-weight: 700;
    color: var(--canada-red);
}

.history-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.history-amounts {
    display: flex;
    gap: 32px;
    align-items: center;
}

.history-amount-group {
    display: flex;
    flex-direction: column;
    text-align: right;
}

.history-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}

.history-val {
    font-weight: 700;
    font-size: 1.1rem;
}

/* FAQ Section */
.faq-section {
    padding: 80px 0;
    background: var(--bg-white);
}

.faq-section h2 {
    text-align: center;
    margin-bottom: 48px;
    font-size: 2rem;
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
}

.faq-item h3 {
    font-size: 1.1rem;
    margin-bottom: 12px;
    color: var(--canada-dark-red);
}

.faq-item p {
    color: var(--text-gray);
    font-size: 0.95rem;
}

.btn-text {
    background: none;
    border: none;
    color: var(--canada-red);
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
}

@media (max-width: 768px) {
    .history-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .history-amounts {
        width: 100%;
        justify-content: space-between;
    }

    .faq-grid {
        grid-template-columns: 1fr;
    }
}