/* ===== CSS Variables & Reset ===== */
:root {
    --bg-dark: #0a0f1c;
    --bg-card: rgba(20, 30, 55, 0.7);
    --bg-card-hover: rgba(30, 45, 80, 0.8);
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --accent: #22d3ee;
    --accent-green: #10b981;
    --accent-orange: #f59e0b;
    --accent-red: #ef4444;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border: rgba(99, 102, 241, 0.2);
    --border-light: rgba(255, 255, 255, 0.1);
    --shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.3);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== Background Effects ===== */
.background-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 20s ease-in-out infinite;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
    top: -200px;
    right: -200px;
    animation-delay: 0s;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, var(--accent) 0%, #0891b2 100%);
    bottom: -150px;
    left: -150px;
    animation-delay: -7s;
}

.orb-3 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    25% {
        transform: translate(30px, -30px) scale(1.05);
    }

    50% {
        transform: translate(-20px, 20px) scale(0.95);
    }

    75% {
        transform: translate(20px, 30px) scale(1.02);
    }
}

/* ===== Container ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* ===== Header ===== */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0 40px;
    gap: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    color: inherit;
    flex-shrink: 0;
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-glow);
}

.logo-icon svg {
    width: 24px;
    height: 24px;
    color: white;
}

.logo h1,
.logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* Header Navigation */
.header-nav {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.nav-link {
    padding: 8px 14px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    border: 1px solid transparent;
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-card);
    border-color: var(--border);
}

.nav-link.active {
    color: white;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-color: var(--primary);
}

/* Hamburger Menu Button */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Prevent body scroll when menu is open */
body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

.updated-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
    padding: 10px 18px;
    border-radius: 100px;
    font-size: 0.875rem;
    font-weight: 600;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.pulse {
    width: 8px;
    height: 8px;
    background: var(--accent-green);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

/* ===== Main Content ===== */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.intro-section {
    text-align: center;
    padding: 0 20px;
}

.intro-section p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto;
}

.calc-subtitle {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--accent);
    margin: 8px 0 12px;
    text-align: center;
}

.intro-section strong {
    color: var(--accent);
}

/* ===== Calculator Tabs ===== */
.calculator-tabs {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 28px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(20px);
}

.tab-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-color: var(--primary);
    color: white;
    box-shadow: var(--shadow-glow);
}

.tab-icon {
    font-size: 1.25rem;
}

/* ===== Calculator Card ===== */
.calculator-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 40px;
    backdrop-filter: blur(30px);
    box-shadow: var(--shadow);
}

.tab-description {
    text-align: center;
    margin-bottom: 30px;
    padding: 16px 24px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: var(--radius-md);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.tab-description p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ===== Input Section ===== */
.input-section {
    margin-bottom: 30px;
}

.input-section label {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.currency-symbol {
    position: absolute;
    left: 24px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-light);
}

.input-wrapper input {
    width: 100%;
    padding: 20px 24px 20px 60px;
    font-size: 1.5rem;
    font-weight: 600;
    font-family: inherit;
    background: rgba(15, 23, 42, 0.6);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.input-wrapper input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
    background: rgba(15, 23, 42, 0.8);
}

.input-hint {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 8px;
}

/* ===== Calculate Button ===== */
.calculate-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px 40px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    border-radius: var(--radius-lg);
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px -10px rgba(99, 102, 241, 0.5);
}

.calculate-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px -10px rgba(99, 102, 241, 0.6);
}

.calculate-btn:active {
    transform: translateY(-1px);
}

/* ===== Results Section ===== */
.results-section {
    display: none;
    margin-top: 40px;
    padding-top: 40px;
    border-top: 1px solid var(--border);
    animation: fadeInUp 0.5s ease;
}

.results-section.show {
    display: block;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.results-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
}

.buyer-type-badge {
    padding: 8px 16px;
    background: rgba(34, 211, 238, 0.15);
    color: var(--accent);
    border-radius: 100px;
    font-size: 0.875rem;
    font-weight: 600;
    border: 1px solid rgba(34, 211, 238, 0.3);
}

.total-sdlt {
    text-align: center;
    padding: 30px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.total-sdlt .label {
    display: block;
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.total-sdlt .amount {
    display: block;
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.effective-rate {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: rgba(15, 23, 42, 0.5);
    border-radius: var(--radius-md);
    margin-bottom: 30px;
}

.effective-rate .label {
    color: var(--text-secondary);
    font-weight: 500;
}

.effective-rate .rate {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-green);
}

/* ===== Breakdown Section ===== */
.breakdown-section {
    margin-bottom: 30px;
}

.breakdown-section h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.breakdown-table {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.breakdown-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 15px;
    padding: 14px 20px;
    background: rgba(15, 23, 42, 0.4);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    align-items: center;
}

.breakdown-row.header {
    background: rgba(99, 102, 241, 0.1);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.breakdown-row .band {
    color: var(--text-primary);
}

.breakdown-row .rate {
    color: var(--primary-light);
    font-weight: 600;
    text-align: center;
}

.breakdown-row .tax {
    color: var(--accent-green);
    font-weight: 700;
    text-align: right;
}

/* ===== Summary Box ===== */
.summary-box {
    background: rgba(15, 23, 42, 0.6);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 1rem;
}

.summary-row:last-child {
    border-bottom: none;
}

.summary-row span:first-child {
    color: var(--text-secondary);
}

.summary-row span:last-child {
    font-weight: 600;
    color: var(--text-primary);
}

.summary-row.total {
    margin-top: 10px;
    padding-top: 20px;
    border-top: 2px solid var(--primary);
    border-bottom: none;
}

.summary-row.total span:first-child {
    font-weight: 700;
    color: var(--text-primary);
}

.summary-row.total span:last-child {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--accent);
}

/* ===== Rates Section ===== */
.rates-section {
    margin-top: 20px;
}

.rates-section h2 {
    text-align: center;
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 30px;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.rates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

.rate-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 28px;
    backdrop-filter: blur(20px);
    transition: all 0.3s ease;
}

.rate-card:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: var(--shadow-glow);
}

.rate-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.rate-card table {
    width: 100%;
    border-collapse: collapse;
}

.rate-card th,
.rate-card td {
    padding: 12px 8px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.9rem;
}

.rate-card th {
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.rate-card td {
    color: var(--text-secondary);
}

.rate-card .rate-value {
    color: var(--primary-light);
    font-weight: 700;
}

.rate-card tbody tr:last-child td {
    border-bottom: none;
}

.rate-note {
    margin-top: 16px;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
}

/* ===== Info Section ===== */
.info-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 10px;
}

.info-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    backdrop-filter: blur(20px);
    transition: all 0.3s ease;
}

.info-card:hover {
    border-color: var(--accent);
}

.info-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.info-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
}

.info-card strong {
    color: var(--accent);
}

/* ===== Footer ===== */
.footer {
    margin-top: 60px;
    padding: 40px 0 30px;
    border-top: 1px solid var(--border);
}

.footer-top {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-brand {
    max-width: 300px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.15rem;
    margin-bottom: 12px;
}

.footer-logo svg {
    color: var(--primary-light);
}

.footer-tagline {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

.footer-links-section h4 {
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-nav {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.footer-nav a:hover {
    color: var(--primary-light);
    padding-left: 5px;
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid var(--border-light);
}

.footer-bottom p {
    color: var(--text-muted);
    font-size: 0.85rem;
    max-width: 700px;
    margin: 0 auto 10px;
    line-height: 1.6;
}

.footer-bottom .disclaimer {
    font-size: 0.8rem;
    color: var(--text-muted);
    opacity: 0.8;
}

.footer-bottom .copyright {
    margin-top: 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .header {
        position: relative;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
        gap: 16px;
        padding: 15px 0 25px;
    }

    /* Show hamburger menu button */
    .menu-toggle {
        display: flex;
        order: 2;
    }

    /* Hide navigation by default */
    .header-nav {
        position: fixed;
        top: 90px;
        left: 15px;
        right: 15px;
        width: calc(100% - 30px);
        max-width: 1200px;
        background: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: var(--radius-lg);
        padding: 16px;
        margin: 0 auto;
        flex-direction: column;
        gap: 8px;
        box-shadow: var(--shadow-lg);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: all 0.3s ease;
        z-index: 1000;
        max-height: 0;
        overflow: hidden;
    }

    /* Show navigation when active */
    .header-nav.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        max-height: 500px;
        overflow: visible;
    }

    .nav-link {
        padding: 12px 16px;
        font-size: 0.9rem;
        width: 100%;
        text-align: center;
        border-radius: var(--radius-md);
    }

    .logo {
        flex-direction: row;
        text-align: left;
        gap: 12px;
        order: 1;
        flex: 1;
    }

    .logo-icon {
        width: 40px;
        height: 40px;
    }

    .logo-icon svg {
        width: 20px;
        height: 20px;
    }

    .logo h1,
    .logo-text {
        font-size: 1.25rem;
    }

    .tagline {
        font-size: 0.7rem;
    }

    .calculator-tabs {
        flex-direction: column;
    }

    .tab-btn {
        width: 100%;
        justify-content: center;
    }

    .calculator-card {
        padding: 24px;
    }

    .input-wrapper input {
        font-size: 1.25rem;
        padding: 18px 20px 18px 50px;
    }

    .currency-symbol {
        left: 18px;
        font-size: 1.25rem;
    }

    .total-sdlt .amount {
        font-size: 2.25rem;
    }

    .breakdown-row {
        grid-template-columns: 1.5fr 0.75fr 1fr;
        gap: 8px;
        padding: 12px 14px;
        font-size: 0.85rem;
    }

    .rates-grid {
        grid-template-columns: 1fr;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .tab-text {
        font-size: 0.9rem;
    }

    .breakdown-row {
        font-size: 0.8rem;
    }

    .effective-rate {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }

    .footer-top {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }

    .footer-brand {
        max-width: 100%;
    }

    .footer-nav {
        align-items: center;
    }

    .footer-nav a:hover {
        padding-left: 0;
    }
}