/* ================================
   Daily Word Modal - Performance Optimized
   ================================ */

/* Modal Overlay */
.daily-word-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 20px;
}

.daily-word-modal.show {
    opacity: 1;
    visibility: visible;
}

.daily-word-modal.show .daily-word-container {
    transform: scale(1);
    opacity: 1;
}

/* Modal Container */
.daily-word-container {
    max-width: 420px;
    width: 100%;
    position: relative;
    transform: scale(0.9);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Flashcard Container - Simplified & Optimized */
.flashcard-wrapper {
    perspective: 800px;
    width: 100%;
    height: 320px;
    position: relative;
    cursor: pointer;
}

.flashcard {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.5s ease;
    border-radius: 16px;
    /* Performance optimizations */
    will-change: transform;
    /* backface-visibility: hidden; <-- BU SATIR KALDIRILDI - Hatanın sebebi buydu */
}

.flashcard.flipped {
    transform: rotateY(180deg);
}

/* Card Faces - Simplified */
.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.card-front {
    background: linear-gradient(135deg, #20B2AA 0%, #178B88 100%);
    color: white;
}

.card-back {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: rotateY(180deg);
}

/* Front Side Typography - Learning Focused */
.english-word {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 16px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    line-height: 1.1;
}

.english-example {
    font-size: 1.1rem;
    font-style: italic;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 20px;
    line-height: 1.4;
    padding: 0 8px;
}

.word-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: auto;
}

.pronunciation {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.part-of-speech {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.difficulty-level {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.difficulty-level.a1, .difficulty-level.a2 {
    background: rgba(76, 175, 80, 0.3);
}

.difficulty-level.b1, .difficulty-level.b2 {
    background: rgba(255, 193, 7, 0.3);
}

.difficulty-level.c1, .difficulty-level.c2 {
    background: rgba(244, 67, 54, 0.3);
}

/* Back Side Typography - Simple & Clear */
.turkish-meaning {
    font-size: 2.2rem;
    font-weight: 600;
    margin-bottom: 20px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    line-height: 1.2;
}

.turkish-example {
    font-size: 1.1rem;
    font-style: italic;
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.4;
    padding: 0 8px;
}

/* Close Button - Simple */
.modal-close {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    color: #333;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, background-color 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.modal-close:hover {
    background: white;
    transform: scale(1.05);
}

/* Flip Hint */
.flip-hint {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
    animation: fadeInOut 3s infinite;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* Loading State - Simplified */
.daily-word-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 320px;
    color: white;
    background: linear-gradient(135deg, #20B2AA 0%, #178B88 100%);
    border-radius: 16px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 12px;
}

.loading-text {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
}

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

/* Error State - Simplified */
.daily-word-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 320px;
    color: white;
    text-align: center;
    padding: 24px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    border-radius: 16px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.error-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: 0.8;
}

.error-message {
    font-size: 1rem;
    margin-bottom: 16px;
    color: rgba(255, 255, 255, 0.9);
}

.retry-button {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 0.9rem;
}

.retry-button:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Responsive Design - Optimized */
@media (max-width: 768px) {
    .daily-word-modal {
        padding: 16px;
    }
    
    .flashcard-wrapper {
        height: 300px;
    }
    
    .card-face {
        padding: 20px;
    }
    
    .english-word {
        font-size: 2.2rem;
        margin-bottom: 14px;
    }
    
    .turkish-meaning {
        font-size: 1.9rem;
        margin-bottom: 16px;
    }
    
    .english-example, .turkish-example {
        font-size: 1rem;
    }
    
    .flip-hint {
        bottom: -36px;
        font-size: 0.8rem;
    }
    
    .modal-close {
        top: -10px;
        right: -10px;
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .daily-word-modal {
        padding: 12px;
    }
    
    .flashcard-wrapper {
        height: 280px;
    }
    
    .card-face {
        padding: 18px;
    }
    
    .english-word {
        font-size: 2rem;
    }
    
    .turkish-meaning {
        font-size: 1.7rem;
    }
    
    .english-example, .turkish-example {
        font-size: 0.95rem;
    }
}

/* Performance & Accessibility */
@media (prefers-reduced-motion: reduce) {
    .flashcard {
        transition: transform 0.2s ease;
    }
    
    .daily-word-modal {
        transition: opacity 0.2s ease, visibility 0.2s ease;
    }
    
    .daily-word-container {
        transition: transform 0.2s ease, opacity 0.2s ease;
    }
    
    @keyframes fadeInOut {
        0%, 100% { opacity: 0.6; }
        50% { opacity: 1; }
    }
}

/* Remove will-change after animation completes to save memory */
.flashcard:not(.flipped):not(:hover) {
    will-change: auto;
}
