:root {
    /* Dark Mode (Default) */
    --bg-color: #0d0f1a;
    --surface-color: rgba(23, 27, 48, 0.8);
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --accent-color: #f43f5e;
    --text-color: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.1);
    --input-bg: rgba(255, 255, 255, 0.05);
    --glass-blur: blur(12px);
    --container-width: 1200px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --gradient-1: rgba(99, 102, 241, 0.15);
    --gradient-2: rgba(244, 63, 94, 0.1);
}

[data-theme="light"] {
    --bg-color: #f8fafc;
    --surface-color: rgba(255, 255, 255, 0.9);
    --text-color: #0f172a;
    --text-muted: #64748b;
    --border-color: rgba(15, 23, 42, 0.1);
    --input-bg: #fff;
    --shadow: 0 10px 40px rgba(15, 23, 42, 0.08);
    --gradient-1: rgba(99, 102, 241, 0.08);
    --gradient-2: rgba(244, 63, 94, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

html {
    overflow-x: hidden;
    width: 100%;
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg-color);
    background-image:
        radial-gradient(at 50% 0%, var(--gradient-1) 0, transparent 40%),
        radial-gradient(at 100% 100%, var(--gradient-2) 0, transparent 40%);
    color: var(--text-color);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 2rem;
}

/* Sticky Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--surface-color);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
}

.header-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    text-decoration: none;
    color: var(--text-color);
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
}

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

.theme-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 0.5rem;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.theme-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
}

.theme-btn svg {
    width: 20px;
    height: 20px;
}

/* Hamburger Menu Toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    cursor: pointer;
    z-index: 1001;
}

.menu-toggle .bar {
    height: 3px;
    width: 100%;
    background: var(--text-color);
    border-radius: 10px;
    transition: var(--transition);
}

/* Animating Hamburger to X */
.menu-toggle.active .bar:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.menu-toggle.active .bar:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active .bar:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 5rem 1rem 3rem;
    max-width: 900px;
    margin: 0 auto;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1.25rem;
    background: linear-gradient(135deg, #fff 0%, var(--text-muted) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

[data-theme="light"] .hero h1 {
    background: linear-gradient(135deg, #0f172a 0%, #64748b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3.5rem;
    flex-wrap: wrap;
}

.hero-stat {
    background: var(--surface-color);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    padding: 0.6rem 1.2rem;
    border-radius: 100px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.8rem;
    box-shadow: var(--shadow);
}

.hero-stat:hover {
    transform: translateY(-3px);
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
}

.category-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
}

.hero-stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Search Wrap */
.search-wrap {
    position: relative;
    max-width: 600px;
    margin: 0 auto 4rem;
}

.search-icon {
    position: absolute;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    pointer-events: none;
}

#tool-search {
    width: 100%;
    padding: 1.2rem 1.5rem 1.2rem 3.5rem;
    background: var(--surface-color);
    border: 2px solid var(--border-color);
    border-radius: 100px;
    color: var(--text-color);
    font-size: 1.1rem;
    transition: var(--transition);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

#tool-search:focus {
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 15px 40px rgba(99, 102, 241, 0.15);
}

#no-results {
    display: none;
    text-align: center;
    padding: 3rem;
    font-size: 1.2rem;
    color: var(--text-muted);
}

/* Category Sections */
.category-section {
    margin-bottom: 5rem;
    transition: var(--transition);
}

.category-section.all-hidden {
    display: none;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary-color);
    letter-spacing: -1px;
}

.logo img {
    height: 42px;
    width: auto;
    display: block;
    transition: transform 0.3s ease;
}

.logo:hover img {
    transform: scale(1.05);
}

.category-header a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
}

.category-header a:hover {
    color: var(--primary-hover);
    transform: translateX(5px);
}

/* Tool Grid & Cards */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.tool-card.hidden-by-search {
    display: none;
}

/* Site Footer */
.site-footer {
    margin-top: 6rem;
    padding: 5rem 0 2rem;
    border-top: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.01);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
    padding: 0 2rem;
    text-align: left;
}

.footer-column h4 {
    color: var(--text-color);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary-color);
    padding-left: 5px;
}

.footer-bottom {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Glassmorphism Classes */
.glass-card {
    background: var(--surface-color);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

@media (hover: hover) {
    .glass-card:hover {
        transform: translateY(-5px);
        border-color: rgba(255, 255, 255, 0.2);
        box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.45);
    }
}

/* Tool Grid */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.tool-card {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
}

.tool-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, #a855f7 100%);
    border-radius: 18px;
    margin-bottom: 1rem;
    padding: 12px;
}

.tool-icon svg {
    width: 100%;
    height: 100%;
    fill: white;
}

.tool-card h2 {
    font-size: 1.5rem;
    font-weight: 700;
}

.tool-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Form Elements */
.input-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-muted);
}

input,
select {
    width: 100%;
    padding: 0.8rem 1rem;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-color);
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
}

input:focus,
select:focus {
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.08);
}

.btn {
    width: 100%;
    padding: 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn:hover {
    background: var(--primary-hover);
    transform: scale(1.02);
}

.action-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 1.5rem;
}

.btn-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-color);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-action:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.btn-action svg {
    width: 18px;
    height: 18px;
    stroke: var(--primary-color);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--surface-color);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--primary-color);
    color: var(--text-color);
    padding: 1rem 2rem;
    border-radius: 100px;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease-out forwards;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-area {
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    text-align: center;
    display: none;
}

.result-area.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 80%;
        background: var(--surface-color);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2rem;
        transition: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1000;
        border-left: 1px solid var(--border-color);
        visibility: hidden;
        pointer-events: none;
    }

    .nav-links.active {
        right: 0;
        visibility: visible;
        pointer-events: auto;
    }

    .nav-links a {
        font-size: 1.2rem;
        width: 100%;
        text-align: center;
        padding: 1rem;
    }

    .header-container {
        padding: 0 1.5rem;
    }

    header h1 {
        font-size: 2.2rem;
    }

    .container {
        padding: 1rem;
    }
}

/* ==========================================================================
   ToolOnWeb 'Pro' Layout System
   Restoring premium layout and component styles for all 45+ tools.
   ========================================================================== */

.tool-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1rem;
}

.pro-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 2.5rem;
    align-items: start;
    margin-top: 1rem;
}

/* Panel Containers */
.inputs-panel,
.main-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.results-panel,
.side-panel,
.res-panel {
    position: relative;
}

/* Sticky Result Sidebar */
.sticky-card {
    position: sticky;
    top: 100px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    animation: slideInRight 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.subject-row {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    margin-bottom: 1rem;
    background: rgba(255, 255, 255, 0.03);
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.subject-row input {
    flex: 1;
}

.subject-row input.credits,
.subject-row input.gp {
    max-width: 120px;
}

.main-panel, .side-panel, .glass-card, .tool-card {
    min-width: 0;
}

.responsive-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 600px) {
    .responsive-grid {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }
}

/* Responsive Stacking & Scaling */
@media (max-width: 1024px) {
    .container, .tool-container {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 1rem;
    }

    .pro-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .main-panel, .side-panel {
        width: 100% !important;
        min-width: 0 !important;
    }

    .sticky-card {
        position: static;
        width: 100%;
    }
}

@media (max-width: 768px) {

    .cgpa-val,
    .status-val,
    .result-val,
    .score-val,
    .ave-val,
    .count-val,
    .perc-val {
        font-size: 2.5rem;
    }

    .glass-card {
        padding: 1.5rem !important;
    }

    .subject-row {
        flex-direction: column;
        align-items: stretch !important;
        gap: 0.8rem !important;
        padding-bottom: 1.5rem;
        border-bottom: 1px dashed var(--border-color);
    }

    .subject-row input {
        width: 100% !important;
    }

    .action-wrap, .action-row {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        grid-template-columns: 1fr !important;
    }

    .cgpa-banner, .status-banner, .result-banner, .score-banner, .stat-banner {
        padding: 1.5rem !important;
    }

    .cgpa-val, .status-val, .result-val, .score-val, .ave-val, .count-val, .perc-val {
        font-size: 2.5rem !important;
        word-break: break-all;
    }

    .btn, .btn-action {
        width: 100% !important;
        flex: none !important;
    }
}

@media (max-width: 480px) {
    .cgpa-banner, .status-banner, .result-banner, .score-banner, .stat-banner {
        padding: 1.25rem !important;
    }

    .cgpa-val, .status-val, .result-val, .score-val, .ave-val, .count-val, .perc-val {
        font-size: 2rem !important;
    }
}

/* Result Banners & Value Displays */
.cgpa-banner,
.status-banner,
.result-banner,
.score-banner,
.stat-banner {
    background: linear-gradient(135deg, var(--primary-color) 0%, #a855f7 100%);
    padding: 2.5rem;
    border-radius: 20px;
    text-align: center;
    color: white;
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
    overflow: hidden;
    position: relative;
    margin-bottom: 1.5rem;
}

.cgpa-val,
.status-val,
.result-val,
.score-val,
.ave-val,
.count-val,
.perc-val {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1;
    margin: 10px 0;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.safe-label,
.save-label,
.status-tag {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* UI Components */
.matrix-table,
.calendar-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: 0.9rem;
}

.matrix-table th,
.matrix-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.matrix-table th {
    color: var(--text-muted);
    font-weight: 600;
}

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

.chart-box,
.element-chart {
    background: var(--surface-color);
    padding: 1.5rem;
    border-radius: 18px;
    border: 1px solid var(--border-color);
    min-height: 250px;
    margin-top: 1rem;
}

.action-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Category-Specific Components */
.loshu-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 2rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 20px;
}

.grid-cell {
    aspect-ratio: 1;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: var(--transition);
}

.grid-cell.active {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.1);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
}

.cell-num {
    font-size: 2.2rem;
    font-weight: 800;
}

.cell-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.heart-container {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 2rem auto;
}

.heart-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 15px rgba(244, 63, 94, 0.4));
}

.heart-path {
    fill: none;
    stroke: var(--border-color);
}

.heart-fill {
    fill: #f43f5e;
    transform-origin: center;
    transition: transform 1s ease-out;
}

.heart-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5rem;
    font-weight: 800;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.pulse {
    animation: heartPulse 1s infinite alternate;
}

@keyframes heartPulse {
    from {
        transform: scale(1);
    }

    to {
        transform: scale(1.05);
    }
}


/* FLAMES Specifically */
.flames-strip {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0;
}

.flames-letter {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 800;
    transition: var(--transition);
}

.flames-letter.active {
    background: #f43f5e;
    color: white;
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(244, 63, 94, 0.4);
}

.flames-letter.eliminated {
    opacity: 0.3;
    text-decoration: line-through;
    transform: scale(0.9);
}

.flames-banner {
    background: linear-gradient(135deg, #f43f5e 0%, #ec4899 100%);
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
    color: white;
    margin-bottom: 2rem;
}

.flames-val {
    font-size: 2.2rem;
    font-weight: 800;
}

.meaning-box {
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 20px;
}

/* Helper Classes */
.remove-btn {
    background: rgba(244, 63, 94, 0.1);
    color: #f43f5e;
    border: 1px solid rgba(244, 63, 94, 0.2);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.remove-btn:hover {
    background: #f43f5e;
    color: white;
}

/* ==========================================================================
   DTDC Courier Calculator Styles
   ========================================================================== */

.tab-nav {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 0.6rem 1.2rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 100px;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.tab-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

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

.input-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.volumetric-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.volumetric-grid small {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
    font-weight: 500;
}

.rate-val {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1;
    margin: 10px 0;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.info-label {
    color: var(--text-muted);
}

.info-val {
    font-weight: 700;
    color: var(--text-color);
}

/* Fix: constrain Chart.js canvases inside .chart-box */
.chart-box {
    position: relative;
    height: 250px;
}

@media (max-width: 600px) {
    .volumetric-grid {
        grid-template-columns: 1fr;
    }

    .tab-nav {
        gap: 0.4rem;
    }

    .tab-btn {
        font-size: 0.78rem;
        padding: 0.5rem 0.9rem;
    }
}

/* ==========================================================================
   International GPA Converter Styles
   ========================================================================== */

.country-selector {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.country-btn {
    padding: 0.7rem 1.4rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.country-btn:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

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

.gpa-banner {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    padding: 2.5rem;
    border-radius: 20px;
    text-align: center;
    color: white;
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.3);
    margin-bottom: 1.5rem;
}

.gpa-amt {
    font-size: 4rem;
    font-weight: 800;
    line-height: 1;
    margin: 10px 0;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.mapping-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: 0.9rem;
}

.mapping-table th,
.mapping-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.mapping-table th {
    color: var(--text-muted);
    font-weight: 600;
}

.chart-panel {
    position: relative;
    height: 250px;
    margin-top: 2rem;
}

@media (max-width: 600px) {
    .country-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    .gpa-amt {
        font-size: 3rem;
    }
}

/* ==========================================================================
   Body Fat Calculator Styles
   ========================================================================== */

.gender-select {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.gender-btn {
    flex: 1;
    padding: 1.2rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.gender-btn:hover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
}

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

.status-banner {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    padding: 2.5rem;
    border-radius: 20px;
    text-align: center;
    color: white;
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
    margin-bottom: 1.5rem;
}

.status-val {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1;
    margin: 10px 0;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.female-only {
    display: none;
}

@media (max-width: 600px) {
    .gender-btn {
        padding: 0.8rem;
        font-size: 0.9rem;
    }

    .status-val {
        font-size: 2.8rem;
    }
}

/* ==========================================================================
   Article & Guide Styles
   ========================================================================== */

.article-container {
    max-width: 850px;
    margin: 0 auto;
    padding: 0 1.5rem;
    line-height: 1.8;
}

.article-container h1 {
    font-size: 2.8rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(to right, var(--text-color), var(--text-muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tool-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1.5rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 16px;
    backdrop-filter: blur(4px);
    padding: 0;
}

.tool-icon svg {
    width: 36px;
    height: 36px;
    stroke-width: 2.5;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tool-card:hover .tool-icon svg {
    transform: scale(1.15) rotate(5deg);
}

.header-icon-svg {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.header-icon-svg svg {
    width: 22px;
    height: 22px;
    stroke-width: 2.8;
}

.article-container h2 {
    font-size: 1.8rem;
    margin: 3rem 0 1.2rem;
    color: var(--primary-color);
}

.article-container p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    color: var(--text-muted);
}

.interactive-box {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 2.5rem;
    margin: 3rem 0;
    backdrop-filter: var(--glass-blur);
    box-shadow: var(--shadow);
}

.interactive-box h3 {
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

/* ==========================================================================
   Citizen Calculator Styles
   ========================================================================== */

.citizen-calc {
    background: #2d2d2d;
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    border: 8px solid #3d3d3d;
}

[data-theme="light"] .citizen-calc {
    background: #e5e7eb;
    border-color: #d1d5db;
    box-shadow: var(--shadow);
}

.digital-screen {
    background: #9cad9c;
    border: 4px inset #7c8d7c;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    text-align: right;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.2);
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.history-line {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: rgba(0, 0, 0, 0.5);
    margin-bottom: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.current-line {
    font-family: 'Courier New', monospace;
    font-size: 3rem;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: 2px;
}

.calc-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.8rem;
}

.calc-btn {
    padding: 1.2rem;
    font-size: 1.5rem;
    font-weight: 700;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

[data-theme="light"] .calc-btn {
    background: white;
    color: #1a1a1a;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.calc-btn:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.1);
}

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

.calc-btn.special {
    background: #f59e0b;
    color: white;
}

.calc-btn.clear {
    background: #ef4444;
    color: white;
}

@media (max-width: 600px) {
    .current-line {
        font-size: 2.2rem;
    }

    .calc-btn {
        padding: 0.8rem;
        font-size: 1.2rem;
    }
}

/* ==========================================================================
   Action Button Icon Styling
   ========================================================================== */
.btn-action {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
}

.btn-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.btn-action:hover .btn-icon {
    transform: scale(1.1);
}
/* Cookie Consent Banner */
#cookie-consent-banner {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    right: 2rem;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 1.5rem;
    z-index: 9999;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    max-width: 1200px;
    margin: 0 auto;
    animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.cookie-content {
    display: flex;
    align-items: center;
    gap: 2rem;
    width: 100%;
}

.cookie-content p {
    color: white;
    font-size: 0.95rem;
    margin: 0;
    flex: 1;
}

.cookie-actions {
    display: flex;
    gap: 1rem;
}

.btn-cookie {
    padding: 0.8rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-size: 0.9rem;
}

.btn-cookie.primary {
    background: #6366f1;
    color: white;
}

.btn-cookie.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.btn-cookie:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
    #cookie-consent-banner {
        bottom: 1rem;
        left: 1rem;
        right: 1rem;
        padding: 1.2rem;
    }

    .cookie-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .cookie-actions {
        width: 100%;
    }

    .btn-cookie {
        flex: 1;
    }
}

@keyframes slideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
