/* Root Variables */
:root {
    --primary-color: #074472;
    --secondary-color: #4a9ba8;
    --accent-orange: #e55a3c;
    --accent-teal: #5a9ba8;
    --success-color: #28a745;
    --error-color: #dc3545;
    --warning-color: #ffc107;
    --background-color: #f8f9fa;
    --card-background: #ffffff;
    --text-primary: #2c3e50;
    --text-secondary: #6c757d;
    --border-color: #dee2e6;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
}

/* Base Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Nunito', 'Futura', 'Century Gothic', 'Helvetica Neue', Arial, sans-serif;
    background-color: white;
    color: var(--text-primary);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

/* Header Styles */
.game-header {
    background: white;
    color: var(--text-primary);
    padding: 1.5rem 0 0.5rem 0;
}

.logo {
    max-height: 80px;
    width: auto;
    margin-bottom: 1rem;
}

.logout-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    padding: 0.4rem 0.8rem;
    cursor: pointer;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
    font-family: 'Nunito', sans-serif;
}

.logout-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--primary-color);
}

.user-greeting {
    position: absolute;
    top: 10px;
    left: 15px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-weight: 500;
    font-family: 'Nunito', sans-serif;
}

.done-link {
    color: var(--secondary-color);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.done-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.synonyms-container {
    max-height: 400px;
    overflow-y: auto;
    padding: 1rem 0;
}

.synonym-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.synonym-item:last-child {
    border-bottom: none;
}

.synonym-checkmark {
    color: var(--success-color);
    margin-right: 0.5rem;
    font-size: 1rem;
}

.synonym-word {
    font-size: 0.95rem;
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.synonym-word:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

.game-title {
    font-size: 2rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* Main Game Area */
.game-main {
    padding: 1rem 0;
    min-height: 60vh;
}

/* Challenge Word Display */
.challenge-word-container {
    background: var(--card-background);
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem 0.5rem 1rem;
    text-align: center;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.date-text {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1rem;
    font-weight: 500;
    text-align: center;
}

.challenge-word {
    font-family: 'Crimson Text', 'Cheltenham', serif;
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
    letter-spacing: 1px;
}

.part-of-speech {
    font-size: 1rem;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 0.5rem;
    font-style: italic;
    font-weight: 500;
}

.challenge-instruction {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin: 1rem 0 0 0;
    font-weight: 600;
}

/* Score Container */
.score-container {
    background: var(--card-background);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.stat-box {
    padding: 1rem;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-color);
    line-height: 1;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    margin-top: 0.5rem;
}

/* Input Form */
.word-input-form {
    padding: 2rem;
}

.word-input {
    font-size: 1.2rem;
    padding: 1rem 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-weight: 600;
    transition: all 0.3s ease;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    box-shadow: none;
}

.word-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(44, 95, 124, 0.25);
    outline: none;
}

.submit-btn {
    background-color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: none;
}

.submit-btn:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    transform: translateY(-2px);
}

.submit-btn:focus {
    box-shadow: 0 0 0 0.2rem rgba(44, 95, 124, 0.25);
}

/* Submit button icon styles removed */

/* Feedback Messages */
.feedback-message {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 1rem 2rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
    display: none;
    z-index: 1000;
    min-width: 300px;
    max-width: 95%;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

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

.feedback-message.warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.feedback-message.show {
    display: block;
    animation: slideUpFromBottom 0.3s ease;
}

@keyframes slideUpFromBottom {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(100px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Found Words */
.found-words-container {
    margin-top: 1rem;
}

.score-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.2rem;
    font-weight: 700;
    color: #20B2AA;
    margin-bottom: 1rem;
}

.word-count {
    text-align: left;
    color: var(--primary-color);
}

.total-score {
    text-align: right;
}

.found-words-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
}

.total-score {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
    background: #f8f9fa;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 2px solid var(--primary-color);
}

.found-words-title i {
    color: var(--success-color);
    margin-right: 0.5rem;
}

.found-words-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.found-word {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    font-weight: 600;
    font-size: 1rem;
    text-transform: capitalize;
    color: var(--primary-color);
    border-bottom: 1px solid #f0f0f0;
    animation: fadeInScale 0.4s ease;
}

.found-word:last-child {
    border-bottom: none;
}

.found-word .word {
    flex-grow: 1;
}

.found-word .score {
    font-weight: 700;
    color: #20B2AA;
    font-size: 0.9rem;
}

.found-word .word {
    flex-grow: 1;
}



/* Hint button styles removed */

/* Footer styles removed */

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Loading State */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading .submit-btn {
    position: relative;
}

.loading .submit-btn::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .game-title {
        font-size: 1.5rem;
        letter-spacing: 1px;
    }
    
    .challenge-word {
        font-size: 2.5rem;
        letter-spacing: 2px;
    }
    
    .challenge-word-container {
        padding: 1rem 1.5rem 0.5rem 1.5rem;
    }
    
    .word-input-form {
        padding: 1.5rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .input-group {
        flex-direction: column;
        width: 100%;
    }
    
    .input-group .word-input {
        width: 100% !important;
        flex: 1 !important;
        min-width: 0 !important;
    }
    
    .submit-btn {
        margin-top: 1rem;
        border-radius: var(--border-radius);
        width: 100%;
    }
    
    .word-input {
        border-radius: var(--border-radius);
        margin-bottom: 0;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
}

@media (max-width: 576px) {
    .logo {
        max-height: 60px;
    }
    
    .game-title {
        font-size: 1.3rem;
    }
    
    .challenge-word {
        font-size: 2rem;
        letter-spacing: 1px;
    }
    
    .challenge-word-container {
        padding: 1.5rem 1rem;
    }
    
    .word-input-form {
        padding: 1rem;
    }
    
    .found-words-container {
        padding: 1.5rem;
    }
    
    .stat-box {
        padding: 0.5rem;
    }
    
    .stat-number {
        font-size: 1.8rem;
    }
    
    .submit-btn {
        border-radius: var(--border-radius) !important;
        width: 100% !important;
    }
    
    .word-input {
        border-radius: var(--border-radius) !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --border-color: #000000;
        --shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    }
    
    .word-input {
        border-width: 3px;
    }
    
    .found-word {
        border: 2px solid #000000;
    }
}

/* Words Title */
.words-title {
    text-align: center;
    color: var(--primary-color);
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

/* Leaderboard Styles */
.leaderboard-container {
    margin-top: 2rem;
}

.leaderboard-title {
    text-align: center;
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.leaderboard-list {
    list-style: none;
    padding: 0;
    margin: 0;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 1rem;
}

.leaderboard-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e9ecef;
    font-size: 0.95rem;
}

.leaderboard-entry:last-child {
    border-bottom: none;
}

.player-name {
    font-weight: 600;
    color: var(--primary-color);
}

.player-name.current-user {
    color: var(--success-color);
    font-weight: 700;
}

.player-name.clickable-player {
    cursor: pointer;
    transition: color 0.2s ease;
}

.player-name.clickable-player:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

.player-stats {
    color: var(--secondary-color);
    font-size: 0.9rem;
}

/* Modal Styles */
.modal-content {
    border-radius: var(--border-radius);
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.modal-header {
    border-bottom: 1px solid #e9ecef;
    padding: 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-title {
    color: var(--primary-color);
    font-weight: 700;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
