:root {
    --color-primary: #bf1922;     /* Deep red */
    --color-secondary: #137dc5;   /* Strong blue */
    --color-light: #E8DAB2;      /* Light sand for subtracted amount */
    --color-remainder: #fce38a;   /* Warm yellow */
    --color-grid: #E2E2E2;
    --color-text: #333;
    --color-mult-1: #FFFFFF;  /* Changed to white */
    --color-mult-2: #99FF99;
    --color-mult-3: #9999FF;
    --color-mult-4: #FFFF99;
    --color-mult-5: #FF99FF;
    --color-mult-6: #99FFFF;
    --color-mult-7: #FFB366;
    --color-mult-8: #B366FF;
    --color-mult-9: #66FFB3;
    --color-mult-10: #FF66B3;
    --color-mult-11: #B3FF66;
    --color-mult-12: #66B3FF;
    --color-mult-13: #FFE666;
    --color-mult-14: #E666FF;
    --color-mult-15: #66FFE6;
    --color-mult-16: #FF9980;  /* Added color for 16 */
    --color-title: #1a365d;  /* Darker blue for the title */
}

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

body {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    background-color: #f9f9f9;
    color: var(--color-text);
}

.container {
    display: flex;
    flex-direction: row;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem;
}

.calculator-side {
    flex: 1;
    min-width: 300px;
}

.grid-side {
    flex: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100vh;
    overflow: hidden;
}

.calculation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin: 3rem 0;
    transform: scale(0.85);
}

.calculation input[type="number"] {
    width: 120px !important;
    height: 120px !important;
    font-size: 48px !important;
    text-align: center;
    border: 2px solid var(--color-primary);
    border-radius: 12px;
    padding: 10px !important;
}

.calculation .operator {
    width: 80px !important;
    height: 80px !important;
    font-size: 40px !important;
    background-color: #FFE5E7 !important;  /* Light pink background */
    color: #FF1A44 !important;  /* Dark pink text */
    border: none !important;
    border-radius: 12px !important;
    cursor: pointer;
    transition: all 0.3s ease;
}

.calculation .operator.selected,
.calculation .operator[data-selected="true"] {
    background-color: #FF1A44 !important;  /* Dark pink background */
    color: white !important;  /* White text */
    font-weight: 900 !important;
}

.calculation #calculate {
    width: 80px !important;
    height: 80px !important;
    font-size: 40px !important;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    background-color: var(--color-primary);
    color: white;
}

.calculation select {
    width: 120px;
    padding: 8px;
    border: 2px solid var(--color-gray-200);
    border-radius: var(--radius-md);
    font-family: 'Nunito', sans-serif;
    font-size: 2em;  /* Much larger */
    color: var(--color-gray-700);
    cursor: pointer;
    text-align: center;
}

.calculation select:focus {
    outline: none;
    border-color: var(--color-primary);
}

.calculation span {
    font-size: 2em;  /* Much larger */
    color: var(--color-gray-700);
}

#result {
    font-weight: bold;
    min-width: 30px;
    font-size: 2em;  /* Much larger */
}

.operators {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.operator:hover {
    transform: scale(1.1);
}

.visualization-side {
    flex: 1;
    padding: 0;
    overflow-x: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.grid-wrapper {
    position: absolute;
    top: 50%;
    left: 75%;
    transform: translate(-50%, -50%);
    width: fit-content;
    height: fit-content;
    padding-left: 47px;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    grid-template-rows: repeat(20, 1fr);
    gap: 2px;
    background-color: #ddd;
    height: min(90vh, 1000px);
    width: calc(min(90vh, 1000px) / 2);
    position: relative;
}

.grid-labels-x {
    display: flex;
    justify-content: space-between;
    width: calc(min(90vh, 1000px) / 2 * 1.03);
    margin-bottom: 5px;
    padding: 0 10px;
    color: #444;
    font-size: calc(min(90vh, 1000px) / 2 * 0.03);
}

.grid-labels-x span {
    flex: 1;
    text-align: center;
    margin: 0 1px;
}

.grid-labels-x span:first-child {
    margin-left: 0;
}

.grid-labels-x span:last-child {
    margin-right: 0;
}

.grid-labels-y {
    position: absolute;
    left: 2px;  /* Moved 40px right from -38px */
    top: 22px;
    display: grid;
    grid-template-rows: repeat(20, 1fr);
    height: calc(100% - 24px);
    color: #444;
    font-size: calc(min(90vh, 1000px) / 2 * 0.03);
}

.grid-labels-y span {
    display: flex;
    align-items: center;
    padding-right: 8px;
    height: 100%;
}

.cell {
    background-color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    aspect-ratio: 1;
    transition: background-color 0.3s ease;
    font-family: 'Nunito', sans-serif;
    border-radius: 4px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(10, 40px);
    gap: 10px;
    padding: 10px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: fit-content;
}

.grid-cell {
    width: 40px;
    height: 40px;
    background-color: var(--color-grid);
    border-radius: 6px;
    transition: background-color 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.grid-cell.prime {
    background-color: #FF0000 !important;  /* Bright red */
    border: 3px solid #000000;  /* Strong black border */
    border-radius: 4px;
    z-index: 2;  /* Ensure primes appear on top */
    color: white;  /* White text color */
    display: flex;  /* Enable centering of the P */
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 1.5rem;
}

.grid-cell.prime::after {
    content: 'P';
}

.cell.number-one {
    background-color: var(--color-primary);
    transition: background-color 0.3s ease;
}

.cell.number-two {
    background-color: var(--color-secondary);
    transition: background-color 0.3s ease;
}

.cell.number-two-light {
    background-color: rgba(19, 125, 197, 0.3);  /* Lighter version of secondary color */
    transition: background-color 0.3s ease;
}

.cell.remainder {
    background-color: var(--color-remainder);
    transition: background-color 0.3s ease;
}

/* Responsive layout */
@media (max-width: 1024px) {
    .grid-wrapper {
        position: relative;  /* Change to relative positioning */
        top: 0;
        left: 0;
        transform: none;
        margin: 2rem auto;  /* Add margin for spacing */
        padding-left: 47px;
    }

    .container {
        flex-direction: column;  /* Stack columns */
        align-items: center;  /* Center content */
    }

    .calculator-side {
        width: 100%;
        max-width: 600px;  /* Limit width */
        margin-bottom: 2rem;
    }

    .grid-container {
        max-width: 90vw; /* Limit width on mobile */
        margin: 0 auto;
    }

    /* Adjust grid labels for mobile */
    .grid-labels-x, 
    .grid-labels-y {
        font-size: 0.8em;
    }

    /* Adjust concept descriptions for mobile */
    .concept-description {
        font-size: 1.2em;
    }

    /* Adjust calculator inputs for mobile */
    .calculation-container {
        max-width: 100%;
    }
}

/* Further adjustments for smaller screens */
@media (max-width: 600px) {
    .grid-wrapper {
        margin: 0 auto;
        width: 100%;
        padding: 0 10px;
        box-sizing: border-box;
    }
    
    .grid-container {
        margin: 0 auto;
    }
    
    /* Remove extra space above image containers */
    .graph-container,
    .square-image-container,
    .triangular-image-container,
    .spiral-container,
    .lazycaterer-image-container {
        margin-top: 0;
        padding-top: 0;
    }

    .concept-description {
        font-size: 1em;
    }

    /* Adjust grid cell size for mobile */
    .cell {
        font-size: 0.7em;
    }

    /* Make the SumShine header smaller */
    .sumshine {
        font-size: 1.5rem;  /* reduce from a larger size */
    }
    
    /* For the left blue box and its inner content */
    .left-panel {
        padding: 0.75rem;  /* reduce overall padding */
    }
    
    /* Adjust the visualization-controls container so buttons wrap if needed */
    .visualization-controls {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;  /* center the buttons */
        margin: 0.5rem 0;
    }
    
    /* Adjust individual view-buttons (Matrix / Graph / Image) */
    .visualization-controls .view-button {
        flex: 1 1 auto;         /* allow them to shrink */
        margin: 0.2rem;         /* reduce spacing between them */
        font-size: 0.8rem;      /* reduce font size */
        padding: 0.3rem 0.5rem;   /* reduce the padding */
        min-width: fit-content; /* avoid forcing too much width */
    }

    /* Reset the height of grid-side so that it adjusts to its content on mobile */
    .grid-side {
        height: auto;        /* Allow the height to adjust dynamically */
        min-height: initial;  /* Remove any forced minimum height */
        max-height: none;     /* Remove any max-height restrictions */
    }
}

.concept-container {
    background-color: #F0F7FF;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#concept-selector {
    font-size: 0.9375em;  /* Made 25% larger from previous 0.75em */
    padding: 15px 30px;  /* Increased padding proportionally */
    width: auto;
    border: 2px solid var(--color-primary);
    border-radius: 30px;  /* Increased for larger size */
    background-color: white;
    color: var(--color-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Nunito', sans-serif;
    font-weight: 500;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: 
        linear-gradient(45deg, transparent 50%, var(--color-primary) 50%),
        linear-gradient(135deg, var(--color-primary) 50%, transparent 50%);
    background-position:
        calc(100% - 18px) calc(1em + 7px),
        calc(100% - 13px) calc(1em + 7px);
    background-size:
        6px 6px,
        6px 6px;
    background-repeat: no-repeat;
    box-shadow: 0 2px 5px rgba(255, 26, 68, 0.1);
    margin-top: -25px;  /* Move up 25px */
    margin-bottom: 25px;  /* Add padding below */
}

#concept-selector:hover {
    background-color: var(--color-primary);
    color: white;
    box-shadow: 0 4px 10px rgba(255, 26, 68, 0.2);
    background-image: 
        linear-gradient(45deg, transparent 50%, white 50%),
        linear-gradient(135deg, white 50%, transparent 50%);
}

#concept-selector:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 26, 68, 0.3);
}

.concept-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

#concept-title {
    margin-bottom: 1.5rem;
    font-size: 3.15rem;
}

#concept-text {
    max-width: 800px;
    margin-bottom: 2rem;
    font-size: 2.1rem;
    text-align: center;
    line-height: 1.4;
}

.timestable-buttons {
    max-width: 700px;
    gap: 18px;
}

.timestable-btn {
    padding: 26px;
    font-size: 2.1rem;
    border: none;
    border-radius: 18px;
    background-color: var(--color-grid);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Comic Neue', cursive;
}

.timestable-btn:hover {
    transform: scale(1.05);
    background-color: var(--color-primary);
}

.timestable-btn.active {
    background-color: var(--color-primary);
    transform: scale(0.95);
}

.hidden {
    display: none !important;
}

#tool-title {
    font-family: 'Shrikhand', cursive;
    font-size: 4rem;
    color: var(--color-title);
    margin-bottom: -1rem;
    text-align: center;
}

#tool-tagline {
    font-family: 'Nunito', sans-serif;
    font-weight: 300;
    font-size: 1.5rem;
    color: #666;
    margin-bottom: 2.5rem;
    text-align: center;
    font-style: italic;
}

#visualization-toggle {
    margin-bottom: 2rem;
    display: flex;
    gap: 1rem;
}

#visualization-toggle.hidden {
    display: none;
}

.toggle-btn {
    padding: 0.8rem 1.5rem;
    font-size: 1.2rem;
    border: 2px solid var(--color-primary);
    border-radius: 10px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Comic Neue', cursive;
}

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

.graph-container {
    display: none;
    width: 100%;
    height: 100%;
    background: white;
    border: 1px solid #ccc;
    border-radius: var(--radius-md);
}

.graph-container.active {
    display: block;
}

#fibonacci-toggle {
    margin-bottom: 2rem;
    display: flex;
    gap: 1rem;
}

#fibonacci-toggle.hidden {
    display: none;
}

.fibonacci-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.fibonacci-spiral-img {
    max-width: 90%;
    max-height: 80vh;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.spiral-btn {
    padding: 0.8rem 1.5rem;
    font-size: 1.2rem;
    border: 2px solid var(--color-primary);
    border-radius: 10px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Comic Neue', cursive;
    margin-bottom: 2rem;
}

.spiral-btn:hover {
    background: var(--color-primary);
    color: white;
}

.spiral-btn.hidden {
    display: none;
}

.number-toggle-btn {
    width: 100%;
    padding: 0.5rem 1rem;
    margin-top: 3rem;
    border: 2px solid var(--color-primary);
    border-radius: var(--radius-md);
    background-color: white;
    color: var(--color-primary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.number-toggle-btn.active {
    background-color: var(--color-primary);
    color: white;
}

.cell.show-number {
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cell.show-number::before {
    content: attr(data-number);
}

.grid-cell .number {
    color: white;
    font-size: 0.8rem;
    font-weight: bold;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
    display: none;
}

.grid-cell .number.show {
    display: block;
}

h2 {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
}

button, select {
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
}

.concept-text {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    line-height: 1.6;
}

.grid-labels-x, .grid-labels-y {
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
}

.number {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
}

.calculator-content {
    margin-top: 3rem;
}

.calculator-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 3rem 0;
    transform: scale(0.7);  /* Explicitly scale everything down by 30% */
}

.number-display {
    background-color: #f8f9fa;
    border-radius: 6px;
    padding: 8px 15px;
    font-size: 24px;  /* Explicitly smaller font */
    min-width: 30px;
    text-align: center;
}

.operator-display {
    padding: 8px;
    font-size: 24px;  /* Explicitly smaller font */
    min-width: 20px;
    text-align: center;
}

.operator-btn {
    width: 40px;  /* Explicitly smaller */
    height: 40px;
    font-size: 20px;
    padding: 0;
    margin: 5px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    /* Inactive state */
    background-color: #FFE5E7;  /* Very light pink */
    color: #FF1A44;  /* Dark pink text */
}

.operator-btn.active {
    /* Active state */
    background-color: #FF1A44;  /* Dark pink background */
    color: white;
    font-weight: 900;  /* Extra bold */
    transform: scale(1.15);  /* More dramatic scale */
    box-shadow: 0 4px 12px rgba(255, 26, 68, 0.5);  /* More prominent shadow */
}

.operator-btn:not(.active):hover {
    background-color: #FFD0D5;  /* Medium light pink on hover */
}

.number-box {
    width: 70px;  /* 30% smaller */
    height: 70px;
    font-size: 1.75rem;
    background-color: white;
    border: 2px solid var(--color-primary);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0.35rem;
}

.equals-btn {
    width: 70px;
    height: 49px;
    font-size: 1.4rem;
    margin: 0.35rem;
}

.clear-btn {
    width: 70px;
    height: 49px;
    font-size: 1rem;
    margin: 0.35rem;
}

/* Target the specific elements with more specific selectors */
#calculator-content .calculator-display {
    transform: scale(0.7) !important;
    margin: 3rem auto !important;
}

#calculator-content .number-display {
    font-size: 24px !important;
    padding: 8px 15px !important;
    min-width: 30px !important;
    background-color: #f8f9fa !important;
    border-radius: 6px !important;
}

#calculator-content .operator-display {
    font-size: 24px !important;
    padding: 8px !important;
    min-width: 20px !important;
}

/* Very specific selector for operator buttons */
#calculator-content .operator-btn {
    width: 40px !important;
    height: 40px !important;
    font-size: 20px !important;
    background-color: #FFE5E7 !important;
    color: #FF1A44 !important;
    border: none !important;
    padding: 0 !important;
    margin: 5px !important;
}

#calculator-content .operator-btn.active {
    background-color: #FF1A44 !important;
    color: white !important;
    font-weight: 900 !important;
    transform: scale(1.15) !important;
    box-shadow: 0 4px 12px rgba(255, 26, 68, 0.5) !important;
}

#calculator-content .operator-btn:not(.active):hover {
    background-color: #FFD0D5 !important;
}

/* Target the specific operator buttons */
#calculator-content .calculation .operators {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#calculator-content .calculation .operators .operator {
    /* Core sizing */
    width: 80px !important;
    height: 80px !important;
    font-size: 40px !important;
    
    /* Remove outlines and borders */
    outline: none !important;
    border: none !important;
    
    /* Styling */
    border-radius: 12px !important;
    background-color: #FFE5E7 !important;
    color: #FF1A44 !important;
    
    /* Layout */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 5px !important;
    
    /* Interaction */
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
}

#calculator-content .calculation .operators .operator.active {
    background-color: #FF1A44 !important;
    color: white !important;
    font-weight: 900 !important;
    box-shadow: 0 2px 8px rgba(255, 26, 68, 0.3) !important;
}

/* Target operators by their data attributes */
button[data-op="+"],
button[data-op="-"],
button[data-op="×"],
button[data-op="÷"] {
    width: 80px !important;
    height: 80px !important;
    font-size: 40px !important;
    border: none !important;
    border-radius: 12px !important;
    cursor: pointer;
    transition: all 0.3s ease;
    /* Default state */
    background-color: #FFE5E7 !important;
    color: #FF1A44 !important;
    margin: 5px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Hover state */
button[data-op]:hover {
    background-color: #FFD0D5 !important;
}

/* Active state */
button[data-op].selected {
    background-color: #FF1A44 !important;
    color: white !important;
    font-weight: 900 !important;
    transform: scale(1.15) !important;
    box-shadow: 0 4px 12px rgba(255, 26, 68, 0.5) !important;
}

/* Container styling */
.operators {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Style all operator buttons */
button[data-op] {
    width: 80px !important;
    height: 80px !important;
    font-size: 40px !important;
    background-color: #FFE5E7 !important;
    color: #FF1A44 !important;
    border: none !important;
    border-radius: 12px !important;
    cursor: pointer;
    transition: all 0.3s ease;
}

button[data-op]:hover {
    background-color: #FFD0D5 !important;
}

button[data-op].selected {
    background-color: #FF1A44 !important;
    color: white !important;
    font-weight: 900 !important;
    transform: scale(1.15) !important;
    box-shadow: 0 4px 12px rgba(255, 26, 68, 0.5) !important;
}

/* Hide all concept content by default */
.concept-container .concept-content {
    display: none;
}

/* Only show the active concept content */
.concept-container .concept-content.active {
    display: block;
}

/* Style all concept headers consistently */
.concept-content h2 {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 2em;
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--color-title);
}

/* Times Tables number buttons */
.number-line {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px;
}

.number-line .row {
    display: flex;
    justify-content: center;
    gap: 10px;
}

/* Times Tables number buttons */
.number-line button {
    width: 60px !important;
    height: 60px !important;
    font-size: 30px !important;
    background-color: #FFE5E7 !important;
    color: #FF1A44 !important;
    border: none !important;
    border-radius: 12px !important;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 5px !important;
}

.number-line button.all-tables {
    width: 200px !important;  /* Wider for "Show All" text */
    margin-top: 20px !important;  /* Extra space above the Show All button */
    background-color: #E6E6E6 !important;
    color: #333 !important;
}

.number-line button:hover {
    background-color: #FFD0D5 !important;
}

.number-line button.all-tables:hover {
    background-color: #D9D9D9 !important;
}

.number-line button.active {
    background-color: #FF1A44 !important;
    color: white !important;
    font-weight: 900 !important;
}

.number-line button.all-tables.active {
    background-color: #333 !important;
    color: white !important;
}

/* Style for numbers in cells */
.cell span {
    color: white;
    font-weight: 300;
    font-family: 'Nunito', sans-serif;
}

/* Style for concept descriptions */
.concept-description {
    font-size: 1.2em;  /* Increase text size by 50% */
    padding-bottom: 50px;  /* Add padding below text */
}

.concept-description p {
    margin-bottom: 1em;  /* Increased from 0.5em */
}

/* Keep the last paragraph flush with the bottom padding */
.concept-description p:last-child {
    margin-bottom: 0;
}

.calculation-container {
    background: white;
    padding: 0 30px;  /* Reduced from 30px all around to just left/right */
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin: 0 auto;
    max-width: 600px;
}

/* Limit input width for 2 digits */
.calculation input[type="number"] {
    width: 60px;
    text-align: center;
}

/* Prevent the up/down arrows on number inputs */
.calculation input[type="number"]::-webkit-inner-spin-button,
.calculation input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.calculation input[type="number"] {
    -moz-appearance: textfield;
}

/* Add JavaScript to limit input to 2 digits */

.view-toggle {
    background-color: #FFE5E7;
    color: #FF1A44;
    border: none;
    border-radius: 25px;
    padding: 12px 24px;
    font-family: 'Nunito', sans-serif;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(255, 26, 68, 0.1);
}

.view-toggle:hover {
    background-color: #FF1A44;
    color: white;
    box-shadow: 0 4px 10px rgba(255, 26, 68, 0.2);
}

.view-toggle.active {
    background-color: #FF1A44;
    color: white;
}

.concept-controls {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

#fibonacci-graph {
    width: 600px;
    height: 600px;
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-left: 47px; /* Match grid position */
}

.times-tables {
    margin-top: 2rem;
}

.times-tables h2 {
    color: var(--color-gray-700);
    margin-bottom: 1rem;
    font-family: 'Nunito', sans-serif;
}

.table-buttons {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.table-button {
    padding: 0.5rem;
    border: 2px solid var(--color-gray-200);
    border-radius: var(--radius-md);
    background: white;
    color: var(--color-gray-700);
    font-family: 'Nunito', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
}

.table-button:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

#all-tables {
    grid-column: 1 / -1;
    background-color: #333;
    color: white;
    padding: 1rem;
    margin-top: 1rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

#all-tables:hover {
    background-color: #555;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.visualization-toggle {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

#show-fibonacci-spiral {
    background-color: var(--color-primary);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
}

#show-fibonacci-spiral:hover {
    background-color: var(--color-primary-dark);
    transform: translateY(-1px);
}

.visualization-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 1rem 0;
}

.view-button {
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--color-gray-300);  /* Light border for inactive state */
    border-radius: var(--radius-md);
    background-color: white;  /* White background for inactive state */
    color: var(--color-gray-700);
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.view-button:hover {
    background-color: var(--color-gray-100);  /* Light hover effect */
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.view-button.active {
    background-color: var(--color-primary);
    color: white;
    border: none;  /* Remove border for active state */
}

.graph-container, .spiral-container {
    display: none;
    width: 100%;
    height: 400px;
    background: white;
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius-md);
    margin-top: 1rem;
}

.square-image-container, .triangular-image-container {
    display: none;
    width: 100%;
    height: 400px;
    background: white;
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius-md);
    margin-top: 1rem;
}

.square-image-container img, .triangular-image-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.lazycaterer-image-container {
    display: none;
    width: 100%;
    height: 400px;
    background: white;
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius-md);
    margin-top: 1rem;
}

.lazycaterer-image-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.toggle-switch-container {
    margin-top: 40px;
    display: flex;
    justify-content: center;
}

.number-toggle {
    padding: 0 15px;
    height: 24px;
    background-color: white;
    border: 2px solid var(--color-primary);
    border-radius: 17px;
    color: var(--color-primary);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.4s;
}

.number-toggle.active {
    background-color: var(--color-primary);
    color: white;
}