/* ===========================
   Black History Word Search CSS
   ========================== */

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

body {
    font-family: 'Fredoka', 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: #333;
    min-height: 100vh;
    padding: 0;
    margin: 0;
    touch-action: manipulation;
}

/* ===========================
   Hero Backdrop Section
   ========================== */
.hero-backdrop {
    position: relative;
    width: 100%;
    height: 400px;
    overflow: hidden;
    margin-bottom: 30px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.5);
}

.backdrop-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    animation: subtleZoom 20s ease-in-out infinite alternate;
}

@keyframes subtleZoom {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(1.05);
    }
}

.backdrop-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.6) 100%);
    pointer-events: none;
}

header {
    text-align: center;
    margin-bottom: 20px;
    padding: 0 20px;
    color: #f4f4f4;
    position: relative;
    z-index: 10;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #ceae3b;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    margin-bottom: 10px;
    line-height: 1.3;
}

.cursive-text {
    font-family: 'Dancing Script', cursive;
    font-weight: 700;
    font-size: 3rem;
    display: block;
    color: #ceae3b;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.5);
    margin-bottom: 5px;
    letter-spacing: 2px;
}

.subtitle {
    font-size: 1.1rem;
    color: #e0e0e0;
    font-weight: 400;
}

/* ===========================
   Daily Fact Section
   ========================== */
.fact-of-the-day {
    background: #fff3cd;
    border-left: 5px solid #ceae3b;
    padding: 15px 20px;
    margin: 20px 20px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    border-radius: 8px;
    text-align: left;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.fact-label {
    font-weight: 700;
    color: #856404;
    display: block;
    margin-bottom: 8px;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

#dailyFact {
    margin: 0;
    color: #333;
    line-height: 1.6;
    font-size: 1rem;
}

/* ===========================
   Tab Navigation
   ========================== */
.tab-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 30px auto 20px;
    max-width: 600px;
}

.tab-btn {
    padding: 12px 30px;
    border: 3px solid #ceae3b;
    background: white;
    color: #333;
    cursor: pointer;
    font-weight: 700;
    font-size: 1rem;
    border-radius: 25px;
    transition: all 0.3s ease;
    font-family: 'Fredoka', sans-serif;
}

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

.tab-btn.active {
    background: #ceae3b;
    color: white;
    box-shadow: 0 4px 12px rgba(206, 174, 59, 0.4);
}

/* ===========================
   Main Content Layout
   ========================== */
.main-content {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin: 30px auto;
    max-width: 1400px;
    flex-wrap: wrap;
}

/* ===========================
   Game Section
   ========================== */
.game-section {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.score-display {
    font-size: 1.2rem;
    font-weight: 700;
    color: #333;
}

.button-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.reset-btn, .share-btn, .play-again-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Fredoka', sans-serif;
    font-size: 0.95rem;
}

.reset-btn {
    background-color: #2196f3;
    color: white;
}

.reset-btn:hover {
    background-color: #1976d2;
    transform: scale(1.05);
}

.share-btn {
    background-color: #2e7d32;
    color: white;
}

.share-btn:hover {
    background-color: #1b5e20;
    transform: scale(1.05);
}

.play-again-btn {
    background-color: #ceae3b;
    color: white;
}

.play-again-btn:hover {
    background-color: #b8992f;
    transform: scale(1.05);
}

/* ===========================
   Word Grid
   ========================== */
.grid-container {
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

.word-grid {
    display: grid;
    grid-template-columns: repeat(15, 40px);
    gap: 3px;
    background-color: #e0e0e0;
    padding: 10px;
    border-radius: 8px;
    margin: 0 auto;
    width: fit-content;
}

.grid-cell {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    background: white;
    border: 1px solid #ddd;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.15s ease;
    text-transform: uppercase;
    color: #333;
}

.grid-cell:hover {
    background-color: #f5f5f5;
}

.grid-cell.selected {
    background-color: #ffeb3b !important;
    transform: scale(1.08);
    z-index: 10;
    box-shadow: 0 2px 8px rgba(255, 235, 59, 0.6);
}

.grid-cell.found {
    background-color: #4caf50 !important;
    color: white;
    font-weight: 700;
}

/* ===========================
   Word List Section
   ========================== */
.word-list-section {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    min-width: 250px;
}

.word-list-section h3 {
    color: #ceae3b;
    margin-bottom: 15px;
    font-size: 1.3rem;
    border-bottom: 3px solid #ceae3b;
    padding-bottom: 10px;
}

.word-list {
    list-style: none;
    padding: 0;
}

.word-list li {
    padding: 10px 15px;
    margin-bottom: 8px;
    background: #f8f8f8;
    border-radius: 6px;
    font-weight: 600;
    font-size: 1rem;
    color: #333;
    border-left: 4px solid #ceae3b;
    transition: all 0.3s ease;
}

.word-list li:hover {
    background: #fff3cd;
}

.word-list li.found {
    text-decoration: line-through;
    color: #888;
    font-style: italic;
    background: #e8f5e9;
    border-left-color: #4caf50;
}

/* ===========================
   Info Section
   ========================== */
.info-section {
    max-width: 1200px;
    margin: 40px auto;
    padding: 30px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    touch-action: auto;
}

.info-section h2 {
    text-align: center;
    color: #ceae3b;
    margin-bottom: 25px;
    font-size: 2rem;
}

.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    max-height: 600px;
    overflow-y: auto;
    padding-right: 10px;
}

.info-card {
    background: #f8f8f8;
    padding: 20px;
    border-radius: 8px;
    border-left: 5px solid #ceae3b;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

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

.info-card h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.info-card p {
    color: #555;
    line-height: 1.6;
    font-size: 0.95rem;
}

.info-card.hidden {
    display: none;
}

/* Custom scrollbar */
.info-cards::-webkit-scrollbar {
    width: 8px;
}

.info-cards::-webkit-scrollbar-thumb {
    background: #ceae3b;
    border-radius: 10px;
}

.info-cards::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 10px;
}

/* ===========================
   Victory Modal
   ========================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 16px;
    text-align: center;
    max-width: 500px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
    animation: slideIn 0.4s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-content h2 {
    color: #ceae3b;
    font-size: 2rem;
    margin-bottom: 15px;
}

.modal-content p {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 25px;
}

.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===========================
   Lightbox for Gallery Images
   ========================== */
.lightbox {
    display: none;
    position: fixed;
    z-index: 2000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

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

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.8);
    transition: opacity 0.2s ease;
}

.lightbox-caption {
    color: white;
    text-align: center;
    padding: 20px;
    font-size: 1.2rem;
    max-width: 600px;
    background: rgba(0,0,0,0.7);
    border-radius: 8px;
    margin-top: 20px;
}

.lightbox-caption strong {
    color: #ceae3b;
    font-size: 1.4rem;
    display: block;
    margin-bottom: 8px;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 40px;
    font-size: 50px;
    font-weight: 300;
    color: white;
    cursor: pointer;
    transition: color 0.3s ease;
    z-index: 2001;
    line-height: 1;
}

.lightbox-close:hover {
    color: #ceae3b;
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(206, 174, 59, 0.8);
    color: white;
    border: none;
    font-size: 30px;
    padding: 20px 15px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
    z-index: 2001;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background-color: rgba(206, 174, 59, 1);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

/* Mobile responsiveness for lightbox */
@media (max-width: 768px) {
    .lightbox-close {
        top: 10px;
        right: 20px;
        font-size: 40px;
    }

    .lightbox-prev,
    .lightbox-next {
        font-size: 24px;
        padding: 15px 10px;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

    .lightbox-caption {
        font-size: 1rem;
        padding: 15px;
    }

    .lightbox-caption strong {
        font-size: 1.2rem;
    }
}

/* ===========================
   Footer
   ========================== */
footer {
    text-align: center;
    margin-top: 50px;
    padding: 30px 20px;
    color: #e0e0e0;
    font-size: 0.95rem;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.creator-photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #ceae3b;
    box-shadow: 0 2px 8px rgba(206, 174, 59, 0.3);
    transition: transform 0.3s ease;
}

.creator-photo:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(206, 174, 59, 0.5);
}

.footer-content p {
    margin: 0;
}

/* ===========================
   Inspiration Gallery Section
   ========================== */
.gallery-section {
    max-width: 1400px;
    margin: 50px auto;
    padding: 40px 30px;
    background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}

.gallery-section h2 {
    text-align: center;
    color: #ceae3b;
    margin-bottom: 10px;
    font-size: 2.2rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.gallery-subtitle {
    text-align: center;
    color: #e0e0e0;
    font-size: 1.1rem;
    margin-bottom: 30px;
    font-style: italic;
}

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

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: #1a1a1a;
    aspect-ratio: 4/3;
    cursor: pointer;
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
}

/* Click indicator overlay */
.gallery-item::after {
    content: '🔍';
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 1.5rem;
    background: rgba(206, 174, 59, 0.9);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.gallery-item:hover::after {
    opacity: 1;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gallery-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 30px rgba(206, 174, 59, 0.4);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    color: white;
    padding: 20px 15px 15px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-caption {
    transform: translateY(0);
}

.gallery-caption h3 {
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: #ceae3b;
}

.gallery-caption p {
    font-size: 0.9rem;
    margin: 0;
    opacity: 0.9;
}

.gallery-placeholder {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: rgba(255,255,255,0.05);
    border: 2px dashed #ceae3b;
    border-radius: 12px;
    color: #e0e0e0;
}

.gallery-placeholder p {
    font-size: 1.1rem;
    margin: 10px 0;
}

.gallery-placeholder p:first-child {
    font-size: 2rem;
}

/* ===========================
   Responsive Design - Mobile
   ========================== */
@media (max-width: 768px) {
    .hero-backdrop {
        height: 250px;
    }

    header h1 {
        font-size: 1.8rem;
    }

    .cursive-text {
        font-size: 2.2rem;
    }

    .subtitle {
        font-size: 0.95rem;
    }

    .main-content {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    .tab-container {
        flex-direction: column;
        gap: 10px;
        padding: 0 20px;
    }

    .tab-btn {
        width: 100%;
        padding: 12px;
    }

    .word-grid {
        grid-template-columns: repeat(15, 6vw);
        gap: 2px;
        padding: 5px;
    }

    .grid-cell {
        width: 6vw;
        height: 6vw;
        font-size: 0.7rem;
    }

    .game-header {
        flex-direction: column;
        align-items: stretch;
    }

    .button-group {
        flex-direction: column;
        width: 100%;
    }

    .reset-btn, .share-btn {
        width: 100%;
    }

    .word-list-section {
        width: 100%;
    }

    .info-section {
        padding: 20px 15px;
    }

    .info-cards {
        grid-template-columns: 1fr;
        max-height: 500px;
    }

    .modal-content {
        margin: 20px;
        padding: 30px 20px;
    }

    .modal-actions {
        flex-direction: column;
        width: 100%;
    }

    .play-again-btn, .share-btn {
        width: 100%;
    }

    .gallery-section {
        padding: 30px 20px;
        margin: 30px auto;
    }

    .gallery-section h2 {
        font-size: 1.8rem;
    }

    .image-gallery {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .creator-photo {
        width: 60px;
        height: 60px;
    }

    .footer-content {
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .hero-backdrop {
        height: 200px;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .cursive-text {
        font-size: 1.8rem;
    }

    .fact-of-the-day {
        padding: 12px 15px;
    }

    .word-grid {
        grid-template-columns: repeat(15, 5.5vw);
    }

    .grid-cell {
        width: 5.5vw;
        height: 5.5vw;
        font-size: 0.6rem;
    }
}
