/* Math Tables Styles - Optimized for Performance and SEO */

/* General Math Tables Sections */
.maths-tables-section {
    padding: 20px 0;
}

.section-title {
    color: #2c3e50;
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 10px;
    text-align: center;
}

.section-desc {
    color: #7f8c8d;
    font-size: 1.1rem;
    text-align: center;
    margin-bottom: 30px;
}

/* Live Site Design - Tables Grid Layout */
.tables-grid-layout {
    margin: 20px 0;
}

.multiplication-tables-grid {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.multiplication-tables-grid td {
    border: 1px solid #ddd;
    padding: 12px 15px;
    text-align: left;
    width: 33.33%;
}

.multiplication-tables-grid td a {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}

.multiplication-tables-grid td a:hover {
    text-decoration: underline;
    color: #0056b3;
}

/* Multiplication Chart Styles */
.multiplication-chart-container {
    margin: 30px 0;
    overflow-x: auto;
}

.multiplication-chart {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.multiplication-chart th,
.multiplication-chart td {
    border: 1px solid #ddd;
    padding: 8px 12px;
    text-align: center;
    font-size: 0.9rem;
}

.multiplication-chart th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

.multiplication-chart tbody th {
    background: #e9ecef;
    font-weight: 600;
}

.multiplication-chart tbody tr:nth-child(even) {
    background: #f8f9fa;
}

.multiplication-chart tbody tr:hover {
    background: #e3f2fd;
}

/* Related Tables Grid */
.related-tables-grid {
    margin: 30px 0;
}

.related-multiplication-tables {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.related-multiplication-tables td {
    border: 1px solid #ddd;
    padding: 12px 15px;
    text-align: left;
    width: 33.33%;
}

.related-multiplication-tables td a {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}

.related-multiplication-tables td a:hover {
    text-decoration: underline;
    color: #0056b3;
}

/* Content Sections - Light Theme */
.sec-containter h2 {
    color: #1a365d;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 30px 0 15px 0;
    border-bottom: 2px solid #4299e1;
    padding-bottom: 5px;
}

.sec-containter h3 {
    color: #2d3748;
    font-size: 1.3rem;
    font-weight: 600;
    margin: 25px 0 15px 0;
}

.sec-containter p {
    color: #4a5568;
    line-height: 1.6;
    margin: 15px 0;
    text-align: justify;
}

/* New Design: Popular Tables Section */
.popular-tables-section {
    margin: 30px 0;
}

.popular-tables-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.popular-table-card {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
}

.popular-table-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
    background: linear-gradient(135deg, #ebf8ff 0%, #bee3f8 100%);
}

.popular-table-card .table-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: #3182ce;
    margin-bottom: 15px;
}

.popular-table-card .table-preview {
    margin: 15px 0;
    font-size: 0.9rem;
    color: #4a5568;
}

.popular-table-card .preview-equation {
    margin: 5px 0;
}

.popular-table-card .preview-more {
    color: #718096;
    font-weight: 600;
    margin-top: 10px;
}

/* Difficulty Badges - Light Theme */
.difficulty-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin: 10px 0;
    text-transform: uppercase;
}

.difficulty-easy {
    background: linear-gradient(135deg, #c6f6d5 0%, #9ae6b4 100%);
    color: #22543d;
}

.difficulty-medium {
    background: linear-gradient(135deg, #fef5e7 0%, #fed7aa 100%);
    color: #c05621;
}

.difficulty-hard {
    background: linear-gradient(135deg, #fed7d7 0%, #feb2b2 100%);
    color: #c53030;
}

.difficulty-all {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e0 100%);
    color: #2d3748;
}

/* New Design: FAQ Section - Light Theme */
.faq-section {
    margin: 40px 0;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border-radius: 12px;
    padding: 30px;
}

.faq-container {
    margin-top: 20px;
}

.faq-item {
    /* background: rgba(255, 255, 255, 0.9); */
    border-radius: 8px;
    margin-bottom: 0;
    /* box-shadow: 0 2px 8px rgba(0,0,0,0.05); */
    /* overflow: hidden; */
    /* border: 1px solid rgba(255, 255, 255, 0.5); */
}

.faq-question {
    padding: 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.9);
    transition: background 0.3s ease;
}

.faq-question:hover {
    background: rgba(235, 248, 255, 0.8);
}

.faq-question h4 {
    margin: 0;
    color: #1a365d;
    font-size: 1.1rem;
    font-weight: 600;
}

.faq-toggle {
    font-size: 1.5rem;
    font-weight: 600;
    color: #3182ce;
    transition: transform 0.3s ease;
}

.faq-item.active .faq-toggle {
    transform: rotate(45deg);
}

.faq-answer {
    padding: 0 20px;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-item.active .faq-answer {
    padding: 0 20px 20px 20px;
    max-height: 200px;
}

.faq-answer p {
    margin: 0;
    color: #4a5568;
    line-height: 1.6;
}

/* Button Styles - Light Theme */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    text-align: center;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(66, 153, 225, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #3182ce 0%, #2c5282 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.4);
}

.btn-outline-primary {
    background: transparent;
    color: #3182ce;
    border: 1px solid #3182ce;
}

.btn-outline-primary:hover {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(66, 153, 225, 0.3);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.9rem;
}

.btn-range {
    width: 100%;
    margin-top: 15px;
}

/* Table Grid Layouts */
.tables-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

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

/* Range Cards - Light Theme */
.range-card {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    padding: 25px;
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
    text-align: center;
}

.range-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
    background: linear-gradient(135deg, #ebf8ff 0%, #bee3f8 100%);
}

.range-header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.range-icon {
    font-size: 2.5rem;
    margin-right: 15px;
    color: #3182ce;
}

.range-title {
    color: #1a365d;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.range-description {
    color: #4a5568;
    margin-bottom: 15px;
    line-height: 1.6;
}

.table-count {
    background: #bee3f8;
    color: #1a365d;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    display: inline-block;
    margin-bottom: 15px;
}

.btn-range {
    width: 100%;
    padding: 12px;
    font-weight: 500;
    border-radius: 8px;
}

/* Individual Table Display */
.table-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid #e8ecef;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f8f9fa;
}

.table-title {
    color: #2c3e50;
    font-size: 1.6rem;
    font-weight: 600;
    margin: 0;
}

.table-actions {
    display: flex;
    gap: 10px;
}

.copy-table,
.print-table {
    padding: 6px 12px;
    font-size: 0.85rem;
    border-radius: 6px;
}

/* Multiplication Table Display */
.multiplication-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.multiplication-table th,
.multiplication-table td {
    padding: 12px 15px;
    text-align: center;
    border: 1px solid #e9ecef;
    font-size: 1rem;
}

.multiplication-table th {
    background: #007bff;
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
}

.multiplication-table tr:nth-child(even) {
    background: #f8f9fa;
}

.multiplication-table tr:hover {
    background: #e3f2fd;
    cursor: pointer;
}

.multiplication-table td.number {
    font-weight: 600;
    color: #007bff;
}

.multiplication-table td.result {
    font-weight: 700;
    color: #28a745;
}

/* Compact Table View */
.compact-table {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.compact-table-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.compact-table-item:hover {
    background: #e3f2fd;
    transform: translateY(-2px);
}

.compact-table-item .number {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
    display: block;
    margin-bottom: 5px;
}

.compact-table-item .equation {
    font-size: 0.9rem;
    color: #6c757d;
}

/* Table Navigation */
.table-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.nav-button {
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-button.prev {
    background: #6c757d;
    color: white;
}

.nav-button.next {
    background: #007bff;
    color: white;
}

.nav-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.nav-button.disabled {
    background: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
    pointer-events: none;
}

/* Quick Access Section */
.quick-access-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    margin-top: 30px;
}

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

.quick-access-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    height: 100%;
}

.quick-access-card h4 {
    color: #2c3e50;
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.quick-access-card ul {
    list-style: none;
    padding: 0;
}

.quick-access-card li {
    margin: 8px 0;
}

.quick-access-card a {
    color: #007bff;
    text-decoration: none;
    font-size: 0.95rem;
}

.quick-access-card a:hover {
    text-decoration: underline;
}

/* Study Tips Section - Light Theme */
.study-tips-section {
    background: linear-gradient(135deg, #ebf8ff 0%, #bee3f8 100%);
    border-radius: 12px;
    padding: 25px;
    margin-top: 30px;
}

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

.tip-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.tip-card .tip-icon {
    font-size: 2rem;
    color: #3182ce;
    margin-bottom: 10px;
}

.tip-card h4 {
    color: #1a365d;
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.tip-card p {
    color: #4a5568;
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
}

/* Practice Section */
.practice-section {
    background: #fff3cd;
    border-radius: 12px;
    padding: 25px;
    margin-top: 30px;
}

.practice-quiz {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-top: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.quiz-question {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 15px;
}

.quiz-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.quiz-option {
    padding: 10px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quiz-option:hover {
    background: #e3f2fd;
    border-color: #007bff;
}

.quiz-option.correct {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.quiz-option.incorrect {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

/* Related Resources */
.resources-section {
    margin-top: 30px;
}

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

.resource-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 3px 12px rgba(0,0,0,0.08);
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    height: 100%;
}

.resource-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.resource-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: #007bff;
}

.resource-card h4 {
    color: #2c3e50;
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.resource-card p {
    color: #6c757d;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 15px;
}

/* Breadcrumb Enhancement */
.breadcrumb-tables {
    background: #f8f9fa;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.breadcrumb-tables a {
    color: #007bff;
    text-decoration: none;
}

.breadcrumb-tables a:hover {
    text-decoration: underline;
}

/* Search and Filter */
.table-search-section {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.search-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    margin-bottom: 15px;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-btn {
    padding: 8px 16px;
    border: 1px solid #e9ecef;
    background: #f8f9fa;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn.active,
.filter-btn:hover {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tables-grid,
    .range-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .section-title {
        font-size: 1.6rem;
    }
    
    .table-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .table-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .multiplication-table th,
    .multiplication-table td {
        padding: 8px 10px;
        font-size: 0.9rem;
    }
    
    .compact-table {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 10px;
    }
    
    .table-navigation {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav-button {
        width: 100%;
        text-align: center;
    }
    
    .tips-grid,
    .resources-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-buttons {
        justify-content: center;
    }
    
    /* Live Site Design - Mobile Responsive */
    .multiplication-tables-grid td,
    .related-multiplication-tables td {
        padding: 8px 10px;
        font-size: 0.9rem;
    }
    
    .multiplication-chart th,
    .multiplication-chart td {
        padding: 6px 8px;
        font-size: 0.8rem;
    }
    
    .sec-containter h2 {
        font-size: 1.3rem;
    }
    
    .sec-containter h3 {
        font-size: 1.1rem;
    }
    
    .multiplication-chart-container {
        overflow-x: scroll;
        -webkit-overflow-scrolling: touch;
    }
    
    /* New Design - Mobile Responsive */
    .popular-tables-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .popular-table-card {
        padding: 15px;
    }
    
    .popular-table-card .table-number {
        font-size: 2rem;
    }
    
    .tips-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .tip-card {
        padding: 15px;
    }
    
    .faq-section {
        padding: 20px;
    }
    
    .faq-question {
        padding: 15px;
    }
    
    .faq-question h4 {
        font-size: 1rem;
    }
    
    .btn-range {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .table-card,
    .range-card {
        padding: 15px;
    }
    
    .section-title {
        font-size: 1.4rem;
    }
    
    .range-icon {
        font-size: 2rem;
    }
    
    .multiplication-table th,
    .multiplication-table td {
        padding: 6px 8px;
        font-size: 0.85rem;
    }
    
    .compact-table {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
    
    .quiz-options {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Print Styles */
@media print {
    .table-actions,
    .copy-table,
    .print-table,
    .btn,
    .nav-button,
    .practice-section,
    .study-tips-section {
        display: none !important;
    }
    
    .table-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
        margin-bottom: 20px;
    }
    
    .multiplication-table {
        break-inside: avoid;
    }
    
    .section-title {
        color: #000 !important;
    }
    
    .multiplication-table th {
        background: #f0f0f0 !important;
        color: #000 !important;
    }
}

/* Performance Optimizations */
.tables-grid,
.range-grid,
.resources-grid {
    will-change: transform;
}

.range-card,
.table-card,
.resource-card {
    contain: layout style paint;
}

/* Accessibility Improvements */
.multiplication-table th {
    scope: col;
}

.multiplication-table tr th:first-child {
    scope: row;
}

.nav-button:focus,
.filter-btn:focus,
.quiz-option:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Loading States */
.table-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    color: #6c757d;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Single Table Specific Styles */
.multiplication-table tbody tr.highlighted {
    background-color: #fff3cd !important;
    border-left: 4px solid #ffc107;
}

.multiplication-table tbody tr {
    cursor: pointer;
    transition: all 0.3s ease;
}

.alert {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .table-card,
    .range-card,
    .resource-card {
        background: #fff;
        border-color: #4a5568;
        color: #000;
    }
    
    .multiplication-table th {
        background: #4a5568;
    }
    
    .multiplication-table tr:nth-child(even) {
        background: #2d3748;
    }
    
    .multiplication-table tr:hover {
        background: #4a5568;
    }
}
