/* Updated style.css */

:root {
    --primary-color: #4CAF50; /* Green */
    --secondary-color: #FFC107; /* Amber */
    --accent-color: #2196F3; /* Blue */
    --text-color: #333;
    --light-bg: #f8f8f8;
    --white: #fff;
    --border-color: #ddd;
    --shadow: 0 4px 6px rgba(0,0,0,0.1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: var(--light-bg);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background-color: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow);
    flex-grow: 1;
}

header {
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--accent-color) 100%);
    color: var(--white);
    padding: 1rem 0;
    box-shadow: var(--shadow);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    margin: 0 auto;
    max-width: 1200px;
    background-color: transparent;
    box-shadow: none;
}

header h1 {
    margin: 0;
    font-size: 1.8em;
}

header h1 a {
    color: var(--white);
    text-decoration: none;
    transition: color 0.3s ease;
}

header h1 a:hover {
    color: var(--secondary-color);
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

nav ul li {
    margin-left: 20px;
}

nav ul li a {
    color: var(--white);
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

nav ul li a:hover {
    color: var(--secondary-color);
}

.hero {
    background: linear-gradient(45deg, var(--accent-color) 0%, #0d6efd 100%);
    color: var(--white);
    text-align: center;
    padding: 60px 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.hero h2 {
    font-size: 3em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero p {
    font-size: 1.4em;
    margin-bottom: 30px;
    font-weight: 300;
}

.btn {
    display: inline-block;
    background-color: var(--secondary-color);
    color: var(--white);
    padding: 12px 25px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.btn:hover {
    background-color: #FFB300;
    transform: translateY(-2px);
}

.features, .content-section {
    padding: 20px 0;
}

.features h2, .content-section h2 {
    text-align: center;
    margin-bottom: 30px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

.feature-item {
    background-color: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.feature-item .icon {
    font-size: 3em;
    color: var(--accent-color);
    margin-bottom: 15px;
}

.feature-item h3 {
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 10px;
}

.blog-posts-home {
    padding: 40px 0;
    background-color: var(--light-bg);
    border-radius: 8px;
}

.blog-posts-home h2 {
    text-align: center;
    margin-bottom: 30px;
}

.blog-posts-home .post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.blog-post-card {
    background-color: var(--white);
    border-radius: 10px;
    box-shadow: var(--shadow);
    padding: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blog-post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.blog-post-card h3 a {
    color: var(--accent-color);
    text-decoration: none;
    font-size: 1.3em;
}

.blog-post-card h3 a:hover {
    text-decoration: underline;
}

h2, h3 {
    color: var(--primary-color);
    margin-top: 25px;
    margin-bottom: 15px;
}

p {
    margin-bottom: 1em;
}

ul {
    margin-bottom: 1em;
    padding-left: 20px;
}

ul li {
    margin-bottom: 0.5em;
}

a {
    color: var(--accent-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

footer {
    background-color: var(--text-color);
    color: var(--white);
    text-align: center;
    padding: 1rem 0;
    margin-top: 30px;
}

footer .container {
    padding: 0 20px;
    margin: 0 auto;
    max-width: 1200px;
    background-color: transparent;
    box-shadow: none;
}

footer p {
    margin: 0;
    font-size: 0.9em;
}

footer nav ul {
    justify-content: center;
    margin-top: 10px;
}

footer nav ul li {
    margin: 0 10px;
}

footer nav ul li a {
    color: var(--white);
    font-weight: normal;
    font-size: 0.9em;
}

/* Specific Styles for Printable Pages and others... */
/* ... (the rest of your styles stay the same) ... */
/* Table styles for charts.html */
.multiplication-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    font-size: 1.1em;
}

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

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

.multiplication-table td {
    background-color: var(--white);
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.multiplication-table td:hover {
    background-color: var(--light-bg);
    transform: scale(1.02);
}

.multiplication-table td.active {
    background-color: var(--secondary-color);
    color: var(--white);
    font-weight: bold;
}

.table-controls {
    margin-bottom: 20px;
    display: flex;
    gap: 15px;
    align-items: center;
}

.table-controls label {
    font-weight: bold;
}

.table-controls select,
.table-controls button {
    padding: 8px 15px;
    border-radius: 5px;
    border: 1px solid var(--border-color);
    font-size: 1em;
    cursor: pointer;
}

.table-controls button {
    background-color: var(--accent-color);
    color: var(--white);
    border-color: var(--accent-color);
    transition: background-color 0.3s ease;
}

.table-controls button:hover {
    background-color: #1976D2;
}

/* Print Button Styling */
.print-button-container {
    text-align: center;
    margin: 20px 0;
}

.print-button {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1em;
    transition: background-color 0.3s ease;
}

.print-button:hover {
    background-color: #45a049;
}

/* Worksheet Specific Styles */
.worksheet-problems {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.problem-item {
    border: 1px solid var(--border-color);
    padding: 15px;
    border-radius: 8px;
    background-color: var(--light-bg);
    font-size: 1.1em;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.problem-item span {
    font-weight: bold;
}

.problem-item input {
    width: 60px;
    padding: 5px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    text-align: center;
}

.answer-key {
    margin-top: 40px;
    border-top: 2px dashed var(--primary-color);
    padding-top: 20px;
}

.answer-key h3 {
    color: var(--accent-color);
}

.answer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

.answer-item {
    font-size: 1em;
    padding: 5px;
    background-color: #e0f2f7; /* Light blue */
    border-radius: 4px;
    border: 1px solid #b3e5fc;
}

/* Flashcard Specific Styles */
.flashcard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
    justify-content: center;
}

.flashcard {
    border: 2px solid var(--primary-color);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    font-size: 1.8em;
    font-weight: bold;
    height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: var(--white);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden; /* For the cut lines */
}

.flashcard-cut-line {
    border: 1px dashed #999;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Make sure it doesn't interfere with content */
}

/* Print Specific Styles */
@media print {
    body {
        background-color: #fff;
        color: #000;
        margin: 0;
        padding: 0;
    }

    .container {
        box-shadow: none;
        border-radius: 0;
        margin: 0;
        padding: 0;
        max-width: none;
        width: 100%;
    }

    header, footer, nav, .hero, .features, .table-controls, .print-button-container, .blog-post-summary .btn, .contact-form button {
        display: none !important; /* Hide elements not needed for print */
    }

    h2, h3, p, ul, ol, table {
        color: #000 !important; /* Ensure black text for printing */
    }

    .multiplication-table th,
    .multiplication-table td {
        border: 1px solid #000 !important; /* Darker borders for print */
        background-color: #fff !important; /* White background for print */
        color: #000 !important;
        padding: 8px !important;
        font-size: 1em !important;
    }

    .flashcard {
        border: 1px solid #000 !important; /* Solid border for cutting */
        box-shadow: none !important;
        background-color: #fff !important;
        page-break-inside: avoid; /* Avoid breaking flashcards across pages */
        font-size: 1.5em !important; /* Slightly smaller for print */
    }

    .flashcard-cut-line {
        border: 1px dashed #999 !important; /* Ensure cut lines are visible */
    }

    .worksheet-problems, .answer-grid {
        grid-template-columns: repeat(3, 1fr) !important; /* Adjust columns for print */
        gap: 10px !important;
    }

    .problem-item {
        border: 1px solid #000 !important;
        background-color: #fff !important;
        padding: 10px !important;
        font-size: 1em !important;
    }

    .problem-item input {
        border: 1px solid #000 !important;
        background-color: #fff !important;
    }

    .answer-key {
        border-top: 1px dashed #000 !important; /* Darker dashed line */
        page-break-before: always; /* Start answer key on new page */
    }

    a {
        text-decoration: none !important; /* No underlines for print links */
        color: #000 !important; /* Black links for print */
    }
}


/* Media Queries for Responsiveness */
@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        text-align: center;
    }

    nav ul {
        margin-top: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }

    nav ul li {
        margin: 5px 10px;
    }

    .hero h2 {
        font-size: 2em;
    }

    .hero p {
        font-size: 1em;
    }

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

    .container {
        margin: 10px;
        padding: 15px;
    }

    .flashcard-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }

    .flashcard {
        font-size: 1.5em;
        height: 100px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5em;
    }

    .btn {
        padding: 10px 20px;
        font-size: 0.9em;
    }

    .multiplication-table th,
    .multiplication-table td {
        padding: 8px;
        font-size: 0.9em;
    }
    .table-controls {
        flex-direction: column;
        align-items: flex-start;
    }

    .worksheet-problems, .answer-grid {
        grid-template-columns: 1fr;
    }
}