:root {
    --icon-primary: #1a365d;
    --icon-secondary: #bee3f8;
    --icon-accent: #ed8936;
    --icon-neutral: #2d3748;
    --icon-light: #cbd5e0;

    /* TI Calculator colors */
    --ti-bg: #00d0ff;
    --ti-screen-bg: #effce0;
    --ti-screen-text: #1a1a1a;
    --key-num-bg: #ffffff;
    --key-num-text: #000;
    --key-op-bg: #007bff;
    --key-op-text: #fff;
    --key-sci-bg: #4a4a4a;
    --key-sci-text: #fff;
    --key-2nd-bg: #f39c12;
    --key-enter-bg: #007bff;
}

/* Base Styles */
body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* Typography */
h1,
h2 {
    color: darkblue;
    font-weight: bold;
}

h3 {
    color: green;
    font-weight: bold;
}

h4 {
    color: orange;
    font-weight: bold;
}

/* Layout */
.header,
.main-header {
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .1);
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.main-header h1 {
    color: #333;
    font-size: 2rem;
    font-weight: 600;
    margin: 0;
}

.main-header,
.subtitle {
    color: #666;
    font-size: 1.1rem;
    margin-top: .5rem;
}

.main-header p,
.main-header small {
    font-size: clamp(.875rem, 2vw, 1rem);
}

.main-header small {
    font-size: clamp(.75rem, 1.5vw, .875rem);
}

.logo {
    width: 100px;
    height: auto;
    max-width: 100%;
}

.navbar {
    background-color: #f8f9fa;
    border-bottom: 1px solid #ddd;
}

/* Search */
.search-bar {
    max-width: 600px;
    margin: 0 auto;
}

.search-box,
.converter-form {
    background: white;
    padding: 1.25rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .1);
    margin-bottom: 1.25rem;
}

.converter-form {
    padding: 20px;
    margin-bottom: 20px;
}

/* Cards & Containers */
.form-card,
.results-card,
.chart-card,
.results,
.category-card,
.formula-section,
.converter-form,
.search-box,
.sidebar,
.revenue-display,
.revenue-breakdown,
.calculation-section,
.revenue-metrics,
.adsense-calculator-section,
.depreciation-summary,
.currency-display,
.rate-info,
.popular-rates {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .1);
    margin-bottom: 20px;
}

.wheel-container {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .1);
    margin-bottom: 20px;
    text-align: center;
}

.category-card {
    padding: 20px;
    transition: transform .2s;
}

.category-card:hover {
    transform: translateY(-5px);
}

.chart-card {
    min-height: 500px;
    padding: 15px;
}

@media (min-width: 768px) {

    .form-card,
    .chart-card {
        padding: 20px;
    }
}

/* Categories */
.categories {
    margin-top: 30px;
}

.category-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.category-icon {
    width: 36px;
    height: 36px;
    margin-right: 12px;
    stroke: var(--icon-primary);
    stroke-width: 2;
    fill: none;
    opacity: .95;
    transition: transform .2s ease, color .2s ease;
}

.category-card:hover .category-icon {
    transform: scale(1.1);
    stroke: var(--icon-accent);
}

.category-links a {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    color: #007bff;
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color .15s ease;
}

.category-links a:hover {
    background-color: #f0f8ff;
    color: var(--icon-accent);
}

.calculator-item.hidden {
    display: none;
}

.calc-icon {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    stroke: var(--icon-primary);
    stroke-width: 2;
    fill: none;
    flex-shrink: 0;
    opacity: .9;
}

.calc-icon.colored {
    fill: var(--icon-secondary);
    stroke: var(--icon-primary);
}

.calc-icon.accent {
    fill: var(--icon-accent);
    stroke: var(--icon-accent);
}

/* Sidebar */
.sidebar {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .05);
}

.sidebar h4 {
    color: #333;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.sidebar .list-group-item {
    display: flex;
    align-items: center;
    border: none;
    padding: 8px 12px;
    margin-bottom: 4px;
    border-radius: 4px;
    transition: background-color .15s ease;
}

.sidebar .list-group-item:hover {
    background-color: #e3f2fd;
}

.sidebar .list-group-item a {
    color: #0d6efd;
    text-decoration: none;
    width: 100%;
}

.sidebar p a {
    color: #0d6efd;
    font-weight: 500;
}

.sidebar p a:hover {
    text-decoration: underline;
}

/* Lists */
.list-group-item {
    border: none;
    padding: .5rem 0;
    border-bottom: 1px solid #eee;
}

.list-group-item a {
    color: #0d6efd;
    text-decoration: none;
}

.list-group-item a:hover {
    text-decoration: underline;
}

.list-unstyled {
    list-style-type: none;
}

.nav-link {
    color: #495057;
    padding: 5px 0;
    display: block;
    text-decoration: none;
}

.nav-link:hover {
    color: #667eea;
    padding-left: 5px;
}

/* Badges */
.category-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: .85rem;
    margin-bottom: 10px;
    font-weight: bold;
}

.category-badge.structural {
    background: #e3f2fd;
    color: #1976d2;
}

.category-badge.electrical {
    background: #fff3e0;
    color: #f57c00;
}

.category-badge.fluid {
    background: #e0f2f1;
    color: #00796b;
}

.category-badge.thermal {
    background: #ffebee;
    color: #c62828;
}

.category-badge.mechanical {
    background: #f3e5f5;
    color: blue;
}

.category-badge.math {
    background: #f1f8e9;
    color: #558b2f;
}

/* Formulas & Tables */
.formula,
.equation-block,
.formula-card {
    background: #f8f9fa;
    padding: 15px;
    margin: 15px 0;
    border-left: 4px solid #667eea;
    border-radius: 4px;
}

.formula {
    font-size: 1.1rem;
}

.variable-explanation {
    color: #6c757d;
    font-size: .9rem;
    margin: 10px 0;
}

.highlight {
    background: #fff3cd;
    padding: 2px 4px;
    border-radius: 3px;
}

.constants-table {
    font-size: .9rem;
}

.table-striped>tbody>tr:nth-of-type(odd)>td {
    background-color: rgba(0, 0, 0, .02);
}

/* Buttons */
.show-more-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    color: #007bff;
    cursor: pointer;
    font-size: .9rem;
    margin-top: 10px;
    padding: 8px 12px;
    text-align: center;
    width: 100%;
    transition: all .15s ease;
}

.show-more-btn:hover {
    background: #e9ecef;
    color: #0056b3;
}

.show-more-btn.expanded {
    color: #dc3545;
}

.show-more-btn.expanded:hover {
    color: #c82333;
}

.btn-ai {
    background: linear-gradient(135deg, #007bff, #0056b3);
    border: none;
    color: white;
    overflow: hidden;
}

.btn-ai:hover {
    background: linear-gradient(135deg, #0056b3, #004085);
}

/* Footer refinements (merged duplicates) */
footer {
    background: #fff;
    padding: 40px 20px;
    margin-top: 20px;
    border-top: 1px solid #ddd;
    text-align: center;
}

.calculator-card {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

/* TI-Style Calculator */
.ti_calculator-card {
    background: var(--ti-bg);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, .4), inset 0 1px 1px rgba(255, 255, 255, .1);
    max-width: 500px;
    margin: 0 auto;
}

.calc-brand {
    color: #888;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 1px;
    margin-bottom: 10px;
    text-transform: uppercase;
    display: flex;
    justify-content: space-between;
}

.display-container {
    background: linear-gradient(180deg, #c6cfbd 0%, #9ea792 100%);
    border: 4px solid #444;
    border-radius: 8px;
    padding: 10px 15px;
    margin-bottom: 20px;
    box-shadow: inset 2px 2px 5px rgba(0, 0, 0, .2);
}

.display-info {
    display: flex;
    justify-content: space-between;
    font-size: .8rem;
    color: #333;
    font-family: monospace;
    margin-bottom: 5px;
    padding-bottom: 2px;
    border-bottom: 1px solid rgba(0, 0, 0, .1);
}

.mode-indicator {
    font-weight: bold;
    background: #333;
    color: #c6cfbd;
    padding: 0 4px;
    border-radius: 2px;
    font-size: .7rem;
}

.expression-line {
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    color: #444;
    min-height: 25px;
    text-align: right;
    word-wrap: break-word;
}

.result-line {
    font-family: 'Courier New', monospace;
    font-size: 2.2rem;
    color: #000;
    text-align: right;
    font-weight: bold;
    min-height: 45px;
    overflow-x: auto;
}

.keypad {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.key {
    padding: 12px 5px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all .1s;
    user-select: none;
    box-shadow: 0 3px 0 rgba(0, 0, 0, .3);
    position: relative;
    overflow: hidden;
}

.key:active {
    transform: translateY(3px);
    box-shadow: none;
}

.key.sci {
    background: var(--key-sci-bg);
    color: var(--key-sci-text);
}

.key.sci:hover {
    filter: brightness(1.2);
}

.key.num {
    background: var(--key-num-bg);
    color: var(--key-num-text);
    font-weight: bold;
    font-size: 1.2rem;
}

.key.num:hover {
    background: #f0f0f0;
}

.key.op {
    background: var(--key-op-bg);
    color: var(--key-op-text);
}

.key.op:hover {
    filter: brightness(1.1);
}

.key.shift {
    background: var(--key-2nd-bg);
    color: white;
}

.key.shift.active {
    background: #d35400;
    box-shadow: inset 0 3px 5px rgba(0, 0, 0, .5);
    transform: translateY(2px);
}

.key.clear {
    background: #c0392b;
    color: white;
}

.key .sup-text {
    position: absolute;
    top: 2px;
    left: 50%;
    transform: translateX(-50%);
    font-size: .6rem;
    color: #f39c12;
    opacity: 0;
}

.shift-mode .key .sup-text {
    opacity: 1;
}

.shift-mode .key .main-text {
    opacity: .3;
}

.equals-button-special {
    background: #0d6efd;
}

.equals-button-special:hover {
    filter: brightness(1.1);
}

.history-panel {
    margin-top: 20px;
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ddd;
}

.history-item {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid #eee;
    font-size: .9rem;
    cursor: pointer;
}

.history-item:hover {
    background: #f8f9fa;
}

.memory-indicator-hidden {
    visibility: hidden;
}

/* Curve Plotter */
.chart-controls,
.examples-panel,
.growth-chart {
    padding: 15px;
    border-radius: 8px;
    color: white;
    margin: 15px 0;
    text-align: center;
}

.chart-controls {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.examples-panel {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.growth-chart {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.loan-summary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    margin: 15px 0;
}

.investment-summary {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    margin: 15px 0;
}

.curve-info {
    background: #e8f4fd;
    border: 1px solid #bee5eb;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
}

.curve-list {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
}

.curve-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    word-break: break-word;
}

.curve-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 10px;
    border: 2px solid #fff;
    box-shadow: 0 0 3px rgba(0, 0, 0, .3);
    flex-shrink: 0;
}

.curve-color-red {
    background: #FF6384;
}

.curve-color-blue {
    background: #36A2EB;
}

.curve-color-yellow {
    background: #FFCE56;
}

.curve-color-teal {
    background: #4BC0C0;
}

.curve-color-purple {
    background: #9966FF;
}

.curve-color-orange {
    background: #FF9F40;
}

.curve-color-gray {
    background: #C9CBCF;
}

.curve-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 20px 0;
    text-align: center;
}

@media (min-width: 576px) {
    .curve-controls {
        flex-direction: row;
        justify-content: center;
    }
}

.add-curve-btn,
#refresh-layout,
.curve-controls .btn-primary {
    border-radius: 8px;
    padding: 10px 20px;
    color: white;
    cursor: pointer;
    transition: all .3s ease;
    font-size: clamp(.875rem, 2vw, 1rem);
}

.add-curve-btn {
    background: #17a2b8;
    width: 100%;
}

.add-curve-btn:hover {
    background: #138496;
    transform: translateY(-2px);
}

#refresh-layout {
    background: #6c757d;
    border: 1px solid #6c757d;
    width: 100%;
    margin-top: 10px;
}

#refresh-layout:hover {
    background: #545b62;
    transform: translateY(-2px);
}

#refresh-layout.btn-success {
    background: #28a745;
    border-color: #28a745;
}

#refresh-layout.btn-success:hover {
    background: #218838;
}

.remove-curve-btn {
    background: #dc3545;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    color: white;
    font-size: 12px;
    cursor: pointer;
    transition: all .3s ease;
    flex-shrink: 0;
}

.remove-curve-btn:hover {
    background: #c82333;
}

.remove-function-btn-hidden {
    display: none;
}

.formula-display {
    background: #fff;
    border: 2px solid #667eea;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    font-family: 'Courier New', monospace;
    text-align: center;
    word-break: break-all;
}

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

@media (min-width: 576px) {
    .chart-container {
        height: 350px;
    }
}

@media (min-width: 768px) {
    .chart-container {
        height: 400px;
    }
}

@media (min-width: 992px) {
    .chart-container {
        height: 450px;
    }
}

.breakdown-table,
.yearly-breakdown {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
}

.yearly-breakdown {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #ddd;
}

.compound-effect {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    padding: 15px;
    border-radius: 8px;
    margin: 10px 0;
}

.positive {
    color: #28a745;
    font-weight: bold;
}

.negative {
    color: #dc3545;
    font-weight: bold;
}

/* Messages */
.error-message {
    color: #dc3545;
    font-weight: bold;
}

.warning-message {
    color: #856404;
    font-weight: bold;
}

.success-message {
    color: #28a745;
    font-weight: bold;
}

/* Responsive typography & buttons */
.form-label,
.form-control,
.btn,
.list-group-item a,
.curve-item span,
.sidebar h4,
.chart-controls h5,
.examples-panel h5 {
    font-size: clamp(.875rem, 2vw, 1rem);
}

small,
.text-muted {
    font-size: clamp(.75rem, 1.5vw, .875rem);
}

.btn {
    padding: .5rem 1rem;
}

.btn-sm {
    font-size: clamp(.75rem, 1.5vw, .875rem);
    padding: .25rem .5rem;
}

.example-btn {
    white-space: normal;
    text-align: left;
}

.input-group {
    flex-wrap: nowrap;
}

.input-group .form-control {
    min-width: 0;
}

.function-input-group {
    margin-bottom: 1rem;
}

.function-input-group .form-label {
    margin-bottom: .5rem;
}

@media (max-width: 575px) {
    .container {
        padding: 0 10px;
    }
}

@media (max-width: 576px) {
    .key {
        padding: 15px 0;
        font-size: .9rem;
    }

    .keypad {
        gap: 6px;
    }

    .result-line {
        font-size: 1.8rem;
    }

    .add-curve-btn,
    #refresh-layout,
    .curve-controls .btn-primary {
        width: 100%;
    }

    #refresh-layout {
        margin-top: 10px;
        margin-left: 0;
    }
}

@media (min-width: 576px) {

    .add-curve-btn,
    #refresh-layout,
    .curve-controls .btn-primary {
        width: auto;
    }

    #refresh-layout {
        margin-left: 10px;
        margin-top: 0;
    }
}

/* Dark mode */
@media (prefers-color-scheme: dark) {

    .category-icon,
    .calc-icon {
        stroke: var(--icon-light);
    }

    .category-card:hover .category-icon {
        stroke: var(--icon-accent);
    }

    .calc-icon.colored {
        fill: #2d3748;
    }
}

/* Print */
@media print {

    .sidebar,
    .search-box,
    .btn-print {
        display: none !important;
    }

    .formula-section {
        page-break-inside: avoid;
    }
}

/* FIX: Restore comfortable, consistent font size for sidebars & quick links */
.sidebar .list-group-item,
.sidebar .list-group-item a,
.list-group-item a,
.nav-link,
.category-links a,
.sidebar p a,
.footer-section a,
.example-btn,
.function-input-group .form-label,
small.form-text.text-muted {
    font-size: 1rem !important;
    /* 16px – matches main content */
    line-height: 1.5;
}

/* On very small mobile screens, allow a tiny bit of reduction but never below 15px */
@media (max-width: 480px) {

    .sidebar .list-group-item,
    .sidebar .list-group-item a,
    .list-group-item a,
    .nav-link,
    .category-links a {
        font-size: 0.95rem !important;
        /* still perfectly readable */
    }
}

/* Ensure category quick links inside cards also stay normal size */
.category-links a {
    font-size: 1rem;
    padding: 8px 12px;
    /* slightly more breathing room */
}

/* Optional: make hover state slightly bolder for better tap targets */
.category-links a:hover,
.sidebar .list-group-item:hover a {
    font-weight: 500;
}

/* ==================================================================
   NEW / MERGED STYLES FROM GE-depreciation-calculator.html
   ================================================================== */

/* Depreciation-specific gradient summary card */
.depreciation-summary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    margin: 15px 0;
    text-align: center;
}

/* Table container for depreciation schedule */
.breakdown-table {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    overflow-x: auto;
}

/* Method description box */
.method-description {
    background-color: #e9ecef;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

/* Hide utility */
.hidden {
    display: none !important;
}

/* Ensure positive/negative colors work everywhere */
.positive {
    color: #28a745;
    font-weight: bold;
}

.negative {
    color: #dc3545;
    font-weight: bold;
}

/* Slight refinement of sidebar list items (already mostly covered but made explicit) */
.sidebar .list-group-item {
    border: none;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.sidebar .list-group-item a {
    text-decoration: none;
    color: #0d6efd;
}

.sidebar .list-group-item a:hover {
    text-decoration: underline;
}

/* Small responsive tweak for very small screens (optional but keeps behavior) */
@media (max-width: 576px) {
    .depreciation-summary .row>div {
        margin-bottom: 1rem;
    }
}

/* Currency Converter Specific Cards */
.currency-display {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
}

.rate-info {
    background-color: #e8f4fd;
    border: 1px solid #bee5eb;
}

.popular-rates {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

/* Swap Button */
.currency-swap {
    text-align: center;
    margin: 20px 0;
}

.swap-button {
    background-color: #17a2b8;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.swap-button:hover {
    background-color: #138496;
    transform: rotate(180deg);
}

/* Trend Indicators */
.trend-up {
    color: #28a745;
}

.trend-down {
    color: #dc3545;
}

.trend-stable {
    color: #6c757d;
}

/* Last Updated Box */
.last-updated {
    background-color: #f8f9fa;
    padding: 10px;
    border-radius: 4px;
    font-size: 0.9em;
    color: #6c757d;
    text-align: center;
}

/* Custom Currency Input (hidden by default) */
.custom-currency-input {
    display: none;
    margin-top: 10px;
}

/* ==================================================================
   Date & Age Calculator – specific styles (added Dec 2025)
   ================================================================== */

.nav-tabs .nav-link {
    color: #333;
}

.nav-tabs .nav-link.active {
    background-color: #007bff;
    color: #fff !important;
    border-color: #007bff;
}

.result-highlight {
    background-color: #e7f3ff;
    border-left: 4px solid #007bff;
    padding: 15px;
    margin: 15px 0;
    border-radius: 4px;
    font-weight: 500;
}

.calculation-details {
    font-size: 0.9em;
    color: #666;
    background-color: #f8f9fa;
    padding: 12px;
    border-radius: 4px;
    margin-top: 10px;
}

/* Specific gradient summary cards */
.revenue-display,
.depreciation-summary,
.investment-summary,
.loan-summary,
.currency-display,
.popular-rates {
    color: white;
    text-align: center;
}

.revenue-display,
.investment-summary {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.depreciation-summary,
.loan-summary,
.currency-display {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.popular-rates {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

/* Other special cards */
.revenue-breakdown,
.compound-effect {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
}

.calculation-section,
.curve-info,
.rate-info {
    background: #e8f4fd;
    border: 1px solid #bee5eb;
}

.adsense-calculator-section {
    background-color: #e3f2fd;
    border: 1px solid #90caf9;
}

/* Metric items (used in AdSense page) */
.metric-item {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 10px;
    margin: 5px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Benchmark table */
.benchmark-table {
    font-size: 0.9em;
}

.benchmark-table th {
    background-color: #f8f9fa;
}

/* Formula reference box (black border style from AdSense page) */
.formula-reference {
    background-color: #fff;
    border: 2px solid #000;
    padding: 20px;
    margin: 15px 0;
    font-family: Arial, sans-serif;
}

.formula-reference h3 {
    border-bottom: 10px solid #000;
    padding-bottom: 5px;
    margin: 0 0 10px 0;
}

.formula-reference .line {
    border-bottom: 1px solid #000;
    padding: 2px 0;
    display: flex;
    justify-content: space-between;
}

.formula-reference .thick-line {
    border-bottom: 5px solid #000;
}

/* Positive / Negative text */
.positive {
    color: #28a745;
    font-weight: bold;
}

.negative {
    color: #dc3545;
    font-weight: bold;
}

/* ==================================================================
   Spinning Wheel Specific Styles
   ================================================================== */

.wheel-wrapper {
    position: relative;
    display: inline-block;
    margin: 20px 0;
}

.spinning-wheel {
    width: 400px;
    height: 400px;
    border-radius: 50%;
    border: 8px solid #ddd;
    position: relative;
    overflow: hidden;
    transition: transform 4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    background: linear-gradient(45deg, #f0f0f0, #ffffff);
}

.wheel-segment {
    position: absolute;
    width: 50%;
    height: 50%;
    transform-origin: 100% 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    padding: 10px;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.wheel-pointer {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 30px solid #dc3545;
    z-index: 10;
}

.spin-button {
    margin-top: 20px;
    padding: 12px 30px;
    font-size: 18px;
    font-weight: bold;
}

.spin-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.choices-editor {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

.choice-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    padding: 8px;
    background-color: white;
    border-radius: 5px;
    border: 1px solid #ddd;
}

.choice-input {
    flex: 1;
    margin-right: 10px;
    border: none;
    background: transparent;
    padding: 5px;
    font-size: 14px;
}

.choice-input:focus {
    outline: none;
    background-color: #f8f9fa;
    border-radius: 3px;
}

.remove-choice {
    color: #dc3545;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 2px 5px;
}

.remove-choice:hover {
    background-color: #dc3545;
    color: white;
    border-radius: 3px;
}

.add-choice {
    margin-top: 10px;
}

.result-display {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 5px;
    padding: 20px;
    margin-top: 20px;
    display: none;
}

.result-text {
    font-size: 24px;
    font-weight: bold;
    color: #155724;
    text-align: center;
}

.spin-history {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin-top: 20px;
    max-height: 200px;
    overflow-y: auto;
}

.history-item {
    padding: 5px 0;
    border-bottom: 1px solid #dee2e6;
    font-size: 14px;
}

.history-item:last-child {
    border-bottom: none;
}

.wheel-settings {
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 15px;
    margin: 15px 0;
    background-color: #f8f9fa;
}

@media (max-width: 768px) {
    .spinning-wheel {
        width: 300px;
        height: 300px;
    }

    .wheel-segment {
        font-size: 12px;
    }
}

/* MathWiz Specific Styles */
.mathwiz-body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    /* Prevent unwanted zoom and scrolling issues on mobile */
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    touch-action: manipulation;
}

.mathwiz-main-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.mathwiz-main-header h1 {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
}

.mathwiz-main-header p {
    font-size: clamp(0.875rem, 2vw, 1rem);
}

.mathwiz-main-header small {
    font-size: clamp(0.75rem, 1.5vw, 0.875rem);
}

.mathwiz-form-card {
    background-color: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

@media (min-width: 768px) {
    .mathwiz-form-card {
        padding: 20px;
    }
}

.mathwiz-practice-card {
    margin-top: 20px;
    background-color: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    min-height: 500px;
}

@media (min-width: 768px) {
    .mathwiz-practice-card {
        padding: 20px;
    }
}

.mathwiz-setup-panel {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    text-align: center;
}

.mathwiz-setup-panel h5 {
    font-size: clamp(1rem, 3vw, 1.25rem);
    margin-bottom: 0.5rem;
}

.mathwiz-setup-panel p {
    font-size: clamp(0.75rem, 2vw, 0.875rem);
}

.mathwiz-problem-container {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.mathwiz-problem-display {
    font-size: clamp(2rem, 8vw, 3rem);
    font-weight: bold;
    color: #333;
    margin-bottom: 20px;
}

.mathwiz-answer-input {
    font-size: clamp(1.25rem, 4vw, 1.5rem);
    text-align: center;
    padding: 10px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    max-width: 200px;
    margin: 0 auto 20px;
}

.mathwiz-answer-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.mathwiz-controls-panel {
    text-align: center;
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

@media (min-width: 576px) {
    .mathwiz-controls-panel {
        flex-direction: row;
        justify-content: center;
    }
}

.mathwiz-btn-custom {
    background-color: #667eea;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    color: white;
    font-size: clamp(0.875rem, 2vw, 1rem);
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

@media (min-width: 576px) {
    .mathwiz-btn-custom {
        width: auto;
    }
}

.mathwiz-btn-custom:hover {
    background-color: #5a6fd8;
    transform: translateY(-2px);
}

.mathwiz-btn-submit {
    background-color: #28a745;
}

.mathwiz-btn-submit:hover {
    background-color: #218838;
}

.mathwiz-btn-skip {
    background-color: #ffc107;
    color: #333;
}

.mathwiz-btn-skip:hover {
    background-color: #e0a800;
}

.mathwiz-btn-reset {
    background-color: #6c757d;
}

.mathwiz-btn-reset:hover {
    background-color: #545b62;
}

.mathwiz-progress-info {
    background-color: #e8f4fd;
    border: 1px solid #bee5eb;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
}

.mathwiz-progress-info p {
    font-size: clamp(0.875rem, 2vw, 1rem);
    margin-bottom: 0.5rem;
}

.mathwiz-results-panel {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    margin: 15px 0;
    text-align: center;
}

.mathwiz-results-panel h4 {
    font-size: clamp(1.25rem, 4vw, 1.75rem);
    margin-bottom: 1rem;
}

.mathwiz-results-panel .score {
    font-size: clamp(2rem, 8vw, 3rem);
    font-weight: bold;
    margin: 15px 0;
}

.mathwiz-drawer-container {
    margin-top: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 15px;
    /* Prevent interference with touch events */
    touch-action: manipulation;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.mathwiz-drawer-toolbar {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

@media (max-width: 576px) {
    .mathwiz-drawer-toolbar {
        gap: 8px;
        margin-bottom: 12px;
    }

    .mathwiz-drawer-toolbar button {
        flex: 1;
        min-width: 50px;
        max-width: 80px;
    }
}

@media (min-width: 576px) and (max-width: 991px) {
    .mathwiz-drawer-toolbar {
        gap: 12px;
    }
}

@media (min-width: 992px) {
    .mathwiz-drawer-toolbar {
        gap: 15px;
    }
}

.mathwiz-drawer-header {
    background-color: #f8f9fa;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 10px;
    text-align: center;
}

.mathwiz-drawer-toolbar button {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    background-color: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    /* Touch-friendly improvements */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.mathwiz-drawer-toolbar button:hover {
    background-color: #e9ecef;
}

.mathwiz-drawer-toolbar button.active {
    background-color: #667eea;
    color: white;
    border-color: #667eea;
}

#mathwiz-drawingCanvas {
    border: 2px solid #dee2e6;
    border-radius: 4px;
    cursor: crosshair;
    display: block;
    margin: 0 auto;
    background-color: white;
    /* Essential for touch devices */
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    /* Prevent scrolling while drawing */
    overscroll-behavior: contain;
    /* Ensure proper scaling */
    box-sizing: border-box;
    object-fit: contain;
}

.mathwiz-form-label {
    font-size: clamp(0.875rem, 2vw, 1rem);
}

.mathwiz-form-control {
    font-size: clamp(0.875rem, 2vw, 1rem);
}

.mathwiz-form-check {
    margin-right: 15px;
}

.mathwiz-form-check-label {
    font-size: clamp(0.875rem, 2vw, 1rem);
    margin-left: 5px;
}

.mathwiz-wizard-message {
    font-size: clamp(1rem, 3vw, 1.25rem);
    font-weight: bold;
    text-align: center;
    margin: 15px 0;
}

.mathwiz-wizard-message.excellent {
    color: #28a745;
}

.mathwiz-wizard-message.good {
    color: #17a2b8;
}

.mathwiz-wizard-message.needs-practice {
    color: #ffc107;
}

/* Responsive canvas sizing */
#mathwiz-drawingCanvas {
    width: 100%;
    height: 300px;
    min-height: 200px;
    max-height: 500px;
}

/* Small mobile devices (portrait) */
@media (max-width: 576px) {
    #mathwiz-drawingCanvas {
        height: 250px;
        min-height: 200px;
    }

    .mathwiz-drawer-toolbar {
        gap: 5px;
    }

    .mathwiz-drawer-toolbar button {
        padding: 8px 12px;
        font-size: 0.8rem;
        min-width: 60px;
    }
}

/* Small mobile devices (landscape) */
@media (max-width: 576px) and (orientation: landscape) {
    #mathwiz-drawingCanvas {
        height: 180px;
        min-height: 150px;
    }
}

@media (min-width: 576px) and (max-width: 991px) {
    #mathwiz-drawingCanvas {
        height: 350px;
    }
}

@media (min-width: 992px) {
    #mathwiz-drawingCanvas {
        height: 400px;
    }
}

@media (min-width: 1200px) {
    #mathwiz-drawingCanvas {
        height: 450px;
    }
}

/* Enhanced touch-friendly styles */
.mathwiz-drawer-toolbar button {
    /* Add touch-friendly padding and minimum size */
    min-height: 44px;
    min-width: 60px;
    -webkit-tap-highlight-color: transparent;
}

/* Original class names for backward compatibility */
.drawer-container {
    margin-top: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 15px;
    touch-action: manipulation;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.drawer-toolbar {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

@media (max-width: 576px) {
    .drawer-toolbar {
        gap: 8px;
        margin-bottom: 12px;
    }

    .drawer-toolbar button {
        flex: 1;
        min-width: 50px;
        max-width: 80px;
    }
}

@media (min-width: 576px) and (max-width: 991px) {
    .drawer-toolbar {
        gap: 12px;
    }
}

@media (min-width: 992px) {
    .drawer-toolbar {
        gap: 15px;
    }
}

.drawer-header {
    background-color: #f8f9fa;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 10px;
    text-align: center;
}

.drawer-toolbar button {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    background-color: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    /* Add touch-friendly padding and minimum size */
    min-height: 44px;
    min-width: 60px;
}

.drawer-toolbar button:hover {
    background-color: #e9ecef;
}

.drawer-toolbar button.active {
    background-color: #667eea;
    color: white;
    border-color: #667eea;
}

#drawingCanvas {
    border: 2px solid #dee2e6;
    border-radius: 4px;
    cursor: crosshair;
    display: block;
    margin: 0 auto;
    background-color: white;
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    overscroll-behavior: contain;
    box-sizing: border-box;
    object-fit: contain;
    width: 100%;
    height: 300px;
    min-height: 200px;
    max-height: 500px;
}

/* Responsive canvas sizing for original canvas */
@media (max-width: 576px) {
    #drawingCanvas {
        height: 250px;
        min-height: 200px;
    }

    .drawer-toolbar {
        gap: 5px;
    }

    .drawer-toolbar button {
        padding: 8px 12px;
        font-size: 0.8rem;
        min-width: 60px;
    }
}

@media (max-width: 576px) and (orientation: landscape) {
    #drawingCanvas {
        height: 180px;
        min-height: 150px;
    }
}

@media (min-width: 576px) and (max-width: 991px) {
    #drawingCanvas {
        height: 350px;
    }
}

@media (min-width: 992px) {
    #drawingCanvas {
        height: 400px;
    }
}

@media (min-width: 1200px) {
    #drawingCanvas {
        height: 450px;
    }
}

/* ==================================================================
   CHESS BOARD GAME SPECIFIC STYLES
   ================================================================== */

/* Chess Board Color Variables */
:root {
    --light-square: #f0f0f0;
    --dark-square: #8b7355;
    --white-piece: #ffffff;
    --black-piece: #333333;
    --selected-color: #ffd700;
    --valid-move-color: #90ee90;
    --border-color: #ddd;
    --board-border: #333;
}

/* Chess Board Container */
.chess-container {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.chess-board-wrapper {
    display: inline-block;
    margin: 20px 0;
    border: 8px solid var(--border-color);
    border-radius: 8px;
    background-color: #f8f8f8;
    padding: 10px;
}

/* Chess Board Grid */
.chess-board {
    display: grid;
    grid-template-columns: repeat(8, 60px);
    grid-template-rows: repeat(8, 60px);
    gap: 0;
    border: 2px solid var(--board-border);
}

/* Individual Squares */
.square {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    user-select: none;
}

.square.light {
    background-color: var(--light-square);
}

.square.dark {
    background-color: var(--dark-square);
}

.square:hover {
    filter: brightness(1.1);
    transform: scale(1.05);
}

.square.selected {
    background-color: var(--selected-color) !important;
    box-shadow: inset 0 0 0 3px #ff6b35;
}

.square.valid-move {
    background-color: var(--valid-move-color) !important;
    position: relative;
}

.square.valid-move::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.square.valid-move.capture::after {
    width: 50px;
    height: 50px;
    border: 3px solid #dc3545;
    background-color: transparent;
    border-radius: 50%;
}

.square.in-check {
    background-color: #ff6b6b !important;
    animation: pulse 1s infinite;
}

/* Chess Pieces */
.piece {
    pointer-events: none;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.piece.white {
    color: var(--white-piece);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.piece.black {
    color: var(--black-piece);
}

/* Game Controls */
.game-controls {
    margin-top: 20px;
}

.game-controls button {
    margin: 0 10px;
    padding: 10px 20px;
}

.current-player {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 4px solid #007bff;
}

.game-status {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 5px;
    padding: 15px;
    margin-top: 20px;
    display: none;
}

.game-status.game-over {
    display: block;
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.game-status.check {
    display: block;
    background-color: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

/* Game Mode Selection */
.game-mode-selector {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

/* Color Customization */
.color-customization {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.color-swatch {
    width: 40px;
    height: 40px;
    border: 2px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    margin: 5px;
    transition: all 0.2s ease;
}

.color-swatch:hover {
    transform: scale(1.1);
    border-color: #007bff;
}

.color-swatch.selected {
    border-color: #007bff;
    border-width: 3px;
}

/* Move History */
.move-history {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
    max-height: 300px;
    overflow-y: auto;
}

.move-item {
    padding: 5px 0;
    border-bottom: 1px solid #dee2e6;
    font-size: 14px;
}

.move-item:last-child {
    border-bottom: none;
}

/* Chess-specific Sidebar */
.chess-sidebar {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
}

.piece-palette {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin: 15px 0;
}

.piece-option {
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 24px;
}

.piece-option:hover {
    border-color: #007bff;
    background-color: #f0f8ff;
}

.piece-option.selected {
    border-color: #007bff;
    background-color: #e7f3ff;
}

/* Captured Pieces */
.captured-pieces {
    background-color: #f8f9fa;
    padding: 10px;
    border-radius: 5px;
    margin-top: 15px;
}

.captured-piece {
    font-size: 20px;
    margin: 2px;
    opacity: 0.6;
}

/* Animations */
.highlight-move {
    animation: highlightMove 0.5s ease;
}

@keyframes highlightMove {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }

    100% {
        opacity: 1;
    }
}

/* AI Thinking Indicator */
.ai-thinking {
    display: none;
    align-items: center;
    justify-content: center;
    padding: 10px;
    background-color: #e3f2fd;
    border-radius: 5px;
    margin: 10px 0;
}

.ai-thinking.show {
    display: flex;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Winner Modal Styles */
.winner-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.winner-modal.show {
    display: flex;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.winner-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 50px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: zoomIn 0.5s ease;
    position: relative;
}

@keyframes zoomIn {
    from {
        transform: scale(0.5);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.winner-trophy {
    font-size: 80px;
    margin-bottom: 20px;
    animation: bounce 1s infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

.winner-title {
    font-size: 48px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.winner-player {
    font-size: 36px;
    color: #ffd700;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.winner-buttons button {
    margin: 0 10px;
    padding: 15px 30px;
    font-size: 18px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.winner-buttons button:hover {
    transform: scale(1.1);
}

/* Confetti Animation */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background-color: #f0f;
    position: absolute;
    animation: confetti-fall 3s linear forwards;
    z-index: 10000;
}

@keyframes confetti-fall {
    to {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10000;
}

/* Chess-specific responsive design */
@media (max-width: 768px) {
    .chess-board {
        grid-template-columns: repeat(8, 40px);
        grid-template-rows: repeat(8, 40px);
    }

    .square {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }

    .piece {
        font-size: 20px;
    }

    body {
        font-family: 'Helvetica Neue', Arial, sans-serif;
        background-color: #f5f5f5;
        color: #333;
    }

    .main-header {
        background-color: #fff;
        padding: 20px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    .form-card {
        background-color: #fff;
        padding: 20px;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    .results-card {
        margin-top: 20px;
        background-color: #fff;
        padding: 20px;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    .sidebar {
        background-color: #fff;
        padding: 20px;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    footer {
        text-align: center;
        padding: 20px;
        background-color: #fff;
        margin-top: 20px;
    }

    .header {
        background-color: #fff;
        padding: 20px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    .logo {
        width: 100px;
        height: auto;
        max-width: 100%;
    }

    /* Sidebar Styles */
    .sidebar {
        background: white;
        border-radius: 8px;
        padding: 1.5rem;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    }

    .sidebar h4 {
        font-size: 1.1rem;
        font-weight: 600;
        margin-bottom: 1rem;
    }

    .list-group-item {
        border: none;
        padding: 0.5rem 0;
        border-bottom: 1px solid #eee;
    }

    .list-group-item a {
        text-decoration: none;
        color: #0d6efd;
    }

    .list-group-item a:hover {
        text-decoration: underline;
    }




    footer {
        text-align: center;
        padding: 20px;
        background-color: #fff;
        margin-top: 20px;
    }

    footer {
        background-color: #fff;
        padding: 40px 20px;
        margin-top: 20px;
        border-top: 1px solid #ddd;
    }

    .footer-section {
        margin-bottom: 20px;
    }
}