/* Example Navigation Tabs */
.nav-tabs {
    border: none;
    background: #f8f9fa;
    border-radius: 15px;
    padding: 0.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    width: 100%;
    justify-content: space-between;
    gap: 0.5rem;
    position: relative;
    z-index: 1;
}

.nav-tabs .nav-item {
    flex: 1;
    text-align: center;
    margin: 0;
    padding: 0;
    min-width: 0;
    position: relative;
}

.example-nav-link {
    border: none;
    border-radius: 10px;
    margin: 0 !important;
    padding: 0.75rem 1rem !important;
    font-weight: 700;
    transition: all 0.3s ease;
    color: #6c757d !important;
    background: rgba(102, 126, 234, 0.1) !important;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
    width: 100% !important;
    text-align: center !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    min-height: 48px;
    line-height: 1.2;
    word-break: keep-all;
    hyphens: none;
    font-size: 1rem;
    text-decoration: none;
}

/* Special styling for the long text button */
.example-nav-link[data-example="4"] {
    font-size: 0.95rem;
    line-height: 1.3;
    word-break: break-word;
    hyphens: auto;
}

/* Responsive improvements for better mobile experience */
@media (max-width: 1200px) {
    .example-nav-link[data-example="4"] {
        font-size: 0.9rem;
        line-height: 1.2;
    }
}

.example-nav-link::first-letter,
.example-nav-link::first-line {
    font-size: inherit;
    line-height: inherit;
}

.example-nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.example-nav-link:hover {
    background: rgba(102, 126, 234, 0.2) !important;
    color: #495057 !important;
    transform: translateY(-2px);
    border-color: rgba(102, 126, 234, 0.3);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
    text-decoration: none;
}

.example-nav-link:hover::before {
    opacity: 1;
}

.example-nav-link.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    border-color: #667eea;
    transform: translateY(-1px);
    z-index: 2;
    text-decoration: none;
}

.example-nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: #667eea;
    border-radius: 2px;
    z-index: 3;
}


/* Ensure consistent hover states */
.example-nav-link:hover:not(.active) {
    background: rgba(102, 126, 234, 0.2) !important;
    color: #495057 !important;
    transform: translateY(-2px);
    border-color: rgba(102, 126, 234, 0.3);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
    z-index: 1;
}

.main-content {
    padding: 2rem 3rem;
    background: var(--bg-light);
    min-height: calc(100vh - 80px);
    max-width: 1200px;
    margin: 0 auto;
}

.content-header {
    text-align: center;
    margin-bottom: 3rem;
}

.page-title {
    font-weight: var(--font-bold);
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 2.5rem;
}

.page-subtitle {
    color: var(--gray-600);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}



.simple-exercise {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 3rem;
    margin-bottom: 2rem;
    text-align: center;
}

.paragraph-content {
    margin-bottom: 3rem;
}

.french-input {
    font-size: 1.4rem;
    line-height: 1.8;
    color: var(--gray-800);
    margin-bottom: 2rem;
    padding: 2rem;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    border: 2px solid var(--gray-200);
    border-left: 4px solid var(--primary-color);
    font-family: 'Georgia', serif;
    text-align: left;
    width: 100%;
    min-height: 300px;
    resize: none;
    outline: none;
    transition: border-color var(--transition-normal);
}

.french-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.french-input[readonly] {
    cursor: default;
    background-color: var(--gray-50);
}

.french-input.editable {
    cursor: text;
    background-color: white;
    border-color: var(--primary-color);
}

.french-input.editable:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.record-section {
    margin-top: 2rem;
}

.recording-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.record-btn, .play-btn {
    border: none;
    border-radius: var(--radius-lg);
    padding: 1rem 2rem;
    font-weight: var(--font-semibold);
    font-size: 1.1rem;
    transition: all var(--transition-normal);
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    cursor: pointer;
    box-shadow: var(--shadow-md);
}

.record-btn {
    background: var(--primary-color);
    color: white;
}

.record-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.record-btn.recording {
    background: #dc3545;
    animation: pulse 1.5s infinite;
}

.record-btn.recording:hover {
    background: #c82333;
}

.play-btn {
    background: #28a745;
    color: white;
}

.play-btn:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.play-btn.playing {
    background: #ffc107;
    color: #212529;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Audio Level Bar */
.audio-level-container {
    margin: 2rem auto;
    max-width: 400px;
}

.audio-level-bar {
    width: 100%;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 1rem;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.audio-level-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    width: 0%;
    transition: width 0.1s ease;
    border-radius: 10px;
}

.recording-timer {
    font-size: 1.2rem;
    font-weight: var(--font-semibold);
    color: var(--gray-700);
}



/* Success Message */
.success-message {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: #28a745;
    font-size: 1.2rem;
    font-weight: var(--font-semibold);
    margin: 2rem 0;
}

.success-message i {
    font-size: 1.5rem;
}

/* Assessment Results */
.assessment-results {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--gray-200);
}

.assessment-title {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin-bottom: 2rem;
    text-align: center;
}

/* Audio Player */
.audio-player-container {
    margin-bottom: 2rem;
}

.audio-player {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--gray-50);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
}

.play-pause-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.play-pause-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.audio-progress {
    flex: 1;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--gray-300);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    transition: width 0.1s ease;
}

.time-display {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--gray-600);
}

.download-btn {
    background: var(--gray-600);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: 0.8rem 1rem;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.download-btn:hover {
    background: var(--gray-700);
}

/* Assessment Content */
.assessment-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.section-title {
    color: var(--gray-800);
    font-size: 1.3rem;
    margin-bottom: 1rem;
    font-weight: var(--font-semibold);
}

/* Transcript Section */
.transcript-section {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    position: relative;
}

.transcript-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--gray-800);
    min-height: 200px;
    background-color: var(--gray-50);
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-top: 1rem;
    white-space: pre-wrap;
    word-wrap: break-word;
    position: relative;
    transition: all var(--transition-normal);
    font-family: 'Georgia', serif;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

/* Style for default placeholder text */
.transcript-text:not(:empty) {
    color: var(--gray-800);
}

.transcript-text:empty {
    color: var(--gray-500);
    font-style: italic;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}



/* Add animation when transcript is populated */
.transcript-text:not(:empty) {
    animation: transcriptPopulated 0.5s ease-in-out;
    background-color: white;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

@keyframes transcriptPopulated {
    0% { 
        background-color: rgba(102, 126, 234, 0.1);
        border-color: var(--primary-color);
        transform: scale(1.02);
    }
    100% { 
        background-color: white;
        border-color: var(--primary-color);
        transform: scale(1);
    }
}

/* Error Analysis */
.error-analysis {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
}

.error-categories {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.error-category {
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
}

.error-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.error-count {
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: var(--font-bold);
}

/* Different colors for each error category */
.error-category:nth-child(1) .error-count {
    background: #dc3545; /* Red for Mispronunciation */
}

.error-category:nth-child(2) .error-count {
    background: #fd7e14; /* Orange for Omission */
}

.error-category:nth-child(3) .error-count {
    background: #ffc107; /* Yellow for Insertion */
}

.error-category:nth-child(4) .error-count {
    background: #20c997; /* Teal for Incorrect pause */
}

.error-category:nth-child(5) .error-count {
    background: #6f42c1; /* Purple for Missing pause */
}

.error-category:nth-child(6) .error-count {
    background: #e83e8c; /* Pink for Monotone */
}

/* Error Text Styling for Transcript - Colors match error count dots */
.error-insertion {
    text-decoration: line-through;
    background-color: rgba(255, 193, 7, 0.2); /* Yellow background to match yellow dot */
    border: 1px solid rgba(255, 193, 7, 0.4);
    padding: 2px 4px;
    border-radius: 3px;
    color: #856404; /* Dark yellow text */
}

.error-omission {
    background-color: rgba(253, 126, 20, 0.2); /* Orange background to match orange dot */
    border: 1px solid rgba(253, 126, 20, 0.4);
    padding: 2px 4px;
    border-radius: 3px;
    color: #a0522d; /* Dark orange text */
}

.error-mispronunciation {
    background-color: rgba(220, 53, 69, 0.2); /* Red background to match red dot */
    border: 1px solid rgba(220, 53, 69, 0.4);
    padding: 2px 4px;
    border-radius: 3px;
    color: #721c24; /* Dark red text */
}

.error-unexpected-break {
    background-color: rgba(32, 201, 151, 0.2); /* Teal background to match teal dot */
    border: 1px solid rgba(32, 201, 151, 0.4);
    padding: 2px 4px;
    border-radius: 3px;
    color: #0f5132; /* Dark teal text */
}

.error-missing-break {
    background-color: rgba(111, 66, 193, 0.2); /* Purple background to match purple dot */
    border: 1px solid rgba(111, 66, 193, 0.4);
    border-radius: 3px;
    padding: 2px 4px;
    color: #4a1d96; /* Dark purple text */
}

.error-monotone {
    background-color: rgba(232, 62, 140, 0.2); /* Pink background to match pink dot */
    border: 1px solid rgba(232, 62, 140, 0.4);
    border-radius: 3px;
    padding: 2px 4px;
    color: #8b1a4b; /* Dark pink text */
}

.error-type {
    flex: 1;
    font-size: 0.9rem;
    color: var(--gray-700);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--gray-400);
    transition: 0.3s;
    border-radius: 20px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

/* Pronunciation Score */
.pronunciation-score {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
}

.score-display {
    display: flex;
    align-items: center;
    gap: 3rem;
}

.main-score {
    text-align: center;
}

.score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: conic-gradient(var(--primary-color) 0deg 291.6deg, var(--gray-200) 291.6deg 360deg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.score-circle::before {
    content: '';
    position: absolute;
    width: 80px;
    height: 80px;
    background: white;
    border-radius: 50%;
}

.score-number {
    font-size: 2rem;
    font-weight: var(--font-bold);
    color: var(--primary-color);
    z-index: 1;
}

.score-label {
    font-size: 0.9rem;
    color: var(--gray-600);
    z-index: 1;
}

.score-breakdown {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.score-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.score-name {
    width: 120px;
    font-size: 0.9rem;
    color: var(--gray-700);
}

.score-bar {
    flex: 1;
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
}

.score-fill {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.score-value {
    width: 60px;
    text-align: right;
    font-size: 0.9rem;
    color: var(--gray-600);
    font-weight: var(--font-semibold);
}

/* Responsive Design */
@media (max-width: 991.98px) {
    .main-content {
        padding: 1.5rem;
    }
    
    .simple-exercise {
        padding: 2rem;
    }
    
    .french-input {
        font-size: 1.2rem;
        padding: 1.5rem;
    }
    
    .recording-controls {
        flex-direction: column;
        gap: 1rem;
    }
    
    .record-btn, .play-btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Assessment Results Mobile Styles */
    .assessment-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .score-display {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
    }
    
    .audio-player {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .audio-progress {
        width: 100%;
    }
    
    .error-header {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .error-category {
        text-align: center;
    }
    
    /* Navigation tabs improvements for tablet */
    .nav-tabs {
        gap: 0.4rem;
    }
    
    .example-nav-link {
        padding: 0.7rem 0.8rem;
        font-size: 0.95rem;
    }
    
    .example-nav-link[data-example="4"] {
        font-size: 0.85rem;
        line-height: 1.2;
    }
}

@media (max-width: 768px) {
    .nav-tabs {
        padding: 0.25rem;
        gap: 0.25rem;
        margin-bottom: 1.5rem;
        flex-wrap: wrap;
    }
    
    .nav-tabs .nav-item {
        min-width: 0;
        flex: 1;
        min-width: calc(50% - 0.125rem);
    }
    
    .example-nav-link {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        word-break: break-word;
        hyphens: auto;
    }
    
    /* Special handling for the long text button on mobile */
    .example-nav-link[data-example="4"] {
        font-size: 0.75rem;
        padding: 0.6rem 0.3rem;
        line-height: 1.1;
        white-space: normal;
    }
}

@media (max-width: 480px) {
    .nav-tabs {
        padding: 0.2rem;
        gap: 0.2rem;
        flex-direction: column;
    }
    
    .nav-tabs .nav-item {
        min-width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .example-nav-link {
        padding: 0.8rem 0.5rem;
        font-size: 0.9rem;
        min-height: 48px;
        white-space: normal;
        line-height: 1.3;
        word-break: normal;
        hyphens: auto;
    }
    
    .example-nav-link[data-example="4"] {
        font-size: 0.8rem;
        padding: 0.7rem 0.4rem;
    }
    
    .example-nav-link::after {
        display: none; /* Hide the active indicator on very small screens */
    }
}

@media (max-width: 360px) {
    .nav-tabs {
        padding: 0.15rem;
        gap: 0.15rem;
    }
    
    .example-nav-link {
        padding: 0.7rem 0.4rem;
        font-size: 0.8rem;
        min-height: 44px;
    }
    
    .example-nav-link[data-example="4"] {
        font-size: 0.75rem;
        padding: 0.6rem 0.3rem;
    }
}

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

/* Floating Action Button */
.floating-action-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
}

.fab-main {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    color: white;
    font-size: 1.5rem;
}

.fab-main:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.6);
}

.fab-menu {
    position: absolute;
    bottom: 70px;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.floating-action-btn.active .fab-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.fab-item {
    width: 50px;
    height: 50px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--primary-color);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.fab-item:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
    text-decoration: none;
}

/* Responsive adjustments for floating action button */
@media (max-width: 768px) {
    .floating-action-btn {
        bottom: 20px;
        right: 20px;
    }
    
    .fab-main {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .fab-item {
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }
}