/* ========================================
   CSS RESET & BASE STYLES
======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Color Palette */
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #475569;
    --accent-color: #f59e0b;
    --danger-color: #ef4444;
    --success-color: #10b981;

    /* Display Colors */
    --display-bg: #1e293b;
    --display-text: #f1f5f9;
    --expression-text: #94a3b8;

    /* Button Colors */
    --btn-bg: #f8fafc;
    --btn-hover: #e2e8f0;
    --btn-text: #0f172a;
    --operator-bg: #dbeafe;
    --operator-hover: #bfdbfe;
    --equals-bg: var(--primary-color);
    --equals-hover: var(--primary-hover);
    --function-bg: #ede9fe;
    --function-hover: #ddd6fe;

    /* Spacing */
    --gap-xs: 0.25rem;
    --gap-sm: 0.5rem;
    --gap-md: 1rem;
    --gap-lg: 1.5rem;
    --gap-xl: 2rem;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
}

/* ========================================
   HEADER SECTION
======================================== */
.site-header {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 2px solid #e2e8f0;
    overflow: visible;
    /* Allow mobile menu to slide out */
}

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

/* Logo Styles */
.logo {
    flex-shrink: 0;
}

.logo a {
    text-decoration: none;
    display: flex;
    align-items: center;
}

.logo-text {
    font-size: 1.75rem;
    font-weight: 800;
    color: #1e293b;
    letter-spacing: -0.02em;
}

.logo-highlight {
    color: var(--primary-color);
    position: relative;
}

.logo-highlight::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 2px;
}

.logo img {
    max-width: 32px;
    margin-right: 10px;
}


/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    gap: 0.25rem;
    z-index: 1001;
}

.hamburger {
    width: 25px;
    height: 2px;
    background: var(--primary-color);
    transition: all 0.3s ease;
    border-radius: 2px;
}

.mobile-menu-toggle.active .hamburger:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

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

.mobile-menu-toggle.active .hamburger:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Navigation Styles */
.main-nav {
    flex-grow: 1;
    display: flex;
    justify-content: flex-end;
}

.nav-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0.25rem;
    align-items: center;
}

.nav-link {
    display: block;
    padding: 0.625rem 1rem;
    color: #475569;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    white-space: nowrap;
}

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

.nav-link.active {
    border-bottom: 1px solid var(--primary-color);
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

/* ========================================
   NAV DROPDOWN
======================================== */
.nav-dropdown {
    position: relative;
    list-style: none;
}

.nav-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    cursor: pointer;
    background: none;
    border: none;
    font-family: inherit;
}

.nav-arrow {
    font-size: 0.55rem;
    transition: transform 0.2s ease;
    color: inherit;
}

.nav-dropdown:hover .nav-arrow,
.nav-dropdown.open .nav-arrow {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 0.25rem);
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    min-width: 200px;
    padding: 0.4rem 0;
    list-style: none;
    margin: 0;
    z-index: 1100;
    animation: dropdownFade 0.15s ease;
}

@keyframes dropdownFade {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu {
    display: block;
}

.nav-dropdown-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 1rem;
    color: #475569;
    text-decoration: none;
    font-size: 0.9125rem;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.nav-dropdown-link i {
    width: 18px;
    text-align: center;
    font-size: 0.8rem;
    color: #94a3b8;
    transition: color 0.15s;
}

.nav-dropdown-link:hover {
    background: #f1f5f9;
    color: var(--primary-color);
}

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

.nav-dropdown-link.active {
    color: var(--primary-color);
    font-weight: 600;
    background: #f8fafc;
}

.nav-dropdown-link.active i {
    color: var(--primary-color);
}

/* ========================================
   INTRODUCTION SECTION
======================================== */
.intro-section {
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 2px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.intro-container {
    max-width: 800px;
    margin: 0 auto;
    padding: var(--gap-md) var(--gap-md);
    text-align: center;
}

.intro-title {
    font-size: 1rem;
    font-weight: 400;
    color: #1e293b;
    margin: 0 0 var(--gap-sm) 0;
    line-height: 1.3;
}

.intro-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
}

.intro-content.expanded {
    max-height: 500px;
    transition: max-height 0.5s ease-in;
}

.intro-text {
    font-size: 0.8125rem;
    line-height: 1.6;
    color: #475569;
    margin: 0 0 var(--gap-sm) 0;
    text-align: left;
}

.intro-text-extra {
    display: block;
}

.read-more-btn {
    color: #475569;
    border: 1px solid var(--primary-color);
    border-radius: 20px;
    /*  background: var(--primary-color); */

    padding: 0.375rem 0.875rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    box-shadow: var(--shadow-sm);
    margin-top: var(--gap-xs);
}

.read-more-btn:hover {
    /* background: var(--primary-hover);*/
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    color: #475569;
}

.read-more-btn:active {
    transform: translateY(0);

}

.btn-icon {
    transition: transform 0.3s ease;
    font-size: 0.625rem;
}

.read-more-btn.active .btn-icon {
    transform: rotate(180deg);
}

/* ========================================
   MAIN CONTENT WRAPPER
======================================== */
.main-content {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: var(--gap-md);
    gap: var(--gap-lg);
    overflow-x: hidden;
}

/* ========================================
   AD CONTAINERS
======================================== */
.ad-container {
    display: none;
    /* Hidden on mobile */
    width: 160px;
    min-height: 600px;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: var(--gap-md);
    position: sticky;
    top: var(--gap-md);
    border: 1px solid #334155;
}

.ad-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: var(--gap-md);
}

.ad-label {
    color: #94a3b8;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--gap-md);
    padding: var(--gap-xs) var(--gap-md);
    background: rgba(148, 163, 184, 0.1);
    border-radius: var(--radius-sm);
    border: 1px solid #334155;
}

/* ========================================
   CALCULATOR CONTAINER - MOBILE FIRST
======================================== */
.calculator-container {
    width: 100%;
    max-width: 420px;
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: visible;
    transition: max-width var(--transition-normal);
    position: relative;
}

/* Make calculator sticky so display stays visible */
.calculator {
    padding: 0;
    position: relative;
}

.calculator>*:not(.quick-access-section) {
    padding-left: var(--gap-sm);
    padding-right: var(--gap-sm);
}

.calculator>.buttons-container,
.calculator>.display-section {
    padding-bottom: var(--gap-sm);
}

.calculator>.display-section {
    padding-top: var(--gap-xs);
}

/* ========================================
   MODE SELECTOR
======================================== */
.mode-selector {
    display: flex;
    gap: var(--gap-xs);
    padding: var(--gap-sm);
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.mode-btn {
    flex: 1;
    padding: 0.65rem 0.5rem;
    border: none;
    background: white;
    color: var(--secondary-color);
    font-weight: 600;
    font-size: 0.8rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
    touch-action: manipulation;
    /* Prevents double-tap zoom */
}

.mode-btn:hover {
    background: var(--btn-hover);
    transform: translateY(-1px);
}

.mode-btn.active {
    background: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-md);
}

/* ========================================
   CALCULATOR MAIN
======================================== */
.calculator {
    padding: var(--gap-md);
}

/* ========================================
   DISPLAY SECTION
======================================== */
.display-section {
    background: var(--display-bg);
    padding: var(--gap-md);
    border-radius: var(--radius-lg);
    margin-bottom: var(--gap-md);
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.expression {
    color: var(--expression-text);
    font-size: 0.75rem;
    min-height: 1rem;
    margin-bottom: var(--gap-xs);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.display {
    color: var(--display-text);
    font-size: 1.75rem;
    font-weight: 600;
    text-align: right;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.2;
    word-break: break-all;
    hyphens: none;
}

/* Scale down font for very long numbers */
.display[data-length="long"] {
    font-size: 1.25rem;
}

.display[data-length="very-long"] {
    font-size: 1rem;
}

/* ========================================
   MEMORY DISPLAY
======================================== */
.memory-display {
    display: none;
    background: #fef3c7;
    color: #92400e;
    padding: var(--gap-sm) var(--gap-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--gap-md);
    font-size: 0.875rem;
    font-weight: 500;
}

.memory-display.active {
    display: block;
}

/* ========================================
   QUICK ACCESS SECTION (Memory + Conversion)
   Always visible at the TOP for all modes
======================================== */
.quick-access-section {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--gap-sm);
    margin-bottom: var(--gap-sm);
    padding: var(--gap-sm);
    background: linear-gradient(135deg, #f0fdf4 0%, #fef3c7 100%);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border: 2px solid #d1fae5;
    border-bottom: none;
}

.quick-access-section h3 {
    font-size: 0.65rem;
    color: #166534;
    margin-bottom: var(--gap-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Memory Section within Quick Access */
.memory-section {
    margin-bottom: 0;
}

.memory-buttons {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--gap-xs);
}

.memory-buttons .btn {
    padding: 0.65rem 0.5rem;
    font-size: 0.75rem;
}

/* Conversion Section within Quick Access */
.conversion-section h3 {
    font-size: 0.65rem;
    color: #92400e;
}

.conversion-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--gap-xs);
}

.conversion-buttons .btn {
    padding: 0.65rem;
    font-size: 0.75rem;
}

/* ========================================
   BUTTONS CONTAINER
======================================== */
.buttons-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--gap-xs);
}

/* Hide scientific and advanced by default */
.scientific-buttons,
.advanced-buttons {
    display: none;
    margin-top: var(--gap-sm);
}

.scientific-buttons {
    grid-template-columns: repeat(4, 1fr);
}

/* ========================================
   BUTTON STYLES
======================================== */
.btn {
    padding: 0.75rem 0.5rem;
    border: none;
    background: var(--btn-bg);
    color: var(--btn-text);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    /* Prevents double-tap zoom */
}

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

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

/* Button Variants */
.btn.operator {
    background: var(--operator-bg);
    color: var(--primary-color);
    font-weight: 600;
}

.btn.operator:hover {
    background: var(--operator-hover);
}

.btn.equals {
    background: var(--equals-bg);
    color: white;
    font-weight: 700;
    font-size: 1rem;
}

.btn.equals:hover {
    background: var(--equals-hover);
}

.btn.clear {
    background: var(--danger-color);
    color: white;
    font-weight: 600;
}

.btn.clear:hover {
    background: #dc2626;
}

.btn.function {
    background: var(--function-bg);
    color: #6d28d9;
    font-weight: 600;
    font-size: 0.75rem;
}

.btn.function:hover {
    background: var(--function-hover);
}

.btn.memory {
    background: #dcfce7;
    color: #166534;
    font-weight: 600;
    font-size: 0.75rem;
}

.btn.memory:hover {
    background: #bbf7d0;
}

.btn.conversion {
    background: #fef3c7;
    color: #92400e;
    font-weight: 600;
}

.btn.conversion:hover {
    background: #fde68a;
}

.btn.conversion.active {
    background: var(--accent-color);
    color: white;
}

/* ========================================
   ADVANCED MODE SECTIONS
======================================== */
.advanced-buttons {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--gap-sm);
}

/* ========================================
   HISTORY PANEL
======================================== */
.history-panel {
    display: none;
    padding: var(--gap-sm);
    background: #f8fafc;
    border-top: 2px solid #e2e8f0;
    max-height: 120px;
    overflow-y: auto;
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

.history-panel.active {
    display: block;
}

.history-panel h3 {
    font-size: 0.65rem;
    color: var(--secondary-color);
    margin-bottom: var(--gap-xs);
    font-weight: 600;
    text-transform: uppercase;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: var(--gap-xs);
}

.history-item {
    background: white;
    padding: var(--gap-xs) var(--gap-sm);
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    border-left: 2px solid var(--primary-color);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.history-item:hover {
    background: var(--btn-hover);
    transform: translateX(4px);
}

.history-item .calculation {
    color: var(--secondary-color);
    font-size: 0.65rem;
}

.history-item .result {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.7rem;
}

/* ========================================
   RESPONSIVE BREAKPOINTS
======================================== */

/* Mobile Navigation */
@media (max-width: 991px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .main-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: white;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        transition: right 0.3s ease;
        padding-top: 80px;
        z-index: 999;
    }

    .main-nav.active {
        right: 0;
    }

    .nav-list {
        flex-direction: column;
        gap: 0;
        align-items: stretch;
        padding: var(--gap-md);
    }

    .nav-link {
        padding: 1rem;
        font-size: 1rem;
    }

    .nav-link.active {
        background: linear-gradient(90deg, var(--primary-color), var(--primary-hover));
        color: white;
        border-bottom: none;
        box-shadow: none;
    }

    /* Mobile dropdown */
    .nav-dropdown {
        position: static;
    }

    .nav-dropdown-toggle {
        width: 100%;
        justify-content: space-between;
    }

    .nav-dropdown-menu {
        position: static;
        transform: none;
        box-shadow: none;
        border: none;
        border-radius: 0;
        min-width: 0;
        padding: 0;
        background: #f8fafc;
        animation: none;
    }

    .nav-dropdown-link {
        padding: 0.75rem 1rem 0.75rem 1.5rem;
        font-size: 0.9375rem;
    }

    .nav-dropdown-link i {
        width: 22px;
        font-size: 0.85rem;
    }
}

/* Gradual nav reduction from tablet to desktop - smooth scaling */
@media (min-width: 768px) and (max-width: 850px) {
    .nav-link {
        padding: 0.5rem 0.375rem;
        font-size: 0.7rem;
    }

    .nav-list {
        gap: 0.1rem;
    }
}

@media (min-width: 851px) and (max-width: 950px) {
    .nav-link {
        padding: 0.5625rem 0.4375rem;
        font-size: 0.7125rem;
    }

    .nav-list {
        gap: 0.125rem;
    }
}

@media (min-width: 951px) and (max-width: 1050px) {
    .nav-link {
        padding: 0.5625rem 0.5075rem;
        font-size: 0.920rem;
    }

    .nav-list {
        gap: 0.15rem;
    }
}

@media (min-width: 1051px) and (max-width: 1150px) {
    .nav-link {
        padding: 0.5938rem 0.5rem;
        font-size: 0.7625rem;
    }

    .nav-list {
        gap: 0.1875rem;
    }
}

@media (min-width: 1151px) and (max-width: 1250px) {
    .nav-link {
        padding: 0.6094rem 0.625rem;
        font-size: 0.8125rem;
    }

    .nav-list {
        gap: 0.2125rem;
    }
}


/* Small tablets and larger phones (576px+) */
@media (min-width: 576px) {
    .calculator-container {
        max-width: 420px;
    }

    .display {
        font-size: 2rem;
    }

    .btn {
        padding: 0.875rem 0.5rem;
        font-size: 0.9375rem;
    }

    .mode-btn {
        font-size: 0.875rem;
        padding: 0.75rem 0.875rem;
    }

    .quick-access-section {
        grid-template-columns: 1fr;
    }

    .memory-buttons .btn,
    .conversion-buttons .btn {
        padding: 0.875rem 0.5rem;
        font-size: 0.875rem;
    }
}

/* Tablets (768px+) */
@media (min-width: 768px) {
    .intro-title {
        font-size: 1.375rem;
    }

    .intro-text {
        font-size: 0.875rem;
    }

    .intro-container {
        padding: var(--gap-md) var(--gap-lg);
    }

    .read-more-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8125rem;
    }

    .main-content {
        padding: var(--gap-xl);
    }

    .calculator-container.scientific-mode,
    .calculator-container.advanced-mode {
        max-width: 480px;
    }

    .quick-access-section {
        grid-template-columns: 2fr 1fr;
        gap: var(--gap-md);
    }

    .memory-section {
        margin-bottom: 0;
    }

    .scientific-buttons {
        grid-template-columns: repeat(4, 1fr);
    }

    .memory-buttons {
        grid-template-columns: repeat(5, 1fr);
        gap: var(--gap-sm);
    }

    .memory-buttons .btn {
        padding: 0.875rem 0.5rem;
        font-size: 0.8rem;
    }

    .conversion-buttons {
        gap: var(--gap-sm);
    }

    .conversion-buttons .btn {
        padding: 0.875rem;
        font-size: 0.8rem;
    }

    .advanced-buttons {
        grid-template-columns: repeat(4, 1fr);
    }

    .history-panel {
        max-height: 150px;
    }

    .btn {
        padding: 0.875rem 0.5rem;
    }
}

/* Desktops (1024px+) - Show Ads */
@media (min-width: 1024px) {
    .ad-container {
        display: block;
    }

    .nav-link {
        font-size: 0.9375rem;
        padding: 0.75rem 1.125rem;
    }

    .calculator-container.advanced-mode {
        max-width: 480px;
    }

    .btn {
        padding: 0.875rem 0.5rem;
    }

    .display {
        font-size: 2rem;
    }
}

/* Large desktops (1280px+) */
@media (min-width: 1280px) {
    .header-container {
        max-width: 1600px;
    }

    .intro-title {
        font-size: 1.5rem;
    }

    .intro-text {
        font-size: 0.9375rem;
    }

    .intro-container {
        max-width: 900px;
    }

    .nav-link {
        font-size: 1rem;
        padding: 0.75rem 1.25rem;
    }

    .ad-container {
        width: 200px;
        min-height: 700px;
    }

    .calculator-container.advanced-mode {
        max-width: 500px;
    }

    .history-panel {
        max-height: 160px;
    }

    .btn {
        padding: 1rem 0.5rem;
        font-size: 0.9375rem;
    }
}

/* Extra large desktops (1440px+) */
@media (min-width: 1440px) {
    .ad-container {
        width: 250px;
    }
}

/* ========================================
   ACCESSIBILITY & KEYBOARD FOCUS
======================================== */
.btn:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* ========================================
   UTILITY CLASSES
======================================== */
.error {
    color: var(--danger-color);
}

.hidden {
    display: none !important;
}

/* ========================================
   PRINT STYLES
======================================== */
@media print {
    body {
        background: white;
    }

    .calculator-container {
        box-shadow: none;
    }

    .mode-selector,
    .advanced-buttons,
    .scientific-buttons {
        display: none;
    }
}

/* ========================================
   DARK MODE SUPPORT (Optional)
======================================== */
@media (prefers-color-scheme: dark) {
    :root {
        --btn-bg: #334155;
        --btn-hover: #475569;
        --btn-text: #f1f5f9;
    }

    body {
        background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    }

    .calculator-container {
        background: #1e293b;
    }

    .mode-selector,
    .history-panel {
        background: #0f172a;
        border-color: #334155;
    }

    .mode-btn {
        background: #334155;
        color: #f1f5f9;
    }

    .history-item {
        background: #334155;
        color: #f1f5f9;
    }
}