/**
 * Daily Riddle Game Styles
 */

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

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #ec4899;
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

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

.loading-state p {
    color: #666;
    font-size: 1.1rem;
}

/* Error State */
.error-state {
    text-align: center;
    padding: 60px 20px;
    background: #fef2f2;
    border-radius: 12px;
    margin: 20px 0;
}

.error-state h3 {
    color: #dc2626;
    margin-bottom: 10px;
}

.error-state p {
    color: #666;
    margin-bottom: 20px;
}

/* Clue Section */
.clue-section {
    text-align: center;
    padding: 24px;
    background: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%);
    border-radius: 12px;
    border: 1px solid #f9a8d4;
}

.clue-number {
    font-size: 0.9rem;
    color: #ec4899;
    font-weight: 600;
    margin-bottom: 12px;
}

.clue-text {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 12px;
    line-height: 1.5;
    color: #2d3748;
}

.clue-length {
    font-size: 0.95rem;
    color: #666;
    font-style: italic;
    margin-bottom: 12px;
}

.riddle-meta {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Difficulty Badges */
.difficulty-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.difficulty-easy {
    background: #dcfce7;
    color: #16a34a;
}

.difficulty-medium {
    background: #fef3c7;
    color: #d97706;
}

.difficulty-hard {
    background: #fee2e2;
    color: #dc2626;
}

/* Category Badge */
.category-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    background: #e0e7ff;
    color: #4f46e5;
}

/* Answer Section */
.answer-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}

.answer-grid {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 16px;
}

.letter-box {
    width: 45px;
    height: 45px;
    border: 2px solid #ddd;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 600;
    background: white;
    transition: all 0.2s ease;
    cursor: pointer;
    text-transform: uppercase;
}

.letter-box:hover {
    border-color: #ec4899;
    background: #fdf2f8;
}

.letter-box.active {
    border-color: #ec4899;
    background: #ec4899;
    color: white;
    box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.3);
}

.letter-box.filled {
    border-color: #ec4899;
    background: #fdf2f8;
    color: #be185d;
}

.letter-box.completed {
    background: #dcfce7;
    border-color: #22c55e;
    color: #16a34a;
}

/* Game Controls */
.game-controls {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(236, 72, 153, 0.4);
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-secondary:hover:not(:disabled) {
    background: #e5e7eb;
}

/* Hint Section */
.hint-section {
    text-align: center;
    min-height: 40px;
}

.hint-text {
    padding: 15px 20px;
    background: linear-gradient(135deg, #fef9e7 0%, #fcf3cf 100%);
    border-radius: 8px;
    border-left: 4px solid #f1c40f;
    text-align: left;
    margin-bottom: 10px;
}

.hint-text.hidden {
    display: none;
}

.hint-counter {
    font-size: 0.85rem;
    color: #666;
}

/* Virtual Keyboard */
.virtual-keyboard {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 12px;
}

.keyboard-row {
    display: flex;
    justify-content: center;
    gap: 6px;
}

.key-btn {
    width: 36px;
    height: 45px;
    border: none;
    border-radius: 6px;
    background: white;
    color: #333;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.1s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.key-btn:hover {
    background: #ec4899;
    color: white;
}

.key-btn:active {
    transform: scale(0.95);
}

.key-backspace {
    width: 60px;
    background: #e5e7eb;
}

.key-backspace:hover {
    background: #d1d5db;
    color: #333;
}

/* Success Modal */
.success-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.success-modal.hidden {
    display: none;
}

.success-modal .modal-content {
    background: white;
    border-radius: 16px;
    padding: 32px;
    max-width: 450px;
    width: 100%;
    text-align: center;
    animation: modalSlideIn 0.3s ease;
}

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

.success-modal h2 {
    color: #22c55e;
    margin-bottom: 10px;
    font-size: 1.8rem;
}

.success-message {
    color: #666;
    margin-bottom: 20px;
}

.answer-display {
    font-size: 1.5rem;
    color: #ec4899;
    margin-bottom: 20px;
    padding: 15px;
    background: #fdf2f8;
    border-radius: 8px;
}

.explanation-section,
.fun-fact-section {
    text-align: left;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 15px;
}

.explanation-section h4,
.fun-fact-section h4 {
    color: #333;
    margin-bottom: 8px;
    font-size: 1rem;
}

.explanation-section p,
.fun-fact-section p {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
}

.fun-fact-section {
    background: linear-gradient(135deg, #fef9e7 0%, #fcf3cf 100%);
    border-left: 4px solid #f1c40f;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
}

/* Yesterday Section */
.yesterday-section {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    margin-top: 25px;
}

.yesterday-section h3 {
    color: #333;
    margin: 0 0 15px 0;
    font-size: 1.1rem;
}

.yesterday-answer {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ec4899;
    margin: 0 0 15px 0;
}

.yesterday-link {
    color: #ec4899;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.yesterday-link:hover {
    color: #be185d;
    text-decoration: underline;
}

/* Stats Section */
.stats-section {
    margin-top: 25px;
}

.stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: #ec4899;
}

.stat-label {
    font-size: 0.85rem;
    color: #666;
}

/* Toast Messages */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 12px 24px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 2000;
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-info {
    background: #3b82f6;
}

.toast-success {
    background: #22c55e;
}

.toast-error {
    background: #ef4444;
}

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

.shake {
    animation: shake 0.3s ease;
}

@keyframes successPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.success-animation {
    animation: successPulse 0.5s ease;
}

.success-animation .letter-box {
    background: #dcfce7 !important;
    border-color: #22c55e !important;
    color: #16a34a !important;
}

/* Responsive */
@media (max-width: 768px) {
    .clue-text {
        font-size: 1.1rem;
    }

    .letter-box {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .key-btn {
        width: 32px;
        height: 40px;
        font-size: 0.9rem;
    }

    .key-backspace {
        width: 50px;
    }

    .stats {
        gap: 25px;
    }

    .stat-number {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .clue-section {
        padding: 16px;
    }

    .clue-text {
        font-size: 1rem;
    }

    .letter-box {
        width: 35px;
        height: 35px;
        font-size: 1.1rem;
        gap: 5px;
    }

    .answer-grid {
        gap: 5px;
    }

    .key-btn {
        width: 28px;
        height: 36px;
        font-size: 0.85rem;
    }

    .key-backspace {
        width: 45px;
    }

    .keyboard-row {
        gap: 4px;
    }

    .game-controls {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .stats {
        flex-direction: column;
        gap: 15px;
    }

    .modal-actions {
        flex-direction: column;
    }

    .modal-actions .btn {
        width: 100%;
    }
}
