/* Cali Connections Game Styles - Light Mode Only */
.cali-connections-game {
    max-width: 620px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: white !important;
    border-radius: 16px;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.1);
    color: #2c3e50 !important;
}

.game-header {
    text-align: center;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e8f4f8;
}

.attempts-remaining {
    font-size: 1.1rem;
    color: #7f8c8d;
    font-weight: 500;
    margin-top: 6px;
}

.attempts-count {
    color: #e74c3c;
    font-weight: bold;
}

.game-messages {
    margin-bottom: 8px;
    min-height: 60px;
}

.message {
    padding: 10px;
    border-radius: 10px;
    margin: 8px 0;
    font-weight: 500;
    display: none;
    text-align: center;
}

.success-message {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.game-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.word-card {
    background: white !important;
    color: #2c3e50 !important;
    padding: 10px 6px;
    text-align: center;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 14px;
    user-select: none;
    border: 3px solid transparent;
    animation: borderGlow 3s infinite alternate;
    min-height: 65px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.12);
}

@keyframes borderGlow {
    0% { 
        border-color: #ff6b6b; 
        box-shadow: 0 0 8px rgba(255, 107, 107, 0.3), 0 3px 14px rgba(0, 0, 0, 0.15);
    }
    25% { 
        border-color: #4ecdc4; 
        box-shadow: 0 0 8px rgba(78, 205, 196, 0.3), 0 3px 14px rgba(0, 0, 0, 0.15);
    }
    50% { 
        border-color: #45b7d1; 
        box-shadow: 0 0 8px rgba(69, 183, 209, 0.3), 0 3px 14px rgba(0, 0, 0, 0.15);
    }
    75% { 
        border-color: #f9c74f; 
        box-shadow: 0 0 8px rgba(249, 199, 79, 0.3), 0 3px 14px rgba(0, 0, 0, 0.15);
    }
    100% { 
        border-color: #ff6b6b; 
        box-shadow: 0 0 8px rgba(255, 107, 107, 0.3), 0 3px 14px rgba(0, 0, 0, 0.15);
    }
}

.word-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.18);
}

.word-card.selected {
    background: #ffc107 !important;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.18);
    animation: none;
    border: 3px solid #ffa000;
}

.word-card.correct {
    background: #e8f5e9 !important;
    color: #2e7d32 !important;
    animation: none;
    transform: scale(0.95);
    border: 3px solid #4caf50;
    box-shadow: 0 5px 18px rgba(76, 175, 80, 0.25);
    opacity: 0.7;
    filter: saturate(0.8);
}

.word-card.incorrect {
    background: #ffebee !important;
    color: #c62828 !important;
    animation: shake 0.5s;
    border: 3px solid #f44336;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.game-controls {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.game-button {
    padding: 14px 28px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.submit-button {
    background: #2ecc71;
    color: white;
}

.submit-button:hover {
    background: #27ae60;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.deselect-button {
    background: #95a5a6;
    color: white;
}

.deselect-button:hover {
    background: #7f8c8d;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.categories-reveal {
    background: #f8f9fa !important;
    padding: 25px;
    border-radius: 14px;
    margin-top: 25px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    color: #2c3e50 !important;
}

.category-reveal-item {
    background: white !important;
    padding: 18px;
    border-radius: 10px;
    margin-bottom: 18px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.5s ease;
    color: #2c3e50 !important;
}

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

.category-reveal-item h4 {
    color: #3498db;
    margin: 0 0 12px 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.category-reveal-words {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.category-reveal-words span {
    background: #e8f4f8;
    padding: 9px 16px;
    border-radius: 20px;
    font-weight: 500;
    color: #2c3e50;
    border: 1px solid #3498db;
}

/* Points notification */
.points-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.5);
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
    padding: 20px 30px;
    border-radius: 15px;
    font-size: 24px;
    font-weight: bold;
    z-index: 10000;
    opacity: 0;
    transition: all 0.5s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    text-align: center;
    border: 3px solid #fff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.points-notification.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Animation for the notification */
@keyframes pointsPopup {
    0% { 
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

.points-notification.show {
    animation: pointsPopup 0.6s ease forwards;
}

/* Archive Styles */
.cali-connections-archive {
    max-width: 1200px;
    margin: 30px auto;
    padding: 25px;
    background: white !important;
    border-radius: 14px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    color: #2c3e50 !important;
}

.cali-connections-archive h2 {
    color: #2c3e50;
    text-align: center;
    margin: 0 0 25px 0;
    font-size: 2.2rem;
}

.cali-connections-message {
    text-align: center;
    padding: 45px;
    background: white;
    border-radius: 14px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    margin: 25px 0;
    color: #2c3e50 !important;
}

.cali-connections-message p {
    font-size: 1.2rem;
    color: #7f8c8d;
    margin: 0;
}

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

.puzzle-item {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    text-align: center;
}

.puzzle-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.puzzle-item h3 {
    color: #2c3e50;
    margin: 0 0 15px 0;
    font-size: 1.4rem;
}

.puzzle-date {
    display: none; /* Hidden - removed from archive display */
}

.puzzle-difficulty {
    margin: 0 0 12px 0;
    font-weight: 500;
}

.difficulty-easy {
    color: #22c55e;
}

.difficulty-medium {
    color: #eab308;
}

.difficulty-hard {
    color: #ef4444;
}

.puzzle-status {
    margin: 10px 0 !important;
    font-weight: 500;
    font-size: 14px;
}

.status-completed {
    color: #22c55e;
    font-weight: bold;
}

.status-not-completed {
    color: #6b7280;
}

.play-puzzle-button {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 15px;
    text-decoration: none;
    display: inline-block;
}

.play-puzzle-button:hover {
    background: linear-gradient(135deg, #2980b9, #2471a3);
    transform: translateY(-2px);
    color: white;
    text-decoration: none;
}

.play-puzzle-button:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
}

/* Leaderboard Styles */
.cali-connections-leaderboard {
    max-width: 1000px;
    margin: 30px auto;
    padding: 25px;
    background: white !important;
    border-radius: 14px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    color: #2c3e50 !important;
}

.cali-connections-leaderboard h2 {
    color: #2c3e50;
    text-align: center;
    margin: 0 0 15px 0;
    font-size: 2.2rem;
}

.cali-connections-leaderboard > p {
    text-align: center;
    color: #7f8c8d;
    margin: 0 0 35px 0;
    font-size: 1.1rem;
}

.leaderboard-fallback {
    background: white !important;
    padding: 35px;
    border-radius: 14px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    color: #2c3e50 !important;
}

.leaderboard-fallback > p {
    text-align: center;
    color: #e74c3c;
    font-weight: 500;
    margin: 0 0 25px 0;
    font-size: 1.1rem;
}

.sample-leaderboard {
    overflow-x: auto;
}

.sample-leaderboard table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 18px;
    background: white !important;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    color: #2c3e50 !important;
}

.sample-leaderboard th {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 16px;
    text-align: left;
    font-weight: 600;
}

.sample-leaderboard td {
    padding: 14px 16px;
    border-bottom: 1px solid #ecf0f1;
    color: #2c3e50;
}

.sample-leaderboard tr:nth-child(even) {
    background: #f8f9fa;
}

.sample-leaderboard tr:hover {
    background: #e8f4f8;
}

/* Error Message Styles */
.cali-connections-error {
    text-align: center;
    padding: 45px;
    background: white;
    border-radius: 14px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    margin: 25px 0;
    color: #2c3e50 !important;
}

.cali-connections-error p {
    font-size: 1.2rem;
    color: #7f8c8d;
    margin: 0;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .cali-connections-game {
        padding: 20px 18px;
        margin: 15px;
    }
    
    .game-board {
        gap: 10px;
    }
    
    .word-card {
        padding: 14px 6px;
        font-size: 13px;
        min-height: 55px;
    }
    
    .game-controls {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .game-button {
        width: 100%;
        max-width: 220px;
        padding: 13px 25px;
    }
    
    .category-reveal-words {
        gap: 10px;
    }
    
    .category-reveal-words span {
        padding: 8px 14px;
        font-size: 0.9rem;
    }
    
    /* Archive responsive */
    .cali-connections-archive,
    .cali-connections-leaderboard {
        padding: 20px;
        margin: 20px;
    }
    
    .puzzle-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .puzzle-item {
        padding: 20px;
    }
    
    .leaderboard-fallback {
        padding: 25px;
    }
    
    .sample-leaderboard th,
    .sample-leaderboard td {
        padding: 12px;
        font-size: 0.9rem;
    }
    
    /* Points notification mobile */
    .points-notification {
        padding: 15px 20px;
        font-size: 20px;
        max-width: 80%;
    }
}

@media (max-width: 480px) {
    .cali-connections-game {
        padding: 18px 15px;
        margin: 12px;
        border-radius: 12px;
    }
    
    .word-card {
        font-size: 12px;
        padding: 12px 4px;
        min-height: 50px;
        border-width: 2px;
    }
    
    .category-reveal-item {
        padding: 15px;
    }
    
    .category-reveal-words span {
        padding: 7px 12px;
        font-size: 0.85rem;
    }
    
    /* Archive mobile */
    .cali-connections-archive {
        padding: 18px;
    }
    
    .puzzle-item {
        padding: 18px;
    }
    
    .puzzle-item h3 {
        font-size: 1.3rem;
    }
    
    /* Leaderboard mobile */
    .sample-leaderboard {
        font-size: 0.85rem;
    }
    
    .cali-connections-leaderboard h2 {
        font-size: 1.9rem;
    }
    
    .game-button {
        padding: 12px 20px;
        font-size: 0.95rem;
    }
    
    /* Points notification mobile */
    .points-notification {
        padding: 12px 18px;
        font-size: 18px;
    }
}