/**
 * Join Quiz Page Styles
 * Grid-based card layout for quiz listings
 */

/* Main Container */
.nammashale-quiz-join-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
}

.nammashale-quiz-join-page h2 {
    font-size: 32px; /* 2x larger (was 32px) */
    font-family: 'Times New Roman', Times, serif;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 30px;
    text-align: center;
}

/* Quiz Filters */
.quiz-filters {
    display: flex;
    justify-content: center;
    gap: 1px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.quiz-filter-select {
    padding: 2px 6px;
    font-size: 25px; 
    font-family: 'Times New Roman', Times, serif;
    border: 1px solid #141313;
    border-radius: 8px;
    background-color: #fff;
    color: #1d1515;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
}

.quiz-filter-select:hover {
    border-color: #3498db;
}

.quiz-filter-select:focus {
    outline: none;
    border-color: #2980b9;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Quiz Search Container */
.quiz-search-container {
    display: flex;
    gap: 10px;
    align-items: center;
    flex: 1;
    max-width: 600px;
}

.quiz-search-input {
    flex: 1;
    padding: 12px 20px;
    font-size: 25px; 
    font-family: 'Times New Roman', Times, serif;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background-color: #fff;
    color: #333;
    transition: all 0.1s ease;
}

.quiz-search-input:focus {
    outline: none;
    border-color: #2980b9;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.quiz-search-input::placeholder {
    color: #7c7f7f;
    font-size: 28px;
}

.quiz-clear-search-btn {
    padding: 12px 20px;
    font-size: 25px; 
    font-family: 'Times New Roman', Times, serif;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    background-color: #ee1f08;
    color: #ffffff;
}

.quiz-clear-search-btn:hover {
    background-color: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.quiz-clear-search-btn .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* Quiz Code Section */
.quiz-code-section {
    background: linear-gradient(135deg, #fef107c6 0%, #f11905 100%);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(102, 234, 131, 0.3);
}

.quiz-code-container {
    max-width: 200px;
    margin: 0 auto;
}

.quiz-code-header h3 {
    color: #ffffff;
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 8px 0;
    text-align: center;
}

.quiz-code-header p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    margin: 0 0 20px 0;
    text-align: center;
}

.quiz-code-input-group {
    display: flex;
    gap: 12px;
    align-items: center;
}

.quiz-code-input {
    flex: 1;
    padding: 14px 20px;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.95);
    color: #2c3e50;
    transition: all 0.3s ease;
    text-align: center;
}

.quiz-code-input::placeholder {
    letter-spacing: normal;
    text-transform: none;
    font-weight: 400;
    font-size: 14px;
}

.quiz-code-input:focus {
    outline: none;
    border-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.2);
    background-color: #ffffff;
}

.join-by-code-btn {
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
    color: #667eea;
    background-color: #ffffff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.join-by-code-btn:hover {
    background-color: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.join-by-code-btn:active {
    transform: translateY(0);
}

.join-by-code-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.quiz-code-message {
    margin-top: 12px;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px; 
    font-weight: 500;
    text-align: center;
    display: none;
}

.quiz-code-message.success {
    display: block;
    background-color: rgba(46, 204, 113, 0.2);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.quiz-code-message.error {
    display: block;
    background-color: rgba(231, 76, 60, 0.2);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.quiz-code-message.loading {
    display: block;
    background-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Section Divider */
.section-divider {
    position: relative;
    text-align: center;
    margin: 40px 0;
}

.section-divider::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, #e0e0e0, transparent);
}

.divider-text {
    position: relative;
    display: inline-block;
    padding: 0 20px;
    background-color: #ffffff;
    color: #7f8c8d;
    font-size: 28px; /* 2x larger (was 14px) */
    font-family: 'Times New Roman', Times, serif;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Quiz Grid Layout */
.quiz-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 columns for desktop/laptop */
    gap: 20px;
    margin-top: 10px;
    width: 330%;
}

/* Quiz Card */
.quiz-card {
    background: #ffffff;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(246, 7, 7, 0.952);
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    border: 1px solid #e8e8e8;
}

.quiz-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
    border-color: #09e51f;
}

/* Category Color Backgrounds - 12 Distinct Colors */
.quiz-card.category-color-0 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); /* Purple/Violet */
    color: #ffffff;
}

.quiz-card.category-color-1 {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); /* Pink/Red */
    color: #ffffff;
}

.quiz-card.category-color-2 {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); /* Blue/Cyan */
    color: #ffffff;
}

.quiz-card.category-color-3 {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); /* Green/Turquoise */
    color: #ffffff;
}

.quiz-card.category-color-4 {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); /* Pink/Yellow */
    color: #2c3e50;
}

.quiz-card.category-color-5 {
    background: linear-gradient(135deg, #30cfd0 0%, #330867 100%); /* Cyan/Deep Purple */
    color: #ffffff;
}

.quiz-card.category-color-6 {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%); /* Light Cyan/Pink */
    color: #2c3e50;
}

.quiz-card.category-color-7 {
    background: linear-gradient(135deg, #ff9a56 0%, #ff6a88 100%); /* Orange/Pink */
    color: #ffffff;
}

.quiz-card.category-color-8 {
    background: linear-gradient(135deg, #fbc2eb 0%, #a6c1ee 100%); /* Pink/Blue */
    color: #2c3e50;
}

.quiz-card.category-color-9 {
    background: linear-gradient(135deg, #fdcbf1 0%, #e6dee9 100%); /* Light Pink/Lavender */
    color: #2c3e50;
}

.quiz-card.category-color-10 {
    background: linear-gradient(135deg, #a1c4fd 0%, #c2e9fb 100%); /* Sky Blue */
    color: #2c3e50;
}

.quiz-card.category-color-11 {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%); /* Peach/Coral */
    color: #2c3e50;
}

/* Update text colors for colored cards */
.quiz-card[class*="category-color-"] .quiz-card-title a,
.quiz-card[class*="category-color-"] .quiz-card-description,
.quiz-card[class*="category-color-"] .quiz-meta-item {
    color: inherit;
}

.quiz-card[class*="category-color-"] .quiz-card-title a:hover {
    opacity: 0.8;
}

/* Adjust tags for colored backgrounds */
.quiz-card[class*="category-color-"] .quiz-category-tag,
.quiz-card[class*="category-color-"] .quiz-code-tag {
    background: rgba(255, 255, 255, 0.3);
    color: inherit;
    backdrop-filter: blur(10px);
}

.quiz-card[class*="category-color-"] .quiz-start-btn {
    background: rgba(255, 255, 255, 0.95);
    color: #2c3e50;
}

.quiz-card[class*="category-color-"] .quiz-start-btn:hover {
    background: #ffffff;
    color: #667eea;
}

/* Thumbnail Section */
.quiz-card-thumbnail {
    position: relative;
    width: 100%;
    height: 80px; /* 4x smaller (was 200px) */
    overflow: hidden;
    background: linear-gradient(135deg, #d3e50d 0%, #cb2204 100%);
}

.quiz-card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 1;
}

.quiz-card-thumbnail.no-thumbnail img {
    object-fit: contain;
    padding: 10px;
}

/* QR code style for quiz card thumbnail */
.quiz-card-thumbnail.quiz-card-qr {
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100px;
}

.quiz-card-thumbnail.quiz-card-qr img {
    width: 90px;
    height: 90px;
    object-fit: contain;
}

.quiz-card:hover .quiz-card-thumbnail img {
    transform: scale(1.1);
}

/* Image loading state */
.quiz-card-thumbnail img[loading="lazy"] {
    opacity: 0;
    animation: fadeIn 0.3s ease-in forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* Difficulty Badge */
.quiz-difficulty {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 24px; /* 2x larger (was 12px) */
    font-family: 'Times New Roman', Times, serif;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.quiz-difficulty-easy {
    background: #2ecc71;
    color: #fff;
}

.quiz-difficulty-medium {
    background: #f39c12;
    color: #fff;
}

.quiz-difficulty-hard {
    background: #e74c3c;
    color: #fff;
}

/* Card Content */
.quiz-card-content {
    padding: 3px; /* 4x smaller (was 20px) */
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.quiz-card-title {
    margin: 0 0 1px 0; /* Reduced */
    font-size: 30px; 
    font-family: 'Times New Roman', Times, serif;
    font-weight: 600;
    line-height: 1.4;
}

.quiz-card-title a {
    color: #151f29;
    text-decoration: none;
    transition: color 0.2s ease;
}

.quiz-card-title a:hover {
    color: #3498db;
}

.quiz-card-description {
    color: #7f8c8d;
    font-size: 20px; /* 2x larger (was 14px) */
    font-family: 'Times New Roman', Times, serif;
    line-height: 1.6;
    margin: 0 0 4px 0; /* Reduced */
    flex-grow: 1;
}

/* Quiz Meta Information */
.quiz-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 5px; /* Reduced */
    padding-top: 4px; /* Reduced */
    border-top: 1px solid #ecf0f1;
}

.quiz-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 26px; /* 2x larger (was 13px) */
    font-family: 'Times New Roman', Times, serif;
    color: #7f8c8d;
    font-weight: 500;
}

.quiz-meta-item .dashicons {
    font-size: 20px; /* 2x larger (was 16px) */
    width: 20px;
    height: 20px;
    color: #95a5a6;
}

.quiz-category-tag {
    background: #ecf0f1;
    padding: 4px 10px;
    border-radius: 12px;
    color: #2c3e50;
    font-size: 26px; /* 2x larger */
    font-family: 'Times New Roman', Times, serif;
}

.quiz-code-tag {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 4px 10px;
    border-radius: 12px;
    color: #ffffff;
    font-weight: 600;
    letter-spacing: 0.5px;
    font-size: 26px; /* 2x larger */
    font-family: 'Times New Roman', Times, serif;
}

/* Card Actions */
.quiz-card-actions {
    display: flex;
    gap: 10px;
}

.quiz-start-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    font-weight: 600;
    font-size: 30px; /* 2x larger (was 15px) */
    font-family: 'Times New Roman', Times, serif;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.quiz-start-btn:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.quiz-start-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* No Quizzes Message */
.no-quizzes-message {
    text-align: center;
    padding: 80px 20px;
}

.no-quizzes-text {
    font-size: 48px; /* 2x larger (was 24px) */
    font-family: 'Times New Roman', Times, serif;
    color: #aa0c0c;
    margin-bottom: 12px;
    font-weight: 600;
}

.no-quizzes-subtext {
    font-size: 25px; /* 2x larger (was 16px) */
    font-family: 'Times New Roman', Times, serif;
    color: #0e0f10;
    margin: 0;
}

/* Loading State */
.quiz-list-loading {
    text-align: center;
    padding: 60px 20px;
}

.quiz-list-loading::before {
    content: "";
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive Design */

/* Large Tablet - 3 columns (1024px to 1200px) */
@media (max-width: 1200px) {
    .quiz-grid {
        grid-template-columns: repeat(3, 1fr); /* Keep 3 columns for large tablets */
        gap: 24px;
    }
}

/* Medium Tablet - 2 columns (768px to 1024px) */
@media (max-width: 1024px) {
    .quiz-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 columns for medium tablets */
        gap: 24px;
    }
}

/* Small Tablet - 1 column (below 900px) */
@media (max-width: 900px) {
    .quiz-grid {
        grid-template-columns: 1fr; /* 1 column for smaller tablets */
        gap: 24px;
    }
}

/* Mobile - 1 column (below 768px) */
@media (max-width: 768px) {
    .nammashale-quiz-join-page {
        padding: 20px 15px;
    }

    .nammashale-quiz-join-page h2 {
        font-size: 52px; /* 2x larger (was 26px) */
        font-family: 'Times New Roman', Times, serif;
        margin-bottom: 20px;
    }

    .quiz-grid {
        grid-template-columns: 1fr; /* 1 column for mobile */
        gap: 20px;
    }

    .quiz-card-thumbnail {
        height: 45px; /* 4x smaller */
    }

    .quiz-filters {
        flex-direction: column;
        gap: 10px;
    }

    .quiz-filter-select,
    .quiz-code-input {
        width: 100%;
        min-width: auto;
    }

    .quiz-search-container {
        flex-direction: row; /* Keep horizontal */
        max-width: 100%;
        width: 100%;
    }

    .quiz-search-input,
    .quiz-clear-search-btn {
        width: 100%;
    }
}

/* Small Mobile - Adjustments for very small screens */
@media (max-width: 480px) {
    .nammashale-quiz-join-page {
        padding: 15px 10px;
    }

    .quiz-grid {
        gap: 16px;
    }

    .quiz-card-title {
        font-size: 36px; /* 2x larger (was 18px) */
        font-family: 'Times New Roman', Times, serif;
    }

    .quiz-card-content {
        padding: 4px; /* 4x smaller (was 16px) */
    }

    .quiz-card-thumbnail {
        height: 40px; /* 4x smaller (was 160px) */
    }

    .quiz-start-btn {
        padding: 10px 20px;
        font-size: 28px; /* 2x larger (was 14px) */
        font-family: 'Times New Roman', Times, serif;
    }
}

/* Animation for card entrance */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.quiz-card {
    animation: fadeInUp 0.5s ease-out;
}

.quiz-card:nth-child(1) { animation-delay: 0.05s; }
.quiz-card:nth-child(2) { animation-delay: 0.1s; }
.quiz-card:nth-child(3) { animation-delay: 0.15s; }
.quiz-card:nth-child(4) { animation-delay: 0.2s; }
.quiz-card:nth-child(5) { animation-delay: 0.25s; }
.quiz-card:nth-child(6) { animation-delay: 0.3s; }

/* Filter Active State */
.quiz-card.hidden {
    display: none;
}

.quiz-card.visible {
    display: flex;
}
