/* 📝 Phrase Mode - Enhanced Styles */

/* Main Phrase Container */
.phrase-mode-interface {
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Phrase Progress Section */
.phrase-progress-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 25px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.phrase-progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.progress-text {
    font-size: 1.1rem;
    font-weight: 600;
}

.category-text {
    font-size: 0.9rem;
    opacity: 0.9;
}

.phrase-progress-bar {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    height: 8px;
    overflow: hidden;
    margin-bottom: 15px;
}

.phrase-progress-fill {
    background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
    height: 100%;
    border-radius: 10px;
    transition: width 0.3s ease;
}

.phrase-stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.phrase-stats span {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Phrase Display Container */
.phrase-container-wrapper {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    margin-bottom: 25px;
    border: 2px solid #e5e7eb;
    transition: all 0.3s ease;
    perspective: 1000px;
    min-height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.phrase-container-wrapper:hover {
    border-color: #667eea;
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.15);
}

/* 3D Flip Animation for Phrase Cards */
.phrase-card-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.phrase-card {
    width: 100%;
    height: 100%;
    min-height: 300px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s ease-in-out;
    cursor: pointer;
}

.phrase-card.flipped {
    transform: rotateY(180deg);
}

.phrase-card.transitioning {
    pointer-events: none;
}

.phrase-front,
.phrase-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    border-radius: 12px;
}

.phrase-front {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 1px solid #e5e7eb;
    transform: rotateY(0deg);
}

.phrase-back {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #f59e0b;
    transform: rotateY(180deg);
}

.phrase-turkish-section {
    text-align: center;
    margin-bottom: 20px;
}

.phrase-translation-section {
    text-align: center;
    margin-bottom: 20px;
}

/* Phrase Content */
.phrase-content-card {
    text-align: center;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 20px;
}

.phrase-icon-section {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.phrase-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border-radius: 20px;
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.3);
    font-size: 2.5rem;
}

.phrase-icon svg {
    width: 45px;
    height: 45px;
    color: white;
}

/* Main Phrase Text */
.phrase-main-text {
    background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
    color: white;
    padding: 25px;
    border-radius: 16px;
    margin-bottom: 20px;
    position: relative;
    box-shadow: 0 8px 20px rgba(31, 41, 55, 0.2);
}

.phrase-turkish {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.3;
    color: #1f2937;
    text-align: center;
}

.phrase-pronunciation {
    font-size: 1.1rem;
    color: #6b7280;
    font-style: italic;
    margin-bottom: 15px;
    text-align: center;
}

.phrase-meaning {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.phrase-arabic {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 8px;
    direction: rtl;
    color: #1f2937;
    text-align: center;
}

.phrase-english {
    font-size: 1rem;
    color: #6b7280;
    text-align: center;
}

/* Context and Difficulty Badges */
.phrase-context-badges {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 15px 0;
    flex-wrap: wrap;
}

.context-badge, .difficulty-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: capitalize;
}

.context-badge {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
}

.difficulty-badge {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

/* TTS Controls */
.phrase-tts-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 15px 0;
}

.tts-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.tts-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.tts-btn i {
    font-size: 1.1rem;
}

/* Phrase Hints */
.phrase-hint {
    margin-top: 20px;
    padding: 10px 15px;
    background: rgba(107, 114, 128, 0.1);
    border-radius: 8px;
    color: #6b7280;
    font-size: 0.9rem;
    text-align: center;
    font-style: italic;
}

/* Usage and Examples Sections */
.phrase-usage-section, .phrase-examples-section, .phrase-responses-section {
    margin: 20px 0;
    text-align: left;
}

.phrase-usage-section h4, .phrase-examples-section h4, .phrase-responses-section h4 {
    color: #374151;
    margin-bottom: 10px;
    font-size: 1rem;
    font-weight: 600;
}

.phrase-usage-section p {
    color: #6b7280;
    font-size: 0.9rem;
    line-height: 1.5;
}

.usage-example, .common-response {
    background: rgba(255, 255, 255, 0.7);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    border-left: 3px solid #667eea;
}

.example-situation {
    font-size: 0.8rem;
    color: #667eea;
    font-weight: 600;
    margin-bottom: 5px;
}

.example-turkish, .response-turkish {
    font-size: 0.9rem;
    color: #374151;
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.example-arabic, .response-arabic {
    font-size: 0.85rem;
    color: #6b7280;
    direction: rtl;
}

.example-tts-btn, .response-tts-btn {
    background: transparent;
    border: 1px solid #10b981;
    color: #10b981;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
}

.example-tts-btn:hover, .response-tts-btn:hover {
    background: #10b981;
    color: white;
}

/* Context & Usage Information */
.phrase-context-section {
    background: #f8fafc;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    margin-top: 20px;
}

.context-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    font-weight: 600;
    color: #374151;
}

.context-header i {
    color: #667eea;
}

.context-info {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid #667eea;
}

.context-label {
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 5px;
}

.context-value {
    color: #6b7280;
}

/* Examples Section */
.phrase-examples {
    margin-top: 15px;
}

.example-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    border: 1px solid #e5e7eb;
}

.example-situation {
    font-weight: 600;
    color: #667eea;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.example-turkish {
    font-size: 1rem;
    color: #374151;
    margin-bottom: 5px;
}

.example-arabic {
    font-size: 0.95rem;
    color: #6b7280;
    direction: rtl;
}

/* Audio Controls */
.phrase-audio-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.phrase-tts-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.3);
}

.phrase-tts-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.phrase-tts-btn:active {
    transform: translateY(0);
}

.phrase-tts-btn i {
    font-size: 1.1rem;
}

/* Navigation Controls */
.phrase-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 25px;
}

.navigation-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.learning-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.phrase-control-btn {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    min-width: 120px;
    justify-content: center;
}

.phrase-control-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
    transform: translateY(-1px);
}

.phrase-control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.phrase-control-btn.flip-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.phrase-control-btn.flip-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #5b21b6 0%, #7c3aed 100%);
}

.learning-btn {
    border: none;
    padding: 10px 16px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    min-width: 100px;
    justify-content: center;
}

.learning-btn.known {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.learning-btn.learning {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
}

.learning-btn.difficult {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.learning-btn:hover {
    transform: translateY(-1px);
}

.phrase-nav-btn {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    min-width: 120px;
    justify-content: center;
}

.phrase-nav-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
    transform: translateY(-1px);
}

.phrase-nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.phrase-action-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.phrase-action-btn:hover {
    background: linear-gradient(135deg, #5b21b6 0%, #7c3aed 100%);
    transform: translateY(-1px);
}

/* Filter Controls */
.phrase-filters {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 150px;
}

.filter-label {
    font-weight: 500;
    color: #4b5563;
    font-size: 0.9rem;
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.9rem;
    background: white;
    cursor: pointer;
}

.filter-actions {
    margin-left: auto;
}

.filter-btn {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
}

/* No Phrases Available */
.no-phrases-available {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
}

.no-phrases-icon {
    margin-bottom: 20px;
}

.no-phrases-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 10px;
}

.no-phrases-description {
    margin-bottom: 30px;
    line-height: 1.6;
}

.no-phrases-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.btn-action {
    padding: 12px 20px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-action.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-action.btn-secondary {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
}

.btn-action:hover {
    transform: translateY(-1px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .phrase-mode-interface {
        padding: 15px;
        margin: 10px;
        border-radius: 16px;
    }
    
    .phrase-progress-info {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
    
    .phrase-container-wrapper {
        padding: 20px;
    }
    
    .phrase-turkish {
        font-size: 1.5rem;
    }
    
    .phrase-arabic {
        font-size: 1.2rem;
    }
    
    .phrase-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .phrase-nav-btn,
    .phrase-action-btn {
        min-width: 100%;
    }
    
    .phrase-audio-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .filters-grid {
        grid-template-columns: 1fr;
    }
}

/* Loading States */
.phrase-loading {
    text-align: center;
    padding: 40px;
    color: #6b7280;
}

.phrase-loading i {
    font-size: 2rem;
    margin-bottom: 15px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Completion Screen */
.phrase-completion {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.completion-header {
    margin-bottom: 30px;
}

.completion-header h2 {
    color: #059669;
    margin-bottom: 10px;
}

.completion-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.stat-item {
    background: #f8fafc;
    padding: 15px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
}

.stat-label {
    font-size: 0.9rem;
    color: #6b7280;
    margin-top: 5px;
}