body {
    font-family: 'Nata Sans', 'Tiro Bangla', serif;
    margin: 0;
    background-color: #f7f8fa;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
    padding-top: 20px;
    padding-bottom: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.banner {
    background-color: white;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
}

.banner-logo img {
    height: 110px;
}

.tagline {
    font-size: 0.6em;
    color: #111;
    margin: -5px 0 0 0;
    text-align: left;
    /* font-weight: bold; */
}

.banner-search form {
    display: flex;
}

.banner-search input {
    width: 300px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 20px 0 0 20px;
    outline: none;
}

.banner-search button {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-left: none;
    background-color: #f0f0f0;
    border-radius: 0 20px 20px 0;
    cursor: pointer;
}

.banner-auth {
    display: flex;
    align-items: center;
}

.btn {
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 20px;
    margin-left: 10px;
    font-weight: bold;
}

.btn-login {
    background-color: white;
    color: #1865f2;
    border: none;
    border-radius: 2px;
}

.btn-signup {
    background-color: #1865f2;
    color: white;
    border: none;
    border-radius: 2px;
}

.btn-logout {
    background-color: #f44336;
    color: white;
    border: none;
}

footer {
    padding: 20px;
    margin-top: 20px;
    background-color: #f0f0f0;
    display: flex;
    justify-content: flex-start;
    align-items: flex-end;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-left: 20%;
    width: 50%;
}

.footer-links a {
    text-decoration: none;
    color: #555;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #333;
}

.footer-payment {
    text-align: left;
    width: 50%;
}

.footer-payment .we-accept {
    color: #888;
}

.footer-payment i {
    margin-left: 10px;
    font-size: 1.05em;
    color: #666;
    vertical-align: middle;
}

.footer-payment .fab.fa-google-pay,
.footer-payment .fab.fa-apple-pay {
    font-size: 1.47em;
}

@media (max-width: 768px) {
    footer {
        flex-direction: column;
        gap: 20px;
        align-items: flex-start;
    }
    
    .footer-links {
        padding-left: 5%;
        width: 100%;
    }
    
    .footer-payment {
        text-align: left;
        padding-left: 5%;
        width: 100%;
    }
    
    .footer-payment i {
        margin-left: 9px;
    }
    
    .footer-payment i:first-of-type {
        margin-left: 0;
    }

    .breadcrumb-text {
        display: none;
    }

    .breadcrumb-container .breadcrumbs {
        font-size: 0.65em;
        padding-left: 0.5em;
    }

    .banner {
        flex-direction: column;
    }

    .banner-logo {
        margin-bottom: 15px;
    }

    .banner-search-auth-container {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }

    .banner-search {
        width: 40%;
    }

    .banner-search input {
        width: calc(100% - 45px);
    }

    .btn {
        font-size: 0.9em;
        padding: 8px 15px;
    }

    .header-image {
        max-width: 60px;
    }
    .header-text h1 {
        font-size: 1.2rem;
    }
}

@media (min-width: 769px) {
    .container {
        width: 80%;
        /*max-width: 1400px;*/
    }
    .banner-search-auth-container {
        display: contents;
    }
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 180px));
    gap: 20px;
    justify-content: center;
}

@media (min-width: 360px) and (max-width: 768px) {
    .grid-container {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.grid-item {
    background: #f9f9f9;
    border: 1px solid #ddd;
    padding: 20px;
    text-align: center;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    transition: transform 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.grid-item:hover {
    border-color: #bbb;
}

.book-item {
    text-decoration: none;
}

.book-item .book-cover {
    position: relative;
    width: 100%;
    padding-bottom: 141%; /* Aspect ratio for book covers */
}

.book-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
    text-decoration: none;
    color: #333;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.book-info {
    padding: 6px;
}

.book-name {
    font-weight: bold;
    margin: 0 0 2px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.82em;
    color: #333;
}

.book-subtitle {
    font-size: 0.7em;
    color: #777;
    margin: 0;
}

.page-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.header-image {
    max-width: 90px;
    margin-right: 15px;
}

.header-text h1 {
    margin: 0;
}

.header-text p {
    margin: 0;
}

.image-hint-container {
    margin-top: 10px;
}

.book-item .book-cover img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: opacity 0.3s;
}

.book-item .book-cover .color {
    opacity: 0;
}

.book-item:hover .book-cover .color {
    opacity: 1;
}

.book-item:hover .book-cover .grayscale {
    opacity: 0;
}

#timer {
    font-size: 1.5em;
    font-weight: bold;
    text-align: center;
    margin-bottom: 20px;
}

.mcq ul {
    list-style-type: none;
    padding: 0;
}

.mcq li {
    margin-bottom: 10px;
}

.correct {
    color: green;
}

.incorrect {
    color: red;
}

.mcq-options label.correct {
    color: green;
    font-weight: bold;
}

.mcq-options label.incorrect {
    color: red;
    text-decoration: line-through;
}

.profile-picture {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px;
    vertical-align: middle;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 2px solid transparent;
}

.profile-picture:hover {
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
    border-color: #667eea;
}

.breadcrumb-container {
    padding: 10px 20px;
    background-color: #f8f9fa;
}

.breadcrumbs {
    font-size: 0.9em;
    margin: 0 auto;
    max-width: 800px;
    padding-left: 1em;
}

.breadcrumbs a {
    text-decoration: none;
    color: #1865f2;
}

.breadcrumbs span {
    color: #555;
}

.chapter-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chapter-item {
    display: block;
    padding: 20px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    transition: transform 0.2s, box-shadow 0.2s;
}

.chapter-item:hover {
    border-color: #bbb;
}

.chapter-serial {
    font-weight: bold;
    margin-right: 10px;
    color: #1865f2;
}

.chapter-name {
    font-size: 1.1em;
}

.full-book-quiz-container {
    background-color: #f7f5f0;
    border: 1px solid #e0dccc;
    border-radius: 12px;
    padding: 25px;
    margin-top: 30px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.full-book-quiz-container h2 {
    font-family: 'Tiro Bangla', serif;
    font-size: 1.8em;
    color: #0056b3;
    margin-bottom: 20px;
}

.range-selector {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.range-selector label {
    font-size: 1.1em;
    color: #333;
    margin-bottom: 15px;
}

.range-selector input[type="range"] {
    width: 80%;
    max-width: 300px;
}

#questions-value {
    display: block;
    font-size: 1.5em;
    font-weight: bold;
    color: #0056b3;
    margin-top: 5px;
}

.start-quiz-btn {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 12px 25px;
    font-size: 1.1em;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}

.start-quiz-btn:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

.share-container {
    text-align: right;
    margin: 20px auto;
    max-width: 800px;
    padding: 0 20px;
}

.share-button {
    display: inline;
    align-items: center;
    justify-content: center;
    /* width: 75px; */
    /* height: 75px; */
    font-size: 1.6em;
    color: #ccc;
    transition: color 0.2s;
    vertical-align: middle;
    /* border-radius: 5px; */
    /* border: 1px solid #ccc; */
}

.share-button:hover {
    color: #1877f2;
}

/* Styles for intro_banner */
.quiz-steps-container {
    width: 100%; /* Default for smaller screens */
    margin: 20px auto; /* Center the container */
    /* padding: 20px; */
    background-color: #e0f7fa; /* Light blue background for playful feel */
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    text-align: center;
}

@media (min-width: 768px) {
    .quiz-steps-container {
        width: 98%; /* 80% width for desktop screens */
    }
}

.steps-title {
    color: #00796b; /* Dark teal color */
    margin-bottom: 25px;
    font-size: 1.8em;
    font-weight: bold;
}

.steps-row {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    gap: 15px;
}

.step-box {
    background-color: #ffffff;
    border: 2px solid #00796b;
    border-radius: 8px;
    padding: 15px 20px;
    text-align: center;
    flex: 1; /* Allow boxes to grow and shrink */
    min-width: 120px; /* Minimum width for step boxes */
    max-width: 180px; /* Maximum width for step boxes */
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.step-number {
    font-size: 2em;
    font-weight: bold;
    color: #00796b;
    margin-bottom: 5px;
}

.step-text {
    font-size: 0.9em;
    color: #333;
}

.arrow {
    font-size: 1.5em;
    color: #00796b;
    margin: 0 10px;
}

.final-instruction {
    margin-top: 30px;
    font-size: 1.1em;
    font-weight: bold;
    color: #004d40; /* Even darker teal */
}

/*
@media (max-width: 600px) {
    .steps-row {
        flex-direction: column;
    }
    .arrow {
        transform: rotate(90deg); 
        margin: 10px 0;
    }
}
*/

/* front large banner style */
        .quiz-steps-container {
            background: #f7f5f0;
            padding: 30px 20px; /* Reduced padding for 50% smaller height */
            font-family: 'Tiro Bangla', serif;
            overflow: hidden;
            position: relative;
        }
        
        .quiz-steps-container::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: url('data:image/svg+xml,<svg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><g fill="%23d4af9a" fill-opacity="0.03"><circle cx="30" cy="30" r="2"/></g></svg>') repeat;
            pointer-events: none;
        }

        .steps-wrapper {
            max-width: 1200px;
            margin: 0 auto;
            position: relative;
            z-index: 1;
        }

        .steps-title {
            text-align: center;
            color: #5d4037;
            font-size: 2.5rem;
            font-weight: 600;
            margin-bottom: 50px;
        }

        .steps-row {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 10px; /* Reduced gap for smaller screens */
            margin-bottom: 40px;
            flex-wrap: wrap; /* Allow wrapping if necessary, but aim for single row */
        }

        .step-box {
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(10px);
            border-radius: 20px;
            padding: 20px 15px; /* Reduced padding for smaller height */
            text-align: center;
            box-shadow: 0 15px 35px rgba(0,0,0,0.1), 0 5px 15px rgba(0,0,0,0.07);
            border: 1px solid rgba(255,255,255,0.2);
            position: relative;
            flex: 1;
            min-width: 100px; /* Adjusted min-width to fit in a row */
            max-width: 280px; /* Adjusted max-width */
            min-height: 80px; /* Adjusted min-height */
            display: flex;
            flex-direction: column; /* Ensure content stacks vertically within box */
            align-items: center;
            justify-content: center;
            transition: all 0.3s ease;
            transform: translateY(0);
        }

        .step-box:hover {
            transform: translateY(-8px);
            box-shadow: 0 25px 50px rgba(0,0,0,0.15), 0 10px 25px rgba(0,0,0,0.1);
        }

        .step-number {
            background: rgba(255, 255, 255, 0.9);
            color: #2d3748;
            width: 28px;
            height: 28px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            position: absolute;
            top: 12px;
            left: 12px;
            font-size: 0.9rem;
            font-weight: 600;
            border: 1px solid rgba(255,255,255,0.5);
            box-shadow: 0 1px 4px rgba(0,0,0,0.1);
        }

        .step-text {
            color: #2d3748;
            font-size: 1.6rem;
            font-weight: 600;
            line-height: 1.6;
            margin: 0;
            padding-top: 10px;
        }

        .arrow {
            color: #8d6e63;
            font-size: 3.5rem;
            opacity: 0.8;
            animation: pulse 2s ease-in-out infinite;
            flex-shrink: 0;
        }

        @keyframes pulse {
            0%, 100% { opacity: 0.6; transform: scale(1); }
            50% { opacity: 1; transform: scale(1.1); }
        }

.final-instruction {
    text-align: center;
    color: #5d4037;
    font-size: 1.6rem;
    font-weight: 500;
    line-height: 1.8;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    padding: 10px 30px;
    border-radius: 15px;
    border: 1px solid rgba(212, 175, 154, 0.3);
    max-width: 700px;
    margin: 0 auto;
}

/* Contact Form Specific Styles */
#contactForm .submit-button {
    width: auto;
    padding: 12px 24px;
    font-size: 1em;
    margin-top: 10px;
}

#contactForm .submit-button:hover {
    background-color: #1453cc;
    transform: none;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.form-feedback {
    margin-top: 10px;
    padding: 10px;
    border-radius: 4px;
    min-height: 1.2em; /* Reserve space for messages */
}

.form-feedback.success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
    font-size: 1.5em;
    text-align: center;
}

.form-feedback.error {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

hr {
    border: 0;
    height: 1px;
    background-color: #f0f0f0;
    margin: 30px 0;
}

        /* Mobile Responsiveness */
        @media (max-width: 768px) {
            .quiz-steps-container {
                padding: 20px 15px; /* Adjusted padding for smaller height */
            }
            
            .steps-title {
                font-size: 2rem;
                margin-bottom: 20px; /* Adjusted margin */
            }
            
            .steps-row {
                flex-wrap: wrap; /* Allow wrapping if needed, but aim for single row */
                gap: 8px; /* Further reduced gap for very small screens */
            }
            
            .step-box {
                padding: 15px 10px; /* Adjusted padding */
                min-width: 90px; /* Adjusted min-width to fit 3 in a row */
                max-width: 30%; /* Max width to encourage 3 per row */
                min-height: 70px; /* Adjusted min-height */
            }
            
            .step-number {
                width: 20px;
                height: 20px;
                font-size: 0.7rem;
                top: 8px;
                left: 8px;
            }
            
            .step-text {
                font-size: 0.8rem; /* Adjusted font size */
                line-height: 1.2;
            }
            
            .arrow {
                font-size: 2rem; /* Adjusted arrow size */
                margin: 0 5px; /* Adjusted margin */
                transform: none; /* Ensure arrows remain horizontal */
            }
            
            .final-instruction {
                font-size: 1rem; /* Adjusted font size */
                padding: 15px 20px; /* Adjusted padding */
            }
        }

        @media (max-width: 480px) {
            .quiz-steps-container {
                padding: 15px 10px;
            }
            .steps-title {
                font-size: 1.8rem;
            }
            .step-box {
                min-width: 80px;
                padding: 12px 8px;
                min-height: 60px;
            }
            .step-text {
                font-size: 0.75rem;
            }
            .arrow {
                font-size: 1.5rem;
            }
            .final-instruction {
                font-size: 0.9rem;
            }
        }

        @media (max-width: 360px) {
            .quiz-steps-container {
                padding: 10px 5px;
            }
            .steps-title {
                font-size: 1.5rem;
            }
            .step-box {
                min-width: 70px;
                padding: 10px 5px;
                min-height: 50px;
            }
            .step-text {
                font-size: 0.7rem;
            }
            .arrow {
                font-size: 1.2rem;
            }
            .final-instruction {
                font-size: 0.8rem;
            }
        }

        /* Accessibility */
        @media (prefers-reduced-motion: reduce) {
            .arrow {
                animation: none;
            }
            
            .step-box {
                transition: none;
            }
            
            .step-box:hover {
                transform: none;
            }
        }

.create-question-section {
    text-align: center;
    padding: 40px 20px;
    /*background-color: #f0f7ff;*/
}

.btn-create-question {
    display: inline-block;
    padding: 15px 30px;
    font-size: 1.2em;
    font-weight: bold;
    color: #fff;
    background-color: #007bff;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    transition: background-color 0.3s, transform 0.2s;
}

.btn-create-question:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

/* Create Page Styles */
.create-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.upload-section {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    text-align: center;
}

.upload-section h2 {
    margin-top: 0;
    color: #333;
}

.upload-box {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 40px;
    margin-top: 20px;
    position: relative;
    transition: background-color 0.2s;
}

.upload-box.dragover {
    background-color: #f0f7ff;
}

.upload-box input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

.upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #888;
}

.upload-label i {
    font-size: 3em;
    margin-bottom: 10px;
    color: #007bff;
}

.btn-upload {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 12px 25px;
    font-size: 1.1em;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-top: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 200px;
}

.btn-upload:hover {
    background-color: #0056b3;
}

.btn-upload .spinner {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.editor-section {
    display: flex;
    gap: 20px;
}

.sidebar {
    width: 25%;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.sidebar h3 {
    margin-top: 0;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.main-editor {
    width: 75%;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.placeholder-text {
    color: #888;
    text-align: center;
    padding: 40px 0;
}

.chapter-controls .form-check {
    margin-bottom: 10px;
}

.chapter-list {
    padding-right: 10px;
}

.btn-generate {
    width: 100%;
    background-color: #28a745;
    color: white;
    border: none;
    padding: 10px;
    font-size: 1em;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-generate:hover {
    background-color: #218838;
}

#editor-area {
    border: 1px solid #ddd;
    border-radius: 8px;
}

#editor {
    min-height: 500px;
}

.editor-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

.btn-action {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
}

.btn-action.btn-danger {
    background-color: #dc3545;
}

.btn-action.btn-secondary {
    background-color: #007bff;
}

.grecaptcha-badge {
    visibility: visible !important;
}

/* Subject Card Styles with Overlay */
.subject-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
    text-decoration: none;
    color: #333;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    transition: transform 0.2s, box-shadow 0.3s;
}

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

.subject-image-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.07%; /* 157/280 = 0.5607 aspect ratio */
    overflow: hidden;
}

.subject-image-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.subject-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.3) 70%, transparent 100%);
    padding: 12px 10px 10px;
    color: white;
}

.subject-overlay .subject-title {
    font-weight: bold;
    margin: 0;
    font-size: 0.95em;
    line-height: 1.3;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.subject-overlay .subject-subtitle {
    font-size: 0.8em;
    margin: 4px 0 0 0;
    opacity: 0.95;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

/* Grid container for subject cards */
.subject-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 280px));
    gap: 20px;
    justify-content: center;
}

@media (min-width: 360px) and (max-width: 768px) {
    .subject-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }
}
