/* ============================================
   MODERN AI-POWERED PRONUNCIATION PRACTICE
   Tile-Based, Interactive Design
   ============================================ */

:root {
    /* Greyish Blue Color Palette */
    --white: #ffffff;
    --light-grey: #e8eaed;
    --grey-blue: #5f7c8a;
    --medium-blue: #4a6fa5;
    --dark-blue: #2c3e50;
    --darker-blue: #1a252f;
    
    /* Derived Colors */
    --primary: var(--medium-blue);
    --primary-dark: #3d5a7a;
    --primary-light: #6b8fc4;
    --secondary: var(--grey-blue);
    --accent: var(--medium-blue);
    --success: #4a9b5f;
    --warning: #d4a574;
    --error: #c85a5a;
    
    /* Background Colors */
    --bg-dark: var(--dark-blue);
    --bg-darker: var(--darker-blue);
    --bg-card: rgba(95, 124, 138, 0.15);
    --bg-card-hover: rgba(95, 124, 138, 0.25);
    --bg-light: var(--light-grey);
    
    /* Text Colors */
    --text-primary: var(--white);
    --text-secondary: #d0d7de;
    --text-muted: #9ca3af;
    --text-dark: var(--dark-blue);
    
    /* Borders & Shadows */
    --border-color: rgba(95, 124, 138, 0.3);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 30px rgba(0, 0, 0, 0.6);
    --shadow-2xl: 0 25px 50px rgba(0, 0, 0, 0.7);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--darker-blue);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Clean Background - No Gradients */
.background-animation {
    display: none; /* Remove animated gradient orbs */
}

/* App Container */
.app-container {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Navbar */
.navbar {
    background: rgba(26, 45, 71, 0.5);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    margin-bottom: 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    animation: fadeInDown 0.6s ease-out;
}

.navbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.navbar-brand {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.navbar-logo {
    height: 45px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
    filter: brightness(1.1);
    transition: transform 0.3s ease;
}

.navbar-logo:hover {
    transform: scale(1.05);
}

/* Page Title Section */
.page-title-section {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
    animation: fadeInDown 0.6s ease-out 0.2s both;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--white);
    margin: 0 0 0.5rem 0;
    line-height: 1.2;
}

.page-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin: 0;
}

.navbar-nav {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.nav-item {
    margin: 0;
}

.nav-link {
    display: block;
    padding: 0.6rem 1.2rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    white-space: nowrap;
}

.nav-link:hover {
    background: rgba(95, 124, 138, 0.2);
    color: var(--white);
    transform: translateY(-2px);
}

.nav-link.active {
    background: var(--medium-blue);
    color: var(--white);
}

.logo-icon {
    font-size: 3.5rem;
    color: var(--medium-blue);
    animation: pulse 2s ease-in-out infinite;
}

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

/* Sections */
.section {
    display: none;
    animation: fadeIn 0.5s ease-out;
}

.section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-header {
    margin-bottom: 2rem;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--medium-blue);
}

.section-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Back Button */
.back-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(10px);
}

.back-button:hover {
    background: var(--bg-card-hover);
    border-color: var(--medium-blue);
    transform: translateX(-4px);
}

.back-icon {
    font-size: 1.2rem;
}

/* Tile Grid */
.tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

/* Tile Cards */
.tile-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(20px);
    position: relative;
    overflow: hidden;
}

.tile-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--medium-blue);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1;
}

.tile-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--medium-blue);
    box-shadow: 0 20px 40px rgba(74, 111, 165, 0.3);
}

.tile-card:hover::before {
    opacity: 0.1;
}

.tile-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    display: block;
    transition: transform 0.3s ease;
}

.tile-card:hover .tile-icon {
    transform: scale(1.1) rotate(5deg);
}

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

.tile-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.tile-badge {
    display: inline-block;
    padding: 0.4rem 0.9rem;
    background: var(--medium-blue);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
    margin-top: 0.5rem;
}

/* Setup Card */
.setup-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    backdrop-filter: blur(20px);
    max-width: 600px;
    margin: 0 auto;
}

.form-tile {
    margin-bottom: 1.5rem;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.label-icon {
    font-size: 1.2rem;
}

.modern-input,
.modern-select {
    width: 100%;
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.modern-input:focus,
.modern-select:focus {
    outline: none;
    border-color: var(--medium-blue);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(74, 111, 165, 0.1);
}

.modern-select {
    cursor: pointer;
}

.modern-select option {
    background: var(--bg-dark);
    color: var(--text-primary);
}

/* Buttons */
.primary-button {
    width: 100%;
    padding: 1.25rem 2rem;
    background: var(--medium-blue);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
    margin-top: 1.5rem;
    box-shadow: 0 4px 15px rgba(74, 111, 165, 0.4);
}

.primary-button:hover {
    transform: translateY(-2px);
    background: var(--primary-dark);
    box-shadow: 0 8px 25px rgba(74, 111, 165, 0.5);
}

.primary-button:active {
    transform: translateY(0);
}

.button-icon {
    font-size: 1.3rem;
}

/* Practice Grid - All items full width, stacked vertically */
.practice-grid {
    display: grid;
    grid-template-columns: 1fr; /* Single column - all items full width */
    gap: 2rem;
    margin-top: 2rem;
    width: 100%;
    box-sizing: border-box;
}

/* Practice Item Tile */
.practice-item-tile {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.75rem;
    backdrop-filter: blur(20px);
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
    overflow: hidden; /* Prevent content overflow */
}

.practice-item-tile:hover {
    border-color: var(--medium-blue);
    box-shadow: 0 10px 30px rgba(74, 111, 165, 0.2);
}

.practice-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center; /* Center align vertically */
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    overflow: hidden; /* Prevent overflow */
}

.practice-item-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    flex: 1;
    min-width: 0;
    white-space: normal; /* Allow wrapping */
    overflow: visible;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.6;
    padding-right: 1rem;
    max-width: calc(100% - 60px); /* Reserve space for button */
}

.speak-button {
    width: 44px;
    height: 44px;
    min-width: 44px; /* Prevent shrinking */
    flex-shrink: 0; /* Don't shrink */
    border-radius: 12px;
    background: var(--medium-blue);
    border: none;
    color: white;
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(74, 111, 165, 0.3);
}

.speak-button:hover {
    transform: scale(1.1);
    background: var(--primary-dark);
    box-shadow: 0 6px 20px rgba(74, 111, 165, 0.4);
}

.record-button {
    width: 100%;
    padding: 1rem 1.5rem;
    background: var(--error);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
    margin-bottom: 1.25rem;
    white-space: nowrap; /* Prevent text wrapping in button */
}

.record-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.record-button.recording {
    background: var(--warning);
    animation: pulse-record 1.5s ease-in-out infinite;
}

@keyframes pulse-record {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(245, 158, 11, 0);
    }
}

.recording-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 12px;
    margin-bottom: 1.25rem;
    width: 100%;
    flex-wrap: wrap;
}

.recording-status span {
    flex: 1;
    min-width: 0;
    word-wrap: break-word;
}

.recording-indicator {
    width: 12px;
    height: 12px;
    background: var(--warning);
    border-radius: 50%;
    animation: blink 1s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.submit-button {
    width: 100%;
    padding: 1rem 1.5rem;
    background: var(--success);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    white-space: nowrap;
    box-sizing: border-box;
}

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

.submit-button.hidden {
    display: none !important;
}

.stop-button {
    margin-left: auto;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    background: var(--error);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.stop-button:hover {
    background: #dc2626;
    transform: scale(1.05);
}

/* Results Tile - Horizontal Layout */
.result-tile {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    backdrop-filter: blur(20px);
    width: 100%;
    box-sizing: border-box;
    overflow-x: auto;
    overflow-y: hidden;
    display: flex;
    flex-direction: row;
    gap: 1.5rem;
    max-height: 600px;
    scrollbar-width: thin;
    scrollbar-color: var(--grey-blue) var(--bg-darker);
}

.result-tile::-webkit-scrollbar {
    height: 8px;
}

.result-tile::-webkit-scrollbar-track {
    background: var(--bg-darker);
    border-radius: 4px;
}

.result-tile::-webkit-scrollbar-thumb {
    background: var(--grey-blue);
    border-radius: 4px;
}

.result-tile::-webkit-scrollbar-thumb:hover {
    background: var(--medium-blue);
}

.result-header {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
    min-width: 200px;
    flex-shrink: 0;
}

.result-header > div:first-child {
    width: 100%;
}

.result-header .accuracy-badge {
    margin-top: 0.5rem;
}

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

.result-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 400;
}

.accuracy-badge {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--success);
}

.accuracy-badge.medium {
    color: var(--warning);
}

.accuracy-badge.low {
    color: var(--error);
}

/* Warning Box */
.warning-box {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(200, 90, 90, 0.15);
    border: 1px solid rgba(200, 90, 90, 0.3);
    border-radius: 8px;
    margin-top: 1rem;
    backdrop-filter: blur(10px);
    font-size: 0.85rem;
}

.warning-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.warning-content {
    flex: 1;
}

.warning-title {
    font-weight: 600;
    color: var(--error);
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.warning-text {
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.5;
}

/* Result Sections - Horizontal Layout */
.result-section {
    margin-bottom: 0;
    padding: 0 1rem 0 0;
    border-right: 1px solid var(--border-color);
    width: auto;
    min-width: 300px;
    max-width: 400px;
    box-sizing: border-box;
    overflow-y: auto;
    overflow-x: hidden;
    flex-shrink: 0;
    max-height: 550px;
    scrollbar-width: thin;
    scrollbar-color: var(--grey-blue) transparent;
}

.result-section::-webkit-scrollbar {
    width: 6px;
}

.result-section::-webkit-scrollbar-track {
    background: transparent;
}

.result-section::-webkit-scrollbar-thumb {
    background: var(--grey-blue);
    border-radius: 3px;
}

.result-section:last-child {
    border-right: none;
    padding-right: 0;
}

/* Ensure proper spacing in all sections */
.recording-section {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.recording-section > * {
    width: 100%;
    box-sizing: border-box;
}

/* Prevent text overflow in all text elements */
* {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Ensure buttons don't overlap */
button, .submit-button, .record-button, .speak-button {
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Better spacing for result tile */
.result-tile > * {
    margin-bottom: 1.5rem;
}

.result-tile > *:last-child {
    margin-bottom: 0;
}

.section-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.section-label .label-icon {
    font-size: 1.2rem;
}

.feedback-content {
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: 0.95rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border-left: 3px solid var(--medium-blue);
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    margin-top: 0.5rem;
    width: 100%;
    box-sizing: border-box;
    overflow-y: auto;
    max-height: 200px;
}

/* Phone Metrics Table - Horizontal Scroll */
.phone-metrics-table {
    margin-top: 0.5rem;
    overflow-x: auto;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    padding: 0.75rem;
    max-height: 300px;
    max-width: 100%;
    scrollbar-width: thin;
    scrollbar-color: var(--grey-blue) transparent;
}

.phone-metrics-table::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.phone-metrics-table::-webkit-scrollbar-track {
    background: transparent;
}

.phone-metrics-table::-webkit-scrollbar-thumb {
    background: var(--grey-blue);
    border-radius: 3px;
}

.phone-table-header {
    display: grid;
    grid-template-columns: 100px 1fr 100px 80px;
    gap: 1rem;
    padding: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.phone-metric-row {
    display: grid;
    grid-template-columns: 100px 1fr 100px 80px;
    gap: 1rem;
    padding: 0.875rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    transition: all 0.2s ease;
    align-items: center;
}

.phone-metric-row:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(4px);
}

.phone-metric-row.correct {
    background: rgba(16, 185, 129, 0.08);
    border-left: 3px solid var(--success);
}

.phone-metric-row.incorrect {
    background: rgba(239, 68, 68, 0.08);
    border-left: 3px solid var(--error);
}

.phone-symbol {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1rem;
}

.phone-col {
    color: var(--text-secondary);
}

.accuracy-cell {
    font-weight: 600;
    color: var(--text-primary);
}

.status-cell {
    font-size: 1.2rem;
    text-align: center;
    font-weight: 700;
}

.phone-metric-row.correct .status-cell {
    color: var(--success);
}

.phone-metric-row.incorrect .status-cell {
    color: var(--error);
}

/* Audio Actions */
.audio-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
    width: 100%;
}

.audio-action-btn {
    flex: 1;
    min-width: 200px;
    max-width: 100%;
    padding: 1rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
}

.audio-action-btn .btn-icon {
    flex-shrink: 0;
    font-size: 1.2rem;
}

.audio-action-btn .btn-label {
    flex: 1;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

/* Audio Preview */
.recording-preview {
    width: 100% !important;
    margin-top: 1.25rem !important;
    margin-bottom: 1.25rem !important;
    box-sizing: border-box;
    display: block;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .logo-image {
        height: 40px;
        max-width: 150px;
    }
    
    .logo-section {
        gap: 1rem;
    }
    
    .app-title {
        font-size: 1.75rem;
    }
    
    .app-subtitle {
        font-size: 0.9rem;
    }
    .practice-item-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .practice-item-text {
        font-size: 1.25rem;
        padding-right: 0;
        width: 100%;
    }
    
    .speak-button {
        align-self: flex-end;
    }
    
    .result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .result-header .accuracy-badge {
        font-size: 2rem;
    }
    
    .audio-actions {
        flex-direction: column;
    }
    
    .audio-action-btn {
        width: 100%;
        min-width: 100%;
    }
    
    .practice-item-tile {
        padding: 1.25rem;
    }
    
    .result-tile {
        padding: 1rem;
        flex-direction: column;
        max-height: none;
        overflow-y: auto;
        overflow-x: hidden;
    }
    
    .result-section {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 0 0 1rem 0;
        margin-bottom: 1rem;
        min-width: 100%;
        max-width: 100%;
        max-height: none;
    }
    
    .result-section:last-child {
        border-bottom: none;
        margin-bottom: 0;
        padding-bottom: 0;
    }
    
    .result-header {
        border-bottom: 2px solid var(--border-color);
        padding-bottom: 1rem;
        margin-bottom: 1rem;
    }
}

.audio-action-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--medium-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 111, 165, 0.2);
}

.audio-action-btn .btn-icon {
    font-size: 1.3rem;
}

.audio-action-btn .btn-label {
    flex: 1;
    text-align: left;
}

/* Content Scores */
.content-scores {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
}

.score-item {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    text-align: center;
}

.score-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.score-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Key Points List */
.key-points-list {
    margin-top: 0.5rem;
}

.key-point-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem;
    margin-bottom: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border-left: 3px solid var(--success);
    transition: all 0.2s ease;
}

.key-point-item:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(4px);
}

.key-point-item .point-icon {
    color: var(--success);
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.key-point-item span:last-child {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Loading Overlay - Professional, No Blur */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 37, 47, 0.85); /* Subtle dark overlay, no blur */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.loading-content {
    text-align: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 3rem 4rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px);
}

.spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 1.5rem;
    position: relative;
}

.spinner::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid rgba(74, 111, 165, 0.2);
    border-top-color: var(--medium-blue);
    border-right-color: var(--medium-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border: 2px solid rgba(74, 111, 165, 0.3);
    border-top-color: var(--primary-light);
    border-radius: 50%;
    animation: spin 0.6s linear infinite reverse;
}

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

.loading-text {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-top: 0.5rem;
}

.loading-text::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .app-container {
        padding: 1rem;
    }
    
    .navbar-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding: 1rem;
    }
    
    .navbar-nav {
        width: 100%;
        justify-content: flex-start;
        gap: 0.25rem;
    }
    
    .nav-link {
        padding: 0.5rem 0.9rem;
        font-size: 0.85rem;
    }
    
    .navbar-logo {
        height: 40px;
        max-width: 150px;
    }
    
    .tile-grid {
        grid-template-columns: 1fr;
    }
    
    .practice-grid {
        grid-template-columns: 1fr !important;
    }
    
    .practice-grid > .practice-item-tile {
        grid-column: 1 / -1 !important;
    }
    
    .practice-item-text {
        white-space: normal; /* Allow wrapping on mobile */
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .navbar-logo {
        height: 35px;
        max-width: 120px;
    }
    
    .navbar-content {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .navbar-brand {
        width: 100%;
        justify-content: center;
    }
    
    .navbar-nav {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .nav-link {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }
    
    .page-title {
        font-size: 1.75rem;
    }
    
    .page-subtitle {
        font-size: 0.9rem;
    }
    
    .page-title-section {
        padding: 1rem 0;
        margin-bottom: 1.5rem;
    }
}

/* TTS Controls */
.tts-controls {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.tts-play-button,
.tts-pause-button,
.tts-reset-button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 120px;
    justify-content: center;
}

.tts-play-button {
    background: var(--success);
    color: white;
}

.tts-play-button:hover {
    background: #3d8b5f;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 155, 95, 0.4);
}

.tts-pause-button {
    background: var(--warning);
    color: white;
}

.tts-pause-button:hover {
    background: #d4945a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 165, 116, 0.4);
}

.tts-reset-button {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.tts-reset-button:hover {
    background: var(--bg-card-hover);
    border-color: var(--medium-blue);
    transform: translateY(-2px);
}

/* TTS Text with Word Highlighting */
.tts-text {
    font-size: 1.3rem;
    line-height: 1.8;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin-bottom: 1rem;
    white-space: normal;
    word-wrap: break-word;
    overflow-x: auto;
    max-height: 300px;
    overflow-y: auto;
}

.tts-word {
    transition: all 0.2s ease;
    padding: 2px 4px;
    border-radius: 4px;
    display: inline-block;
}

.tts-word-active {
    background: var(--medium-blue);
    color: white;
    font-weight: 700;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(74, 111, 165, 0.5);
}

/* ==================== Speech-to-Text (STT) Styles ==================== */

.stt-controls {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.stt-reference-button,
.stt-record-button,
.stt-stop-button,
.stt-analyze-button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stt-reference-button {
    background: var(--light-turquoise);
    color: var(--dark-navy);
}

.stt-reference-button:hover {
    background: var(--medium-teal);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(72, 209, 204, 0.3);
}

.stt-record-button {
    background: #e74c3c;
    color: white;
}

.stt-record-button:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.stt-stop-button {
    background: #95a5a6;
    color: white;
}

.stt-stop-button:hover {
    background: #7f8c8d;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(149, 165, 166, 0.3);
}

.stt-analyze-button {
    background: var(--medium-teal);
    color: white;
    margin-top: 1rem;
}

.stt-analyze-button:hover {
    background: var(--dark-navy);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 45, 71, 0.3);
}

.stt-transcript {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.stt-transcript-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stt-transcript-text {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-primary);
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    min-height: 60px;
}

.stt-result {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: rgba(26, 45, 71, 0.3);
    border-radius: 12px;
    border: 1px solid var(--medium-teal);
}

.stt-analysis-header {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--medium-teal);
}

.stt-analysis-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.stt-analysis-header h3 {
    color: var(--light-turquoise);
    margin: 0;
    font-size: 1.5rem;
}

.stt-toggle-button {
    background: var(--medium-teal);
    border: none;
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    font-size: 1.2rem;
}

.stt-toggle-button:hover {
    background: var(--dark-navy);
    transform: scale(1.1);
}

.toggle-icon {
    display: block;
    font-size: 1rem;
    line-height: 1;
}

.stt-accuracy-summary {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.stt-accuracy-score {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--light-turquoise);
}

.stt-word-accuracy {
    font-size: 1rem;
    color: var(--text-secondary);
}

.stt-analysis-content.hidden {
    display: none;
}

.stt-analysis-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.stt-feedback-section,
.stt-strengths-section,
.stt-improvements-section,
.stt-errors-section {
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.stt-feedback-section h4,
.stt-strengths-section h4,
.stt-improvements-section h4,
.stt-errors-section h4 {
    color: var(--light-turquoise);
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.stt-feedback-section p {
    color: var(--text-primary);
    line-height: 1.6;
}

.stt-strengths-section ul,
.stt-improvements-section ul,
.stt-errors-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.stt-strengths-section li,
.stt-improvements-section li,
.stt-errors-section li {
    color: var(--text-primary);
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    line-height: 1.5;
}

.stt-strengths-section li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #27ae60;
    font-weight: bold;
}

.stt-improvements-section li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: #f39c12;
    font-weight: bold;
}

.stt-errors-section li::before {
    content: "✗";
    position: absolute;
    left: 0;
    color: #e74c3c;
    font-weight: bold;
}

