* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Dark theme colors (permanent) */
    --primary-color: #a8c7fa;
    --primary-dark: #8ab4f8;
    --primary-light: #1a365d;
    --text-color: #e8eaed;
    --text-secondary: #c8ccd0;
    --text-tertiary: #bdc1c6;
    --background-primary: #0f1419;
    --background-secondary: #1a1f2e;
    --background-tertiary: #2d3748;
    --background-color: #1a1f2e;
    --background-light: #1a1f2e;
    --border-color: #3c4043;
    --border-light: #5f6368;
    --shadow-light: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
    --shadow-medium: 0 4px 6px rgba(0,0,0,0.2), 0 2px 4px rgba(0,0,0,0.1);
    --shadow-heavy: 0 10px 15px rgba(0,0,0,0.3), 0 4px 6px rgba(0,0,0,0.2);
    
    /* Status colors (dark theme) */
    --success-color: #81c995;
    --success-bg: #1e3a2e;
    --warning-color: #fdd663;
    --warning-bg: #3d2f00;
    --error-color: #f28b82;
    --error-bg: #3c1917;
    --info-color: #8ab4f8;
    --info-bg: #1a365d;
    
    /* Interactive states (dark theme) */
    --hover-bg: rgba(138, 180, 248, 0.1);
    --active-bg: rgba(138, 180, 248, 0.15);
    --focus-ring: 0 0 0 3px rgba(138, 180, 248, 0.3);
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* Announcement Bar Styles */
.announcement-bar {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    color: white;
    text-align: center;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 500;
    position: relative;
    overflow: hidden;
    z-index: 1000;
}

.announcement-bar::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    animation: shimmer 3s infinite;
    pointer-events: none;
}

.announcement-bar a {
    color: white;
    text-decoration: underline;
    font-weight: 600;
}

.announcement-bar a:hover {
    color: #fff;
    text-decoration: none;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

@media (max-width: 768px) {
    .announcement-bar {
        font-size: 12px;
        padding: 6px 15px;
    }
}


/* Global theme transitions */
* {
    transition: background-color var(--transition-normal), 
                color var(--transition-normal), 
                border-color var(--transition-normal),
                box-shadow var(--transition-normal);
}

/* Dark theme styling (permanent) */
body {
    background-color: var(--background-primary);
    color: var(--text-color);
}

.top-nav {
    background-color: var(--background-secondary);
    border-bottom: 1px solid var(--border-color);
}

.top-nav a {
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.top-nav a:hover,
.top-nav a.active {
    background-color: var(--hover-bg);
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.calculator,
.content,
.example,
.form-container,
.contact-method,
.faq-item,
.key-takeaways,
.content-section,
.kid-friendly-box,
.resource-box,
.quick-examples .example {
    background-color: var(--background-secondary);
    box-shadow: var(--shadow-medium);
    border: 1px solid var(--border-color);
}

/* Quick Example Styling */
.quick-example {
    background: var(--background-secondary);
    padding: 20px;
    margin: 20px 0;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.quick-example h3 {
    margin-top: 0;
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.quick-example-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 10px;
    align-items: center;
    margin: 15px 0;
    font-size: 16px;
    color: var(--text-color);
}

.quick-example-result {
    color: var(--primary-color);
    font-weight: bold;
}

.quick-example-footer {
    margin-bottom: 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.input-field input,
.form-group input,
.form-group select,
.form-group textarea {
    background-color: var(--background-tertiary);
    border-color: var(--border-color);
    color: var(--text-color);
    transition: all var(--transition-fast);
}

.input-field input:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    box-shadow: var(--focus-ring);
    background-color: var(--background-secondary);
}

.code-box,
.example-box,
.formula-box,
.concept-box,
.steps-box {
    background-color: var(--background-secondary);
    border-left-color: var(--primary-color);
    border: 1px solid var(--border-color);
}

pre,
code {
    background-color: var(--background-tertiary);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.breadcrumbs {
    background-color: var(--background-secondary);
    border-color: var(--border-color);
}

.dropdown-content {
    background-color: var(--background-secondary);
    border: 1px solid var(--border-color);
}

.rules-table th {
    background-color: var(--primary-color);
    color: var(--background-primary);
}

.rules-table tr:nth-child(even) {
    background-color: var(--background-tertiary);
}

.rules-table td {
    border-color: var(--border-color);
    color: var(--text-color);
}

.rules-table tr:hover {
    background-color: var(--hover-bg);
}




body {
    font-family: 'Google Sans', Arial, sans-serif;
    background-color: var(--background-primary);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* Navigation Styles */
.top-nav {
    background-color: var(--background-primary);
    box-shadow: var(--shadow-light);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    border-bottom: 1px solid var(--border-light);
    transition: all var(--transition-normal);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 0.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Semantic: Language switcher styling keeps the runtime translator aligned with the nav without inline CSS. */
.language-switcher {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 1rem;
}

.language-switcher__label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.language-switcher select {
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--background-color);
    color: var(--text-color);
    font-family: 'Google Sans', sans-serif;
    cursor: pointer;
}

.language-switcher select:hover {
    border-color: var(--primary-color);
}

.language-switcher select {
    background-color: var(--background-secondary);
    color: var(--text-color);
    border-color: var(--border-color);
}

.top-nav ul {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
    justify-content: center;
    flex-wrap: wrap;
}

.top-nav li {
    margin: 0;
    padding: 0;
    text-align: center;
    position: relative;
}

.top-nav a {
    display: block;
    padding: 1rem 1rem;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all var(--transition-fast);
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}

/* Dropdown styles */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown > a {
    cursor: pointer;
}

.dropdown > a:after {
    content: '▼';
    font-size: 0.7em;
    margin-left: 5px;
    display: inline-block;
    vertical-align: middle;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--background-secondary);
    min-width: 200px;
    box-shadow: var(--shadow-medium);
    z-index: 1000;
    border-radius: 4px;
    border: 1px solid var(--border-light);
    padding: 0.5rem 0;
}

.dropdown-content a {
    padding: 0.75rem 1rem;
    display: block;
    text-align: left;
    white-space: normal;
    color: var(--text-color);
    font-weight: 500;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.top-nav a:hover, .top-nav a.active {
    color: var(--primary-color);
    background-color: var(--hover-bg);
    border-bottom-color: var(--primary-color);
    font-weight: 600;
}

/* Dark theme support for dropdown */
.dropdown-content {
    background-color: var(--background-secondary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-heavy);
}

.dropdown-content a {
    color: var(--text-color);
    transition: all var(--transition-fast);
}

.dropdown-content a:hover {
    background-color: var(--hover-bg);
    color: var(--primary-color);
}

/* Mobile dropdown adjustments */
@media (max-width: 768px) {
    .dropdown-content {
        position: static;
        display: none;
        width: 100%;
        box-shadow: none;
        background-color: var(--background-color);
    }

    .dropdown.active .dropdown-content {
        display: block;
    }

    .dropdown > a:after {
        float: right;
        margin-top: 5px;
    }

    /* Semantic: Stack the language switcher on mobile so it does not cramp the burger menu. */
    .language-switcher {
        width: 100%;
        margin: 1rem 0 0;
        justify-content: flex-start;
    }

    .language-switcher select {
        width: 100%;
    }
}

/* External link icon in navigation */
.top-nav a .fa-external-link-alt {
    font-size: 0.75em;
    margin-left: 3px;
    opacity: 0.7;
}

.top-nav a:hover .fa-external-link-alt {
    opacity: 1;
}

/* Dark theme support for external link */
.top-nav a .fa-external-link-alt {
    color: var(--text-color);
}

/* Container and Layout */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    flex: 1;
    width: 100%;
}

/* Header Styles */
header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 0 1rem;
}

h1 {
    font-size: clamp(2rem, 5vw, 2.5rem);
    font-weight: 500;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.subtitle {
    color: var(--text-secondary);
    font-size: clamp(1rem, 3vw, 1.1rem);
}

/* Calculator and Content Styles */
.calculator, .content {
    padding: clamp(1rem, 4vw, 2rem);
    border-radius: 8px;
    margin-bottom: 2rem;
    transition: all var(--transition-normal);
}

.input-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.input-field {
    flex: 1;
    min-width: 0;
}

.input-field input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    background-color: var(--background-primary);
    color: var(--text-color);
    transition: all var(--transition-fast);
    outline: none;
}

.input-field input:focus {
    border-color: var(--primary-color);
    box-shadow: var(--focus-ring);
    background-color: var(--background-secondary);
}

.input-field label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 1.05rem;
    font-weight: 500;
}

/* Special styling for value labels (a, b, c) */
.input-field:not(.result) label {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
}

/* Dark theme support for value labels */
.input-field:not(.result) label {
    color: var(--text-color);
}

.equals {
    color: #5f6368;
    padding: 0 1rem;
    font-size: 0.9rem;
}

.separator {
    display: flex;
    align-items: center;
    margin: 2rem 0;
}

.line {
    flex: 1;
    height: 1px;
    background-color: #dadce0;
}

.text {
    padding: 0 1rem;
    color: #5f6368;
    font-size: 0.9rem;
}

.input-field.result {
    position: relative;
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.input-field.result input {
    font-weight: 500;
    font-size: 1.1em;
    color: #1a73e8;
    background-color: transparent;
    border: 2px solid #1a73e8;
    border-radius: 6px;
    padding: 12px;
    transition: all 0.3s ease;
}

.input-field.result label {
    color: #1a73e8;
    font-weight: 500;
}

/* Dark theme support for result field */
.input-field.result {
    background: linear-gradient(135deg, var(--background-secondary) 0%, var(--background-tertiary) 100%);
    border: 1px solid var(--primary-color);
    box-shadow: var(--shadow-light);
}

.input-field.result input {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background-color: transparent;
    font-weight: 600;
}

.input-field.result label {
    color: var(--primary-color);
    font-weight: 600;
}

/* Code and Example Boxes */
.code-box, .example-box, .formula-box {
    background-color: var(--background-secondary);
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
    border-left: 4px solid var(--primary-color);
    border: 1px solid var(--border-light);
    overflow-x: auto;
    box-shadow: var(--shadow-light);
    transition: all var(--transition-normal);
}

pre, code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Tables */
.excel-table {
    width: 100%;
    overflow-x: auto;
    margin: 1rem 0;
    border-collapse: collapse;
}

.excel-table th, .excel-table td {
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    text-align: center;
    min-width: 80px;
}

/* Professional Button Styles */
.calculate-btn {
    display: block;
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-normal);
    font-family: inherit;
    margin-top: 2rem;
    box-shadow: var(--shadow-medium);
    position: relative;
    overflow: hidden;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.calculate-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left var(--transition-slow);
}

.calculate-btn:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-heavy);
}

.calculate-btn:hover::before {
    left: 100%;
}

.calculate-btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-medium);
}

.calculate-btn:focus {
    outline: none;
    box-shadow: var(--focus-ring), var(--shadow-medium);
}

/* Updated Footer Styles */
footer {
    text-align: center;
    margin-top: auto;
    padding: 1rem 0.5rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.footer-links {
    padding: 0.2rem 0;
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    flex-wrap: wrap;
    font-size: 0.85rem;
}

.footer-links a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
    padding: 0.2rem;
}

.footer-links a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.footer-copyright {
    padding: 0.2rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer-languages {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    flex-wrap: wrap;
    padding: 0.2rem 0;
}

.footer-lang-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--text-color);
    text-decoration: none;
    padding: 0.2rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.footer-lang-link:hover {
    background-color: var(--background-color);
    transform: translateY(-1px);
}

.footer-lang-link .flag-icon {
    width: 20px;
    height: 15px;
    display: inline-block;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* Flag icons using SVG data URLs */
.footer-lang-link[data-lang="en"] .flag-icon {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 30"><clipPath id="a"><path d="M0 0v30h60V0z"/></clipPath><clipPath id="b"><path d="M30 15h30v15zv15H0zH0V0zV0h30z"/></clipPath><g clip-path="url(%23a)"><path d="M0 0v30h60V0z" fill="%23012169"/><path d="M0 0l60 30m0-30L0 30" stroke="%23fff" stroke-width="6"/><path d="M0 0l60 30m0-30L0 30" clip-path="url(%23b)" stroke="%23C8102E" stroke-width="4"/><path d="M30 0v30M0 15h60" stroke="%23fff" stroke-width="10"/><path d="M30 0v30M0 15h60" stroke="%23C8102E" stroke-width="6"/></g></svg>');
}

.footer-lang-link[data-lang="es"] .flag-icon {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 40"><path d="M0 0h60v40H0z" fill="%23c60b1e"/><path d="M0 10h60v20H0z" fill="%23ffc400"/></svg>');
}

.footer-lang-link[data-lang="de"] .flag-icon {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 40"><path d="M0 0h60v40H0z" fill="%23000"/><path d="M0 13.333h60v13.333H0z" fill="%23ff0000"/><path d="M0 26.667h60V40H0z" fill="%23ffcc00"/></svg>');
}

.footer-lang-link[data-lang="fr"] .flag-icon {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 40"><path d="M0 0h20v40H0z" fill="%23002395"/><path d="M20 0h20v40H20z" fill="%23fff"/><path d="M40 0h20v40H40z" fill="%23ed2939"/></svg>');
}

.footer-lang-link[data-lang="it"] .flag-icon {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 40"><path d="M0 0h20v40H0z" fill="%23009246"/><path d="M20 0h20v40H20z" fill="%23fff"/><path d="M40 0h20v40H40z" fill="%23ce2b37"/></svg>');
}

/* Portuguese flag icon for footer language list */
.footer-lang-link[data-lang="pt"] .flag-icon {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 40"><path d="M0 0h24v40H0z" fill="%2300652d"/><path d="M24 0h36v40H24z" fill="%23ff0000"/></svg>');
}

/* Hindi (India) flag icon for footer language list */
.footer-lang-link[data-lang="hi"] .flag-icon {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 40"><path d="M0 0h60v13.333H0z" fill="%23ff9933"/><path d="M0 13.333h60v13.333H0z" fill="%23fff"/><path d="M0 26.667h60V40H0z" fill="%23008000"/><circle cx="30" cy="20" r="4" fill="%23000080"/></svg>');
}

/* Chinese (China) flag icon for footer language list */
.footer-lang-link[data-lang="zh"] .flag-icon {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 40"><path d="M0 0h60v40H0z" fill="%23de2910"/><g fill="%23ffde00"><path d="M12 6l2 6-2 6 6-2 6 2-2-6 2-6-6 2z"/><path d="M48 8l1 3-1 3 3-1 3 1-1-3 1-3-3 1z"/><path d="M50 16l1 2-1 2 2-1 2 1-1-2 1-2-2 1z"/><path d="M46 20l1 2-1 2 2-1 2 1-1-2 1-2-2 1z"/><path d="M52 24l1 2-1 2 2-1 2 1-1-2 1-2-2 1z"/><path d="M48 28l1 2-1 2 2-1 2 1-1-2 1-2-2 1z"/><path d="M44 32l1 2-1 2 2-1 2 1-1-2 1-2-2 1z"/><path d="M50 36l1 2-1 2 2-1 2 1-1-2 1-2-2 1z"/></g></svg>');
}

/* Japanese flag icon for footer language list */
.footer-lang-link[data-lang="ja"] .flag-icon {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 40"><path d="M0 0h60v40H0z" fill="%23fff"/><circle cx="30" cy="20" r="9" fill="%23bc002d"/></svg>');
}

/* Portuguese Brazil flag icon for footer language list */
.footer-lang-link[data-lang="pt-BR"] .flag-icon {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 40"><path d="M0 0h60v40H0z" fill="%2300933e"/><path d="M0 0h60v40H0z" fill="%23ffdf00"/><circle cx="30" cy="20" r="8" fill="%23002776"/><path d="M30 12l2 6-2 6-2-6z" fill="%23ffdf00"/></svg>');
}

/* Dark theme support for footer */
.footer-links,
.footer-languages {
    border-color: var(--border-color);
}

.footer-lang-link {
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.footer-lang-link:hover {
    background-color: var(--hover-bg);
    color: var(--primary-color);
    transform: translateY(-1px);
}

.footer-copyright {
    color: var(--text-tertiary);
}

.footer-links a {
    color: var(--text-color);
    transition: all var(--transition-fast);
    font-weight: 500;
}

.footer-links a:hover {
    color: var(--primary-color);
    text-decoration: none;
}

/* Prominent Replit affiliate link styling */
.footer-copyright a[href*="replit.com"] {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    color: white !important;
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 700;
    display: inline-block;
    margin: 0 8px;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
    animation: pulse-glow 2s ease-in-out infinite alternate;
}

.footer-copyright a[href*="replit.com"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.6);
    background: linear-gradient(135deg, #f7931e 0%, #ff6b35 100%);
}

.footer-copyright a[href*="replit.com"]:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left var(--transition-slow);
}

.footer-copyright a[href*="replit.com"]:hover:before {
    left: 100%;
}

@keyframes pulse-glow {
    0% {
        box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
    }
    100% {
        box-shadow: 0 4px 12px rgba(255, 107, 53, 0.7), 0 0 20px rgba(255, 107, 53, 0.3);
    }
}

@media (max-width: 768px) {
    .footer-languages {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .footer-lang-link {
        min-width: 150px;
        justify-content: center;
    }
}

/* Quick Reference in Footer */
.quick-reference {
    margin-top: 2rem;
}

.quick-reference > h3 {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
    text-align: center;
}

.quick-reference .examples {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.quick-reference .example {
    background-color: var(--background-color);
    padding: 1.2rem;
    border-radius: 8px;
    box-shadow: var(--shadow-medium);
    flex: 1;
    min-width: 250px;
    max-width: 350px;
}

.quick-reference .example h3 {
    color: var(--primary-color);
    font-size: 1rem;
    margin-bottom: 0.8rem;
    font-weight: 500;
}

.quick-reference .example p {
    color: var(--text-color);
    font-size: 0.9rem;
    line-height: 1.5;
}

@media (max-width: 768px) {
    .quick-reference .example {
        min-width: 100%;
        padding: 1rem;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .input-group {
        flex-direction: column;
    }

    .equals {
        padding: 0.5rem 0;
        text-align: center;
    }

    .nav-container {
        padding: 0;
        position: relative;
        justify-content: space-between;
    }

    .top-nav ul {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: white;
        box-shadow: var(--shadow-medium);
    }

    .top-nav ul.show {
        display: flex;
    }

    .top-nav li {
        width: 100%;
    }

    .top-nav a {
        padding: 0.8rem 1rem;
        font-size: 1rem;
    }

    .code-box, .example-box, .formula-box {
        padding: 1rem;
        margin: 1rem 0;
    }

    pre, code {
        font-size: 0.85rem;
    }
}

/* Tablet Specific */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        padding: 1.5rem;
    }

    .nav-container {
        padding: 0 1rem;
    }

    .top-nav a {
        padding: 1rem;
    }
}

/* Print Styles */
@media print {
    .top-nav {
        display: none;
    }

    .container {
        padding: 0;
        max-width: 100%;
    }

    .calculator, .content {
        box-shadow: none;
        border: 1px solid var(--border-color);
    }
}

/* Content Styles */
.formula {
    font-size: 1.2rem;
    color: #1a73e8;
    margin: 0.5rem 0;
    font-weight: 500;
}

.example {
    color: #5f6368;
    font-family: monospace;
    margin-top: 0.5rem;
}

/* Lists and Text */
h2 {
    color: var(--text-color);
    margin: 2rem 0 1rem;
    font-size: 1.5rem;
    font-weight: 600;
    transition: color var(--transition-normal);
}

h3 {
    color: var(--text-secondary);
    margin: 1rem 0;
    font-size: 1.2rem;
    font-weight: 500;
    transition: color var(--transition-normal);
}

ol, ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.tips {
    background-color: var(--background-secondary);
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 2rem;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-light);
    transition: all var(--transition-normal);
}

.solution {
    color: var(--primary-color);
    font-weight: 500;
    margin-top: 1rem;
    transition: color var(--transition-normal);
}

/* Formula Page Specific Styles */
.introduction {
    font-size: 1.1rem;
    color: var(--text-color);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.concept-box {
    background-color: var(--background-color);
    padding: 1.5rem;
    border-radius: 4px;
    margin: 1.5rem 0;
    border-left: 4px solid var(--primary-color);
}

.formula-explanation {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.steps-box {
    background-color: var(--background-color);
    padding: 1.5rem;
    border-radius: 4px;
    margin: 1.5rem 0;
    border-left: 4px solid #34a853; /* Google Green */
}

.table-container {
    overflow-x: auto;
    margin: 1rem 0;
}

.rules-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    min-width: 300px;
}

.rules-table th,
.rules-table td {
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    text-align: left;
}

.rules-table th {
    background-color: var(--primary-color);
    color: white;
    font-weight: 500;
}

.rules-table tr:nth-child(even) {
    background-color: var(--background-color);
}

.brain-section {
    background-color: #fce8e6; /* Light red for brain section */
    padding: 1.5rem;
    border-radius: 4px;
    margin: 1.5rem 0;
}

.brain-section h2 {
    color: #ea4335; /* Google Red */
}

.brain-section ul {
    list-style-type: none;
    padding-left: 0;
}

.brain-section li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.brain-section li:before {
    content: "•";
    color: #ea4335;
    font-weight: bold;
    position: absolute;
    left: 0;
}

.advanced-applications .concept-box {
    background-color: #e8f0fe; /* Light blue for advanced section */
    border-left-color: #4285f4; /* Google Blue */
}

.advanced-applications h2 {
    color: #4285f4;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .concept-box, .steps-box, .brain-section {
        padding: 1rem;
        margin: 1rem 0;
    }

    .rules-table th,
    .rules-table td {
        padding: 0.6rem;
        font-size: 0.9rem;
    }

    .formula {
        font-size: 1rem;
    }
}

/* Print styles for formula page */
@media print {
    .concept-box, .steps-box, .brain-section {
        break-inside: avoid;
        border: 1px solid var(--border-color);
        margin: 1rem 0;
    }

    .rules-table {
        break-inside: avoid;
    }
}

/* Kids Section Styles */
.kids-section {
    background-color: #fff8e1; /* Light yellow background */
    padding: 2rem;
    border-radius: 8px;
    margin: 2rem 0;
    border: 2px solid #fbbc04; /* Google Yellow */
}

.kids-section h2 {
    color: #fbbc04; /* Google Yellow */
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
}

.kid-friendly-box {
    background-color: var(--background-secondary);
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
    border: 1px solid var(--border-light);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-left: 4px solid #fbbc04;
}

.kid-friendly-box h3 {
    color: #ea4335; /* Google Red */
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.story {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #4285f4; /* Google Blue */
    font-style: italic;
}

.kids-table {
    width: 100%;
    max-width: 300px;
    margin: 1rem auto;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #34a853; /* Google Green */
}

.kids-table th {
    background-color: #34a853;
    color: white;
    padding: 0.8rem;
    text-align: center;
    font-weight: 500;
}

.kids-table td {
    padding: 0.8rem;
    text-align: center;
    border: 1px solid #34a853;
    font-size: 1.1rem;
}

.fun-math {
    color: #4285f4;
    font-weight: 500;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.tada {
    color: #ea4335;
    font-size: 1.2rem;
    font-weight: 500;
    text-align: center;
    margin: 1rem 0;
}

.fun-list {
    list-style-type: none;
    padding-left: 0;
}

.fun-list li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.fun-list li:before {
    content: "★";
    color: #fbbc04;
    position: absolute;
    left: 0;
}

.kid-friendly-note {
    background-color: #e8f0fe;
    padding: 1rem;
    border-radius: 8px;
    margin-top: 2rem;
    text-align: center;
    color: #4285f4;
    font-style: italic;
}

/* Responsive adjustments for kids section */
@media (max-width: 768px) {
    .kids-section {
        padding: 1rem;
    }

    .kid-friendly-box {
        padding: 1rem;
        margin: 1rem 0;
    }

    .kids-table td,
    .kids-table th {
        padding: 0.6rem;
        font-size: 1rem;
    }

    .story,
    .fun-math,
    .tada {
        font-size: 1rem;
    }
}

/* Print styles for kids section */
@media print {
    .kids-section {
        background-color: white;
        border: 2px solid #dadce0;
    }

    .kid-friendly-box {
        box-shadow: none;
        border: 1px solid #dadce0;
    }
}

/* Calculator Tabs */
.calculator-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.tab-btn {
    padding: 0.8rem 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--background-secondary);
    color: var(--text-color);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    box-shadow: var(--shadow-medium);
}

.tab-btn.active {
    background-color: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    font-weight: 700;
}

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

/* Calculator Sections */
.calculator-section {
    display: none;
}

.calculator-section.active {
    display: block;
}

.calculator-header {
    text-align: center;
    margin-bottom: 2rem;
}

.calculator-header h2 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.calculator-description {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.formula-hint {
    color: var(--primary-color);
    font-family: 'Courier New', Courier, monospace;
    font-weight: 500;
    background-color: var(--background-color);
    padding: 0.5rem;
    border-radius: 4px;
    display: inline-block;
}

/* Examples Section */
.examples {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.example {
    background-color: var(--background-secondary);
    padding: 1rem;
    border-radius: 4px;
    box-shadow: var(--shadow-medium);
    flex: 1;
    min-width: 250px;
    max-width: 350px;
    border: 1px solid var(--border-light);
}

.example h3 {
    color: var(--primary-color);
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

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

/* Responsive Adjustments */
@media (max-width: 768px) {
    .calculator-tabs {
        flex-direction: column;
        gap: 0.5rem;
    }

    .tab-btn {
        width: 100%;
    }

    .example {
        min-width: 100%;
    }
}

/* Key Takeaways Section */
.key-takeaways {
    background-color: var(--background-secondary);
    padding: clamp(1rem, 4vw, 2rem);
    border-radius: 8px;
    box-shadow: var(--shadow-medium);
    margin: 2rem 0;
    border: 1px solid var(--border-light);
}

.key-takeaways h2 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

.key-takeaways ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.key-takeaways li {
    padding: 0.8rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: var(--text-color);
    line-height: 1.6;
}

.key-takeaways li:before {
    content: "•";
    color: var(--primary-color);
    font-weight: bold;
    position: absolute;
    left: 0;
}

@media (max-width: 768px) {
    .key-takeaways {
        padding: 1rem;
        margin: 1rem 0;
    }
    
    .key-takeaways li {
        padding: 0.6rem 0;
        padding-left: 1.2rem;
    }
}

/* Content Section Styles */
.content-section {
    background-color: var(--background-secondary);
    padding: clamp(1.5rem, 4vw, 2.5rem);
    border-radius: 8px;
    box-shadow: var(--shadow-medium);
    margin: 2rem 0;
    border: 1px solid var(--border-light);
}

.content-section h2 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin: 2rem 0 1rem;
    font-weight: 500;
}

.content-section h2:first-child {
    margin-top: 0;
}

.content-section p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.benefits-list, .steps-list {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}

.benefits-list li, .steps-list li {
    padding: 0.8rem 0;
    padding-left: 1.8rem;
    position: relative;
    line-height: 1.6;
}

.benefits-list li:before {
    content: "✓";
    color: #34a853; /* Google Green */
    position: absolute;
    left: 0;
    font-weight: bold;
}

.steps-list li:before {
    content: "→";
    color: var(--primary-color);
    position: absolute;
    left: 0;
    font-weight: bold;
}

.faq-section {
    margin-top: 1.5rem;
}

.faq-section h3 {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin: 1.5rem 0 0.8rem;
    font-weight: 500;
}

.faq-section p {
    color: var(--text-color);
    margin-bottom: 1.5rem;
}

/* Responsive adjustments for content section */
@media (max-width: 768px) {
    .content-section {
        padding: 1rem;
    }

    .benefits-list li, .steps-list li {
        padding: 0.6rem 0;
        padding-left: 1.5rem;
    }

    .faq-section h3 {
        font-size: 1.1rem;
    }
}

/* Quick Examples Section */
.quick-examples {
    text-align: center;
    margin: 2rem 0;
}

.quick-examples > p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.quick-examples .examples {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.quick-examples .example {
    background-color: var(--background-secondary);
    padding: 1.2rem;
    border-radius: 8px;
    box-shadow: var(--shadow-medium);
    border: 1px solid var(--border-light);
    flex: 1;
    min-width: 250px;
    max-width: 350px;
}

.quick-examples .example h3 {
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
    font-weight: 500;
}

.quick-examples .example p {
    color: var(--text-color);
    font-size: 1rem;
    line-height: 1.5;
}

@media (max-width: 768px) {
    .quick-examples {
        margin: 1.5rem 0;
    }
    
    .quick-examples .example {
        min-width: 100%;
        padding: 1rem;
    }
}

/* Mobile Navigation */
.burger-menu {
    display: none;
    font-size: 24px;
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    padding: 10px;
}

.burger-menu:hover {
    color: var(--primary-color);
}

/* Hide mobile elements by default */
.mobile-title,
.burger-menu {
    display: none !important;
    position: absolute;
}

.mobile-title {
    left: 1rem;
}

.burger-menu {
    right: 1rem;
}

@media (max-width: 768px) {
    .nav-container {
        justify-content: space-between;
    }

    .mobile-title,
    .burger-menu {
        display: block !important;
        position: relative;
    }

    .mobile-title {
        left: 0;
    }

    .burger-menu {
        right: 0;
    }

    .top-nav ul {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: white;
        box-shadow: var(--shadow-medium);
    }

    .top-nav ul.show {
        display: flex;
        flex-direction: column;
    }

    .top-nav li {
        width: 100%;
    }

    .top-nav a {
        padding: 0.8rem 1rem;
        font-size: 1rem;
    }
}

/* Educational Resources Section */
.educational-resources {
    margin: 2rem 0;
    padding: 2rem;
    background-color: var(--background-light);
    border-radius: 8px;
}

.resource-box {
    background: var(--background-secondary);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow-medium);
    border: 1px solid var(--border-light);
}

.resource-box h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.download-box {
    margin-top: 1.5rem;
    text-align: center;
    padding: 1rem;
    background-color: var(--background-light);
    border-radius: 8px;
}

.download-button {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.8rem 1.5rem;
    background-color: var(--primary-color);
    color: #ffffff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: background-color 0.3s ease;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.download-button:hover {
    background-color: var(--primary-dark);
}

/* Breadcrumbs */
.breadcrumbs {
    background-color: var(--background-secondary);
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.breadcrumbs .container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
    flex-direction: row;
    flex-wrap: nowrap;
}

.breadcrumbs a, .breadcrumbs span {
    display: inline-block;
    white-space: nowrap;
}

.breadcrumbs a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

.breadcrumbs .separator {
    margin: 0 0.5rem;
    color: var(--border-color);
}

.breadcrumbs .current {
    color: var(--text-color);
}

@media (max-width: 768px) {
    .breadcrumbs {
        padding: 0.4rem 0;
    }
    
    .breadcrumbs .container {
        padding: 0 0.8rem;
    }
}

/* Social Sharing Buttons */
.social-share {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0;
}

.share-button {
    display: inline-flex;
    align-items: center;
    padding: 0.8rem 1.2rem;
    border-radius: 4px;
    color: #ffffff;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: opacity 0.3s ease;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.share-button:hover {
    opacity: 0.9;
}

.share-button i {
    margin-right: 0.5rem;
}

.share-facebook {
    background-color: #1877f2;
}

.share-twitter {
    background-color: #1da1f2;
}

.share-linkedin {
    background-color: #0a66c2;
}

.share-whatsapp {
    background-color: #25d366;
}

@media (max-width: 768px) {
    .social-share {
        flex-wrap: wrap;
    }
    
    .share-button {
        min-width: 140px;
        justify-content: center;
    }
}

/* Excel Interactive Elements */
.excel-interactive {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 1.5rem;
    margin: 1rem 0;
}

.excel-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--border-color);
    border: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

.excel-cell {
    background: white;
    padding: 0.5rem;
    text-align: center;
}

.excel-cell.header {
    background: #f1f3f4;
    font-weight: 500;
}

.excel-cell input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 2px;
    text-align: center;
}

.excel-cell.result {
    background: #e8f0fe;
    font-family: 'Courier New', monospace;
    font-weight: 500;
}

.excel-cell.result.error {
    background: #fee;
    color: #c00;
}

.formula-display {
    margin-top: 1rem;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

.formula-display code {
    color: var(--primary-color);
}

/* Tips Box */
.tips-box {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 4px;
    margin: 1rem 0;
}

.tips-box h3 {
    color: var(--primary-color);
    margin-top: 1.5rem;
}

.tips-box h3:first-child {
    margin-top: 0;
}

.tips-box ul {
    list-style-type: none;
    padding-left: 0;
}

.tips-box li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.tips-box li:before {
    content: "→";
    color: var(--primary-color);
    position: absolute;
    left: 0;
}

/* Error Box */
.error-box {
    background: #fff8f8;
    padding: 1.5rem;
    border-radius: 4px;
    margin: 1rem 0;
    border-left: 4px solid #d32f2f;
}

.error-box h3 {
    color: #d32f2f;
    margin-top: 1.5rem;
}

.error-box h3:first-child {
    margin-top: 0;
}

.error-box .code-box {
    background: white;
    border-left-color: #d32f2f;
}

/* Contact Form Styles */
.form-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow-medium);
}

.form-group {
    margin-bottom: 1.5rem;
}

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    outline: none;
}

.submit-btn {
    display: block;
    width: 100%;
    padding: 1rem;
    background-color: var(--primary-color);
    color: #ffffff;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.submit-btn:hover {
    background-color: var(--primary-dark);
}

/* Contact Info Styles */
.contact-methods {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.contact-method {
    flex: 1;
    min-width: 250px;
    max-width: 300px;
    text-align: center;
    padding: 1.5rem;
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow-medium);
}

.contact-method i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.contact-method h3 {
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.contact-method p {
    color: var(--text-secondary);
}

/* FAQ Grid Styles */
.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.faq-item {
    background: var(--background-secondary);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow-medium);
    border: 1px solid var(--border-light);
}

.faq-item h3 {
    color: var(--primary-color);
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
}

.faq-item p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

@media (max-width: 768px) {
    .form-container {
        padding: 1.5rem;
    }

    .contact-method {
        min-width: 100%;
    }

    .faq-grid {
        grid-template-columns: 1fr;
    }
}

/* Cookie Consent Popup */
.cookie-consent {
    position: fixed;
    bottom: -100%;
    left: 0;
    right: 0;
    background: white;
    padding: 1rem;
    box-shadow: var(--shadow-medium);
    z-index: 1000;
    transition: bottom 0.3s ease-in-out;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.cookie-consent.show {
    bottom: 0;
}

.cookie-consent p {
    margin: 0;
    flex: 1;
}

.cookie-consent .buttons {
    display: flex;
    gap: 0.5rem;
}

.cookie-consent button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.cookie-consent .accept {
    background: var(--primary-color);
    color: white;
}

.cookie-consent .decline {
    background: var(--background-light);
    color: var(--text-color);
}

.cookie-consent {
    background: var(--background-color);
    border-top: 1px solid var(--border-color);
}

@media (max-width: 768px) {
    .cookie-consent {
        flex-direction: column;
        text-align: center;
    }
    
    .cookie-consent .buttons {
        width: 100%;
        justify-content: center;
    }
}

/* Semantic: Elevate the language dropdown to feel like a polished control */
.dropdown.language-dropdown {
    position: relative;
    margin: 0 0 0 0.75rem;
}

/* Semantic: Style the trigger as a pill-shaped button with iconography */
.dropdown.language-dropdown > a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.9rem 0.55rem 0.7rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: linear-gradient(135deg, #ffffff 0%, #f7f9fc 100%);
    color: var(--text-secondary);
    font-weight: 600;
    letter-spacing: 0.01em;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

/* Semantic: Provide immediate feedback when hovering or focusing the control */
.dropdown.language-dropdown > a:hover,
.dropdown.language-dropdown > a:focus {
    border-color: rgba(26, 115, 232, 0.6);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.18);
}

/* Semantic: Render the currently active language flag inline */
.dropdown.language-dropdown > a::before {
    content: '';
    width: 20px;
    height: 14px;
    border-radius: 2px;
    background-size: cover;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
}

/* Semantic: Reference Lucide's ChevronDown icon for the caret indicator */
.dropdown.language-dropdown > a::after {
    content: '';
    width: 1rem;
    height: 1rem;
    background-repeat: no-repeat;
    background-size: 100%;
    background-position: center;
    transition: transform 0.2s ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231A73E8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}

/* Semantic: Rotate caret when dropdown is active */
.dropdown.language-dropdown:hover > a::after,
.dropdown.language-dropdown.active > a::after {
    transform: rotate(180deg);
}

/* Semantic: Give the dropdown panel a layered, card-like finish */
.dropdown.language-dropdown .dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 220px;
    background: #ffffff;
    border-radius: 14px;
    padding: 0.35rem 0;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
    border: 1px solid rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(4px);
}

/* Semantic: Ensure dropdown remains usable on mobile via script-managed classes */
.dropdown.language-dropdown.active .dropdown-content,
.dropdown.language-dropdown:hover .dropdown-content {
    display: block;
}

/* Semantic: Compose each language option with flag and label */
.dropdown.language-dropdown .dropdown-content a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.1rem;
    color: var(--text-color);
    font-weight: 500;
    transition: background-color 0.2s ease, color 0.2s ease;
}

/* Semantic: Provide a subtle hover state for readability */
.dropdown.language-dropdown .dropdown-content a:hover {
    background-color: rgba(26, 115, 232, 0.08);
    color: var(--primary-color);
}

/* Semantic: Render flags for menu items */
.dropdown.language-dropdown .dropdown-content a::before {
    content: '';
    width: 24px;
    height: 16px;
    border-radius: 2px;
    background-size: cover;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
}

.dropdown.language-dropdown .dropdown-content a[data-lang="en"]::before {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 30"><clipPath id="a"><path d="M0 0v30h60V0z"/></clipPath><clipPath id="b"><path d="M30 15h30v15zv15H0zH0V0zV0h30z"/></clipPath><g clip-path="url(%23a)"><path d="M0 0v30h60V0z" fill="%23012169"/><path d="M0 0l60 30m0-30L0 30" stroke="%23fff" stroke-width="6"/><path d="M0 0l60 30m0-30L0 30" clip-path="url(%23b)" stroke="%23C8102E" stroke-width="4"/><path d="M30 0v30M0 15h60" stroke="%23fff" stroke-width="10"/><path d="M30 0v30M0 15h60" stroke="%23C8102E" stroke-width="6"/></g></svg>');
}

.dropdown.language-dropdown .dropdown-content a[data-lang="es"]::before {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 40"><path d="M0 0h60v40H0z" fill="%23c60b1e"/><path d="M0 10h60v20H0z" fill="%23ffc400"/></svg>');
}

.dropdown.language-dropdown .dropdown-content a[data-lang="de"]::before {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 40"><path d="M0 0h60v40H0z" fill="%23000"/><path d="M0 13.333h60v13.333H0z" fill="%23ff0000"/><path d="M0 26.667h60V40H0z" fill="%23ffcc00"/></svg>');
}

.dropdown.language-dropdown .dropdown-content a[data-lang="fr"]::before {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 40"><path d="M0 0h20v40H0z" fill="%23002395"/><path d="M20 0h20v40H20z" fill="%23fff"/><path d="M40 0h20v40H40z" fill="%23ed2939"/></svg>');
}

.dropdown.language-dropdown .dropdown-content a[data-lang="it"]::before {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 40"><path d="M0 0h20v40H0z" fill="%23009246"/><path d="M20 0h20v40H20z" fill="%23fff"/><path d="M40 0h20v40H40z" fill="%23ce2b37"/></svg>');
}

/* Semantic: Render Portuguese flag in dropdown list */
.dropdown.language-dropdown .dropdown-content a[data-lang="pt"]::before {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 40"><path d="M0 0h24v40H0z" fill="%2300652d"/><path d="M24 0h36v40H24z" fill="%23ff0000"/></svg>');
}

/* Semantic: Render Hindi (India) flag in dropdown list */
.dropdown.language-dropdown .dropdown-content a[data-lang="hi"]::before {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 40"><path d="M0 0h60v13.333H0z" fill="%23ff9933"/><path d="M0 13.333h60v13.333H0z" fill="%23fff"/><path d="M0 26.667h60V40H0z" fill="%23008000"/><circle cx="30" cy="20" r="4" fill="%23000080"/></svg>');
}

/* Semantic: Render Chinese (China) flag in dropdown list */
.dropdown.language-dropdown .dropdown-content a[data-lang="zh"]::before {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 40"><path d="M0 0h60v40H0z" fill="%23de2910"/><g fill="%23ffde00"><path d="M12 6l2 6-2 6 6-2 6 2-2-6 2-6-6 2z"/><path d="M48 8l1 3-1 3 3-1 3 1-1-3 1-3-3 1z"/><path d="M50 16l1 2-1 2 2-1 2 1-1-2 1-2-2 1z"/><path d="M46 20l1 2-1 2 2-1 2 1-1-2 1-2-2 1z"/><path d="M52 24l1 2-1 2 2-1 2 1-1-2 1-2-2 1z"/><path d="M48 28l1 2-1 2 2-1 2 1-1-2 1-2-2 1z"/><path d="M44 32l1 2-1 2 2-1 2 1-1-2 1-2-2 1z"/><path d="M50 36l1 2-1 2 2-1 2 1-1-2 1-2-2 1z"/></g></svg>');
}

/* Semantic: Render Japanese flag in dropdown list */
.dropdown.language-dropdown .dropdown-content a[data-lang="ja"]::before {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 40"><path d="M0 0h60v40H0z" fill="%23fff"/><circle cx="30" cy="20" r="9" fill="%23bc002d"/></svg>');
}

/* Semantic: Render Portuguese Brazil flag in dropdown list */
.dropdown.language-dropdown .dropdown-content a[data-lang="pt-BR"]::before {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 40"><path d="M0 0h60v40H0z" fill="%2300933e"/><path d="M0 0h60v40H0z" fill="%23ffdf00"/><circle cx="30" cy="20" r="8" fill="%23002776"/><path d="M30 12l2 6-2 6-2-6z" fill="%23ffdf00"/></svg>');
}

/* Semantic: Highlight the active language inside the dropdown */
html[lang="en"] .dropdown.language-dropdown .dropdown-content a[data-lang="en"],
html[lang="es"] .dropdown.language-dropdown .dropdown-content a[data-lang="es"],
html[lang="de"] .dropdown.language-dropdown .dropdown-content a[data-lang="de"],
html[lang="fr"] .dropdown.language-dropdown .dropdown-content a[data-lang="fr"],
html[lang="it"] .dropdown.language-dropdown .dropdown-content a[data-lang="it"],
html[lang="pt"] .dropdown.language-dropdown .dropdown-content a[data-lang="pt"],
html[lang="pt-BR"] .dropdown.language-dropdown .dropdown-content a[data-lang="pt-BR"],
html[lang="hi"] .dropdown.language-dropdown .dropdown-content a[data-lang="hi"],
html[lang="zh"] .dropdown.language-dropdown .dropdown-content a[data-lang="zh"],
html[lang="ja"] .dropdown.language-dropdown .dropdown-content a[data-lang="ja"] {
    background-color: rgba(26, 115, 232, 0.12);
    color: var(--primary-color);
    font-weight: 600;
}

/* Semantic: Sync the pill flag with the page language */
html[lang="en"] .dropdown.language-dropdown > a::before {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 30"><clipPath id="a"><path d="M0 0v30h60V0z"/></clipPath><clipPath id="b"><path d="M30 15h30v15zv15H0zH0V0zV0h30z"/></clipPath><g clip-path="url(%23a)"><path d="M0 0v30h60V0z" fill="%23012169"/><path d="M0 0l60 30m0-30L0 30" stroke="%23fff" stroke-width="6"/><path d="M0 0l60 30m0-30L0 30" clip-path="url(%23b)" stroke="%23C8102E" stroke-width="4"/><path d="M30 0v30M0 15h60" stroke="%23fff" stroke-width="10"/><path d="M30 0v30M0 15h60" stroke="%23C8102E" stroke-width="6"/></g></svg>');
}

html[lang="es"] .dropdown.language-dropdown > a::before {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 40"><path d="M0 0h60v40H0z" fill="%23c60b1e"/><path d="M0 10h60v20H0z" fill="%23ffc400"/></svg>');
}

html[lang="de"] .dropdown.language-dropdown > a::before {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 40"><path d="M0 0h60v40H0z" fill="%23000"/><path d="M0 13.333h60v13.333H0z" fill="%23ff0000"/><path d="M0 26.667h60V40H0z" fill="%23ffcc00"/></svg>');
}

html[lang="fr"] .dropdown.language-dropdown > a::before {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 40"><path d="M0 0h20v40H0z" fill="%23002395"/><path d="M20 0h20v40H20z" fill="%23fff"/><path d="M40 0h20v40H40z" fill="%23ed2939"/></svg>');
}

html[lang="it"] .dropdown.language-dropdown > a::before {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 40"><path d="M0 0h20v40H0z" fill="%23009246"/><path d="M20 0h20v40H20z" fill="%23fff"/><path d="M40 0h20v40H40z" fill="%23ce2b37"/></svg>');
}

html[lang="pt"] .dropdown.language-dropdown > a::before {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 40"><path d="M0 0h24v40H0z" fill="%2300652d"/><path d="M24 0h36v40H24z" fill="%23ff0000"/></svg>');
}

html[lang="pt-BR"] .dropdown.language-dropdown > a::before {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 40"><path d="M0 0h60v40H0z" fill="%2300933e"/><path d="M0 0h60v40H0z" fill="%23ffdf00"/><circle cx="30" cy="20" r="8" fill="%23002776"/><path d="M30 12l2 6-2 6-2-6z" fill="%23ffdf00"/></svg>');
}

html[lang="hi"] .dropdown.language-dropdown > a::before {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 40"><path d="M0 0h60v13.333H0z" fill="%23ff9933"/><path d="M0 13.333h60v13.333H0z" fill="%23fff"/><path d="M0 26.667h60V40H0z" fill="%23008000"/><circle cx="30" cy="20" r="4" fill="%23000080"/></svg>');
}

html[lang="zh"] .dropdown.language-dropdown > a::before {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 40"><path d="M0 0h60v40H0z" fill="%23de2910"/><g fill="%23ffde00"><path d="M12 6l2 6-2 6 6-2 6 2-2-6 2-6-6 2z"/><path d="M48 8l1 3-1 3 3-1 3 1-1-3 1-3-3 1z"/><path d="M50 16l1 2-1 2 2-1 2 1-1-2 1-2-2 1z"/><path d="M46 20l1 2-1 2 2-1 2 1-1-2 1-2-2 1z"/><path d="M52 24l1 2-1 2 2-1 2 1-1-2 1-2-2 1z"/><path d="M48 28l1 2-1 2 2-1 2 1-1-2 1-2-2 1z"/><path d="M44 32l1 2-1 2 2-1 2 1-1-2 1-2-2 1z"/><path d="M50 36l1 2-1 2 2-1 2 1-1-2 1-2-2 1z"/></g></svg>');
}

html[lang="ja"] .dropdown.language-dropdown > a::before {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 40"><path d="M0 0h60v40H0z" fill="%23fff"/><circle cx="30" cy="20" r="9" fill="%23bc002d"/></svg>');
}

/* Semantic: Provide readable feedback containers for interactive code execution */
.example-output {
    margin-top: 0.75rem;
    padding: 0.75rem;
    border-left: 4px solid var(--border-color);
    background-color: rgba(15, 23, 42, 0.04);
    border-radius: 6px;
    min-height: 2.5rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.example-output.idle {
    border-left-color: var(--border-color);
    color: var(--text-secondary);
}

.example-output.loading {
    border-left-color: #2563eb;
    color: #1d4ed8;
}

.example-output.success {
    border-left-color: #16a34a;
    color: #166534;
}

.example-output.error {
    border-left-color: #dc2626;
    color: #b91c1c;
    background-color: rgba(220, 38, 38, 0.08);
}

.example-output {
    background-color: rgba(255, 255, 255, 0.06);
    border-left-color: rgba(148, 163, 184, 0.45);
    color: var(--text-color);
}

.example-output.loading {
    border-left-color: #60a5fa;
    color: #bfdbfe;
}

.example-output.success {
    border-left-color: #34d399;
    color: #bbf7d0;
}

.example-output.error {
    border-left-color: #f87171;
    color: #fecaca;
    background-color: rgba(248, 113, 113, 0.16);
}

/* Semantic: Respect dark theme with softened surfaces */
.dropdown.language-dropdown > a {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    color: var(--text-color);
    border-color: rgba(148, 163, 184, 0.25);
    box-shadow: 0 12px 30px rgba(2, 6, 23, 0.55);
}

.dropdown.language-dropdown > a:hover,
.dropdown.language-dropdown > a:focus {
    color: var(--primary-color);
}

.dropdown.language-dropdown .dropdown-content {
    background: #111827;
    border-color: rgba(148, 163, 184, 0.25);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

.dropdown.language-dropdown .dropdown-content a {
    color: var(--text-color);
}

.dropdown.language-dropdown .dropdown-content a:hover {
    background-color: rgba(96, 165, 250, 0.16);
    color: #ffffff;
}

@media (max-width: 768px) {
    /* Semantic: Expand the tappable area and align text centrally on mobile */
    .dropdown.language-dropdown {
        margin: 0.75rem 0;
        width: 100%;
    }

    .dropdown.language-dropdown > a {
        width: 100%;
        justify-content: center;
    }

    .dropdown.language-dropdown .dropdown-content {
        position: static;
        margin-top: 0.75rem;
        width: 100%;
        box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
    }

    .dropdown.language-dropdown .dropdown-content a {
        justify-content: center;
    }
}

/* Replit Affiliate Banner Styles */
.replit-banner {
    background: linear-gradient(135deg, #2196F3 0%, #1565C0 100%);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 2rem 0;
    color: white;
    text-align: center;
    box-shadow: 0 4px 20px rgba(33, 150, 243, 0.25);
    transition: all 0.3s ease;
    border: none;
    position: relative;
    overflow: hidden;
}

.replit-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.replit-banner:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(33, 150, 243, 0.4);
}

.replit-banner h3 {
    color: white;
    margin: 0 0 0.8rem 0;
    font-size: 1.4rem;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.replit-banner p {
    color: rgba(255, 255, 255, 0.95);
    margin: 0 0 1.2rem 0;
    font-size: 1rem;
    line-height: 1.5;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.replit-banner .cta-button {
    display: inline-block;
    background: #ffffff;
    color: #0d47a1;
    padding: 0.8rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    position: relative;
    z-index: 1;
}

.replit-banner .cta-button:hover {
    background: #f5f5f5;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    color: #0d47a1;
}

.replit-banner.compact {
    padding: 1rem;
    margin: 1.5rem 0;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.replit-banner.compact h3 {
    font-size: 1.1rem;
    margin: 0;
}

.replit-banner.compact p {
    margin: 0.3rem 0 0 0;
    font-size: 0.9rem;
}

.replit-banner.compact .cta-button {
    padding: 0.6rem 1.5rem;
    font-size: 0.9rem;
    margin-left: 1rem;
}

.replit-banner-content {
    flex: 1;
}

.replit-banner-side {
    background: linear-gradient(135deg, #FF6B35 0%, #F7931E 100%);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    color: white;
    text-align: center;
    box-shadow: 0 3px 15px rgba(255, 107, 53, 0.25);
    max-width: 300px;
}

.replit-banner-side h4 {
    color: white;
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    font-weight: 600;
}

.replit-banner-side p {
    color: rgba(255, 255, 255, 0.95);
    margin: 0 0 0.8rem 0;
    font-size: 0.85rem;
    line-height: 1.4;
}

.replit-banner-side .cta-button {
    background: white;
    color: #F7931E;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    display: inline-block;
    transition: all 0.3s ease;
}

.replit-banner-side .cta-button:hover {
    background: #f5f5f5;
    transform: scale(1.05);
}

/* Dark theme support for banners */
.replit-banner {
    background: linear-gradient(135deg, #1976D2 0%, #0D47A1 100%);
    box-shadow: 0 4px 20px rgba(25, 118, 210, 0.3);
}

.replit-banner:hover {
    box-shadow: 0 6px 25px rgba(25, 118, 210, 0.45);
}

.replit-banner-side {
    background: linear-gradient(135deg, #E65100 0%, #FF8F00 100%);
    box-shadow: 0 3px 15px rgba(230, 81, 0, 0.3);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .replit-banner {
        padding: 1.2rem;
        margin: 1.5rem 0;
    }
    
    .replit-banner h3 {
        font-size: 1.2rem;
    }
    
    .replit-banner p {
        font-size: 0.95rem;
    }
    
    .replit-banner.compact {
        flex-direction: column;
        text-align: center;
    }
    
    .replit-banner.compact .cta-button {
        margin: 1rem 0 0 0;
        width: 100%;
        box-sizing: border-box;
    }
    
    .replit-banner-side {
        max-width: 100%;
        margin: 1rem 0;
    }
}

@media (max-width: 600px) {
    .replit-banner.compact {
        flex-direction: column;
        text-align: center;
        padding: 1rem;
    }
    
    .replit-banner.compact .cta-button {
        width: 100%;
        margin: 1rem 0 0 0;
        padding: 0.8rem 1rem;
        font-size: 1rem;
    }
    
    .replit-banner-side {
        text-align: center;
        padding: 1.2rem;
    }
    
    .replit-banner-side .cta-button {
        width: 100%;
        margin-top: 1rem;
        padding: 0.8rem 1rem;
    }
}

@media (max-width: 480px) {
    .replit-banner .cta-button {
        padding: 0.7rem 1.5rem;
        font-size: 0.95rem;
    }
}

