/* Wordle Grid Styling */
.wordle-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 20px auto;
    max-width: 500px;
}

/* Reset button styling */
.reset-button {
    margin-bottom: 20px;
    padding: 10px 20px;
    background-color: #4285f4;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.reset-button:hover {
    background-color: #3367d6;
}

.wordle-grid {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 30px;
}

.wordle-row {
    display: flex;
    gap: 5px;
}

.wordle-cell {
    width: 60px;
    height: 60px;
    border: 2px solid #d3d6da;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    font-weight: bold;
    text-transform: uppercase;
    background-color: white;
    transition: all 0.3s ease;
}

.wordle-cell.filled {
    border-color: #878a8c;
}

.wordle-cell.active {
    border-color: #4285f4;
    box-shadow: 0 0 5px rgba(66, 133, 244, 0.5);
}

/* Animation for revealing cells */
@keyframes flip {
    0% {
        transform: rotateX(0);
    }
    50% {
        transform: rotateX(90deg);
    }
    100% {
        transform: rotateX(0);
    }
}

.wordle-cell.reveal {
    animation: flip 0.5s ease;
}

/* Shake animation for invalid words */
@keyframes shake {
    0% { transform: translateX(0); }
    10% { transform: translateX(-5px); }
    20% { transform: translateX(5px); }
    30% { transform: translateX(-5px); }
    40% { transform: translateX(5px); }
    50% { transform: translateX(-5px); }
    60% { transform: translateX(5px); }
    70% { transform: translateX(-5px); }
    80% { transform: translateX(5px); }
    90% { transform: translateX(-5px); }
    100% { transform: translateX(0); }
}

.wordle-row.shake {
    animation: shake 0.5s ease-in-out;
}

/* Keyboard styling */
.keyboard {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-width: 600px;
}

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

.keyboard-key {
    min-width: 40px;
    height: 58px;
    border-radius: 4px;
    border: none;
    background-color: #d3d6da;
    font-weight: bold;
    cursor: pointer;
    text-transform: uppercase;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 10px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.keyboard-key:hover {
    background-color: #c1c4c8;
}

/* Special keys */
.keyboard-key:first-child,
.keyboard-key:last-child {
    min-width: 65px;
}

/* Mobile responsiveness */
@media (max-width: 500px) {
    .wordle-cell {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    
    .keyboard-key {
        min-width: 30px;
        height: 48px;
        font-size: 0.8rem;
    }
}

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

/* Prevent interaction with elements behind the modal */
body.modal-active #wordle-grid,
body.modal-active #keyboard {
    pointer-events: none;
}

.quiz-modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 500px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: absolute; /* Required for draggable functionality */
    transform: translate(-50%, -50%); /* Center the modal initially */
    top: 50%;
    left: 50%;
}

/* Draggable header styles */
.quiz-modal-header {
    cursor: move;
    padding: 10px 0;
    margin: -30px -30px 10px -30px;
    background-color: #f5f5f5;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    border-bottom: 1px solid #e0e0e0;
    user-select: none; /* Prevent text selection during drag */
}

.drag-handle {
    font-size: 14px;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quiz-modal h3 {
    margin: 0;
    color: #333;
    font-size: 1.5rem;
}

.quiz-input {
    padding: 12px 15px;
    font-size: 1.1rem;
    border: 2px solid #d3d6da;
    border-radius: 4px;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

.quiz-input:focus {
    border-color: #4285f4;
    outline: none;
    box-shadow: 0 0 5px rgba(66, 133, 244, 0.3);
}

.quiz-submit, .quiz-skip {
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: bold;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.quiz-submit {
    background-color: #4285f4;
    color: white;
}

.quiz-submit:hover {
    background-color: #3367d6;
}

.quiz-skip {
    background-color: #e0e0e0;
    color: #333;
}

.quiz-skip:hover {
    background-color: #d0d0d0;
}

.quiz-feedback {
    font-size: 1.1rem;
    font-weight: bold;
    padding: 10px;
    border-radius: 4px;
    animation: fadeIn 0.3s ease;
}

.quiz-feedback.correct {
    background-color: #e6f4ea;
    color: #137333;
}

.quiz-feedback.incorrect {
    background-color: #fce8e6;
    color: #c5221f;
}

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

/* Mobile responsiveness for quiz modal */
@media (max-width: 500px) {
    .quiz-modal-content {
        padding: 20px;
        gap: 15px;
    }
    
    .quiz-modal h3 {
        font-size: 1.2rem;
    }
    
    .quiz-input {
        padding: 10px;
        font-size: 1rem;
    }
    
    .quiz-submit, .quiz-skip {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
}

/* Message styles */
#wordle-message {
    position: fixed;
    top: 15%;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 16px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1000;
    pointer-events: none;
}

#wordle-message.show {
    opacity: 1;
}
