/* 📱 COMPREHENSIVE RESPONSIVE DESIGN SYSTEM */

/* ========================================
   BREAKPOINT SYSTEM
   ======================================== */

/* 
   Mobile First Approach:
   - Mobile: 320px - 767px
   - Tablet: 768px - 1023px  
   - Desktop: 1024px+
   
   Orientation Support:
   - Portrait & Landscape for all devices
*/

/* ========================================
   HEADER RESPONSIVE DESIGN
   ======================================== */

/* Desktop Header - Ensure content doesn't get pushed out */
@media (min-width: 1024px) {
    .header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 25px 30px;
        flex-wrap: nowrap;
        min-height: 80px;
        max-width: 100%;
        overflow: hidden;
    }

    .header-left {
        display: flex;
        align-items: center;
        gap: 20px;
        flex-shrink: 1;
        min-width: 0;
        max-width: 60%;
    }

    .header-title {
        font-size: 2.2rem;
        font-weight: 700;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        flex-shrink: 1;
        min-width: 0;
    }

    .version-badge {
        flex-shrink: 0;
        font-size: 0.8rem;
        padding: 4px 8px;
    }

    .header-right {
        display: flex;
        align-items: center;
        gap: 15px;
        flex-shrink: 0;
        max-width: 40%;
    }

    .current-plan-display {
        padding: 12px 20px;
        font-size: 0.9rem;
        white-space: nowrap;
        flex-shrink: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 200px;
    }

    .profile-btn {
        flex-shrink: 0;
        min-width: 45px;
        height: 45px;
    }
}

/* Medium Desktop - Adjust for smaller desktop screens */
@media (min-width: 1024px) and (max-width: 1199px) {
    .header-title {
        font-size: 2rem;
    }

    .header-left {
        max-width: 55%;
    }

    .header-right {
        max-width: 45%;
    }

    .current-plan-display {
        padding: 10px 16px;
        font-size: 0.85rem;
        max-width: 180px;
    }
}

/* Large Desktop - More spacing */
@media (min-width: 1440px) {
    .header {
        padding: 30px 40px;
        min-height: 90px;
    }

    .header-left {
        gap: 25px;
    }

    .header-title {
        font-size: 2.5rem;
    }

    .header-right {
        gap: 20px;
    }

    .current-plan-display {
        padding: 15px 25px;
        font-size: 1rem;
    }
}

/* Tablet Header */
@media (min-width: 768px) and (max-width: 1023px) {
    .header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 25px 20px;
        flex-wrap: nowrap;
    }

    .header-left {
        display: flex;
        align-items: center;
        gap: 15px;
        flex-shrink: 0;
    }

    .header-title {
        font-size: 1.8rem;
        font-weight: 700;
    }

    .header-right {
        display: flex;
        align-items: center;
        gap: 12px;
        flex-shrink: 0;
    }

    .current-plan-display {
        padding: 10px 16px;
        font-size: 0.85rem;
        white-space: nowrap;
    }
}

/* ========================================
   MOBILE DEVICES (320px - 767px)
   ======================================== */

/* Mobile Header - Vertical Stack */
@media (max-width: 767px) {
    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        padding: 20px 15px;
    }

    .header-left {
        justify-content: center;
        flex-direction: column;
        gap: 10px;
    }

    .header-title {
        font-size: 1.8rem;
        font-weight: 700;
    }

    .version-badge {
        font-size: 0.7rem;
        padding: 3px 6px;
    }

    .header-right {
        justify-content: center;
        gap: 12px;
    }

    .current-plan-display {
        padding: 10px 15px;
        font-size: 0.8rem;
    }

    .profile-btn {
        width: 40px;
        height: 40px;
    }
}

/* Extra Small Mobile (320px - 374px) */
@media (max-width: 374px) {
    #app {
        padding: 10px 10px 85px 10px;
    }

    .header {
        padding: 15px 10px;
        gap: 12px;
    }

    .header-title {
        font-size: 1.5rem;
    }

    .current-plan-display {
        padding: 8px 12px;
        font-size: 0.7rem;
    }

    .profile-btn {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }

    .nav-container {
        gap: 5px;
        padding: 0 5px;
    }

    .nav-btn {
        min-height: 55px;
        max-width: 65px;
    }

    .nav-icon {
        font-size: 1.4rem;
    }

    .nav-label {
        font-size: 0.6rem;
    }

    .welcome-section {
        padding: 40px 15px;
    }

    .welcome-title {
        font-size: 1.8rem;
    }

    .welcome-subtitle {
        font-size: 0.9rem;
    }
}

/* Small Mobile (375px - 479px) */
@media (min-width: 375px) and (max-width: 479px) {
    #app {
        padding: 15px 15px 90px 15px;
    }

    .header {
        padding: 20px 15px;
    }

    .nav-container {
        gap: 8px;
        padding: 0 8px;
    }

    .nav-btn {
        min-height: 60px;
        max-width: 70px;
    }

    .welcome-section {
        padding: 50px 20px;
    }
}

/* Medium Mobile (480px - 767px) */
@media (min-width: 480px) and (max-width: 767px) {
    #app {
        padding: 20px 20px 95px 20px;
    }

    .header {
        padding: 25px 20px;
    }

    .nav-container {
        gap: 12px;
        padding: 0 15px;
    }

    .nav-btn {
        min-height: 65px;
        max-width: 75px;
    }

    .welcome-section {
        padding: 60px 25px;
    }
}

/* ========================================
   MOBILE LANDSCAPE ORIENTATION
   ======================================== */

@media (max-width: 767px) and (orientation: landscape) {
    /* Reduce vertical spacing in landscape */
    #app {
        padding-top: 10px;
        padding-bottom: 75px;
    }

    .header {
        padding: 15px 20px;
        flex-direction: row;
        justify-content: space-between;
    }

    .header-left, .header-right {
        flex-direction: row;
        gap: 15px;
    }

    .welcome-section {
        padding: 30px 25px;
        margin-bottom: 20px;
    }

    .welcome-title {
        font-size: 2rem;
    }

    .welcome-subtitle {
        font-size: 1rem;
    }

    .welcome-icon {
        font-size: 3.5rem;
    }

    /* Compact bottom navigation */
    .bottom-nav {
        padding: 8px 15px 15px 15px;
    }

    .nav-btn {
        min-height: 50px;
        max-width: 80px;
    }

    .nav-icon {
        font-size: 1.4rem;
    }

    .nav-label {
        font-size: 0.6rem;
    }

    /* Adjust main content areas */
    .main-content {
        padding-bottom: 80px;
    }

    /* Translation displays more compact */
    .translation-display {
        padding: 15px;
        margin: 10px 0;
    }

    /* History items more compact */
    .history-item {
        padding: 12px 15px;
    }
}

/* ========================================
   TABLET DEVICES (768px - 1023px)
   ======================================== */

@media (min-width: 768px) and (max-width: 1023px) {
    #app {
        padding: 25px 30px 100px 30px;
        max-width: 900px;
        margin: 0 auto;
    }

    .header {
        padding: 30px 25px;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .header-title {
        font-size: 2rem;
    }

    .current-plan-display {
        padding: 12px 20px;
        font-size: 0.9rem;
    }

    .nav-container {
        gap: 20px;
        padding: 0 20px;
        max-width: 500px;
    }

    .nav-btn {
        min-height: 70px;
        max-width: 90px;
    }

    .nav-icon {
        font-size: 1.8rem;
    }

    .nav-label {
        font-size: 0.8rem;
    }

    .welcome-section {
        padding: 80px 40px;
    }

    .welcome-title {
        font-size: 2.8rem;
    }

    .welcome-subtitle {
        font-size: 1.2rem;
    }

    .welcome-icon {
        font-size: 5rem;
    }

    /* Two-column layout for some content */
    .translation-display {
        max-width: 600px;
        margin: 20px auto;
    }

    .history-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 20px;
    }
}

/* ========================================
   TABLET LANDSCAPE ORIENTATION
   ======================================== */

@media (min-width: 768px) and (max-width: 1023px) and (orientation: landscape) {
    #app {
        padding: 20px 40px 90px 40px;
    }

    .header {
        padding: 20px 30px;
    }

    .welcome-section {
        padding: 50px 40px;
        display: grid;
        grid-template-columns: 1fr 1fr;
        align-items: center;
        gap: 40px;
        text-align: left;
    }

    .welcome-content {
        order: 1;
    }

    .welcome-icon {
        order: 2;
        justify-self: center;
        font-size: 4rem;
    }

    /* Side-by-side layout for translation interface */
    .translation-interface {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 30px;
        max-width: 900px;
        margin: 0 auto;
    }
}

/* ========================================
   DESKTOP DEVICES (1024px+)
   ======================================== */

@media (min-width: 1024px) {
    #app {
        padding: 30px 40px 110px 40px;
        max-width: 1200px;
        margin: 0 auto;
    }

    .header {
        padding: 35px 30px;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .header-title {
        font-size: 2.2rem;
    }

    .current-plan-display {
        padding: 15px 25px;
        font-size: 1rem;
    }

    .nav-container {
        gap: 25px;
        padding: 0 30px;
        max-width: 600px;
    }

    .nav-btn {
        min-height: 75px;
        max-width: 100px;
        transition: transform 0.2s ease;
    }

    .nav-btn:hover {
        transform: translateY(-2px);
    }

    .nav-icon {
        font-size: 2rem;
    }

    .nav-label {
        font-size: 0.85rem;
    }

    .welcome-section {
        padding: 100px 50px;
        display: grid;
        grid-template-columns: 1fr 1fr;
        align-items: center;
        gap: 60px;
        text-align: left;
    }

    .welcome-title {
        font-size: 3.2rem;
    }

    .welcome-subtitle {
        font-size: 1.3rem;
    }

    .welcome-icon {
        font-size: 6rem;
        justify-self: center;
    }

    /* Multi-column layouts */
    .history-grid {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
        gap: 25px;
    }

    .translation-display {
        max-width: 700px;
        margin: 25px auto;
    }

    /* Desktop-specific features */
    .nav-btn {
        cursor: pointer;
    }

    .nav-btn:hover .nav-icon {
        transform: scale(1.1);
    }
}

/* ========================================
   LARGE DESKTOP (1440px+)
   ======================================== */

@media (min-width: 1440px) {
    #app {
        max-width: 1400px;
        padding: 40px 60px 120px 60px;
    }

    .welcome-section {
        padding: 120px 80px;
        gap: 80px;
    }

    .welcome-title {
        font-size: 3.5rem;
    }

    .welcome-icon {
        font-size: 7rem;
    }

    .history-grid {
        grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
        gap: 30px;
    }
}

/* ========================================
   ULTRA-WIDE DISPLAYS (1920px+)
   ======================================== */

@media (min-width: 1920px) {
    #app {
        max-width: 1600px;
    }

    .history-grid {
        grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    }
}

/* ========================================
   OVERLAY RESPONSIVE DESIGN
   ======================================== */

/* Base Overlay Centering - Apply to all overlays */
.overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.overlay-content {
    margin: 0 auto;
    position: relative;
}

/* Mobile Overlays */
@media (max-width: 767px) {
    .overlay {
        padding: 15px;
        align-items: flex-start;
        padding-top: 40px;
    }

    .overlay-content {
        width: 95%;
        max-width: none;
        margin: 0 auto;
        padding: 25px 20px;
        max-height: 85vh;
        border-radius: 20px;
    }

    .overlay-header {
        padding-bottom: 20px;
        margin-bottom: 20px;
    }

    .overlay-title {
        font-size: 1.5rem;
    }

    .close-btn {
        width: 35px;
        height: 35px;
        font-size: 1.2rem;
    }

    /* Profile Overlay Mobile */
    .profile-stats {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }

    .current-plan-section {
        padding: 20px;
        margin: 20px 0;
    }

    .plan-limits-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    /* Upgrade Overlay Mobile */
    .upgrade-plans {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .plan-card {
        padding: 25px 20px;
    }

    .plan-price {
        font-size: 1.8rem;
    }

    .plan-features {
        font-size: 0.9rem;
    }

    /* Settings Overlay Mobile */
    .settings-section {
        padding: 20px;
        margin-bottom: 20px;
    }

    .settings-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

/* Mobile Landscape Overlays */
@media (max-width: 767px) and (orientation: landscape) {
    .overlay-content {
        width: 90%;
        max-height: 80vh;
        margin: 10px auto;
        padding: 20px;
    }

    .overlay-title {
        font-size: 1.3rem;
    }

    .profile-stats {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }

    .current-plan-section {
        padding: 15px;
        margin: 15px 0;
    }

    .plan-limits-grid {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }

    .upgrade-plans {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 15px;
    }

    .plan-card {
        padding: 20px 15px;
    }
}

/* Tablet Overlays */
@media (min-width: 768px) and (max-width: 1023px) {
    .overlay {
        align-items: center;
        justify-content: center;
        padding: 30px;
    }

    .overlay-content {
        width: 80%;
        max-width: 600px;
        padding: 35px 30px;
        border-radius: 25px;
        margin: 0 auto;
    }

    .overlay-title {
        font-size: 1.8rem;
    }

    .profile-stats {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }

    .plan-limits-grid {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }

    .upgrade-plans {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 25px;
    }

    .settings-grid {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }
}

/* Desktop Overlays */
@media (min-width: 1024px) {
    .overlay {
        align-items: center;
        justify-content: center;
        padding: 40px;
    }

    .overlay-content {
        width: 70%;
        max-width: 800px;
        padding: 40px 35px;
        border-radius: 30px;
        margin: 0 auto;
    }

    .overlay-title {
        font-size: 2rem;
    }

    .profile-stats {
        grid-template-columns: repeat(4, 1fr);
        gap: 25px;
    }

    .plan-limits-grid {
        grid-template-columns: 1fr 1fr;
        gap: 25px;
    }

    .upgrade-plans {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 30px;
    }

    .plan-card:hover {
        transform: translateY(-5px);
    }

    .settings-grid {
        grid-template-columns: 1fr 1fr;
        gap: 25px;
    }
}

/* ========================================
   CAMERA & VOICE INTERFACE RESPONSIVE
   ======================================== */

/* Mobile Camera Interface */
@media (max-width: 767px) {
    .camera-container {
        padding: 15px;
    }

    .camera-preview {
        border-radius: 15px;
        max-height: 60vh;
    }

    .camera-controls {
        gap: 15px;
        padding: 20px 15px;
    }

    .capture-btn {
        width: 70px;
        height: 70px;
        font-size: 1.5rem;
    }

    .camera-action-btn {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    /* Voice Interface Mobile */
    .voice-container {
        padding: 20px 15px;
    }

    .voice-visualizer {
        height: 150px;
        margin: 20px 0;
    }

    .voice-controls {
        gap: 20px;
    }

    .voice-btn {
        width: 80px;
        height: 80px;
        font-size: 2rem;
    }
}

/* Tablet Camera & Voice */
@media (min-width: 768px) and (max-width: 1023px) {
    .camera-container {
        padding: 25px;
        max-width: 600px;
        margin: 0 auto;
    }

    .camera-preview {
        border-radius: 20px;
        max-height: 70vh;
    }

    .capture-btn {
        width: 80px;
        height: 80px;
        font-size: 1.8rem;
    }

    .voice-container {
        padding: 30px 25px;
        max-width: 500px;
        margin: 0 auto;
    }

    .voice-visualizer {
        height: 180px;
    }

    .voice-btn {
        width: 90px;
        height: 90px;
        font-size: 2.2rem;
    }
}

/* Desktop Camera & Voice */
@media (min-width: 1024px) {
    .camera-container {
        padding: 35px;
        max-width: 800px;
        margin: 0 auto;
    }

    .camera-preview {
        border-radius: 25px;
        max-height: 75vh;
    }

    .capture-btn {
        width: 90px;
        height: 90px;
        font-size: 2rem;
    }

    .camera-action-btn:hover {
        transform: scale(1.1);
    }

    .voice-container {
        padding: 40px 35px;
        max-width: 600px;
        margin: 0 auto;
    }

    .voice-visualizer {
        height: 200px;
    }

    .voice-btn {
        width: 100px;
        height: 100px;
        font-size: 2.5rem;
        transition: transform 0.2s ease;
    }

    .voice-btn:hover {
        transform: scale(1.05);
    }
}

/* ========================================
   TRANSLATION OVERLAYS RESPONSIVE
   ======================================== */

/* Voice Translation Overlay */
@media (max-width: 767px) {
    #voice-translation-overlay .overlay-content {
        width: 95%;
        max-height: 85vh;
        padding: 20px 15px;
    }

    .voice-interface {
        padding: 15px;
    }

    .voice-visualizer {
        height: 150px;
        margin: 15px 0;
        border-radius: 15px;
    }

    .voice-controls {
        gap: 15px;
        padding: 15px 0;
    }

    .voice-btn {
        width: 70px;
        height: 70px;
        font-size: 1.8rem;
    }

    .voice-status {
        font-size: 0.9rem;
        padding: 8px 15px;
    }

    .language-selector {
        flex-direction: column;
        gap: 12px;
        margin: 15px 0;
    }

    .language-dropdown {
        width: 100%;
        padding: 12px;
        font-size: 0.9rem;
    }
}

/* Voice Translation Overlay - Mobile Landscape */
@media (max-width: 767px) and (orientation: landscape) {
    #voice-translation-overlay .overlay-content {
        max-height: 80vh;
        padding: 15px;
    }

    .voice-visualizer {
        height: 100px;
        margin: 10px 0;
    }

    .voice-controls {
        gap: 12px;
        padding: 10px 0;
    }

    .voice-btn {
        width: 60px;
        height: 60px;
        font-size: 1.6rem;
    }

    .language-selector {
        flex-direction: row;
        gap: 10px;
        margin: 10px 0;
    }

    .language-dropdown {
        flex: 1;
        padding: 8px;
        font-size: 0.8rem;
    }
}

/* Camera Translation Overlay */
@media (max-width: 767px) {
    #camera-translation-overlay .overlay-content {
        width: 95%;
        max-height: 90vh;
        padding: 15px;
    }

    .camera-interface {
        padding: 10px;
    }

    .camera-preview {
        max-height: 60vh;
        border-radius: 15px;
        margin: 10px 0;
    }

    .camera-controls {
        gap: 15px;
        padding: 15px 10px;
        justify-content: center;
    }

    .capture-btn {
        width: 70px;
        height: 70px;
        font-size: 1.5rem;
        border-radius: 50%;
    }

    .camera-action-btn {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
        border-radius: 12px;
    }

    .camera-status {
        font-size: 0.9rem;
        padding: 8px 15px;
        margin: 10px 0;
    }

    .ocr-results {
        max-height: 200px;
        padding: 15px;
        margin: 15px 0;
        font-size: 0.9rem;
    }
}

/* Camera Translation Overlay - Mobile Landscape */
@media (max-width: 767px) and (orientation: landscape) {
    #camera-translation-overlay .overlay-content {
        max-height: 85vh;
        padding: 12px;
    }

    .camera-preview {
        max-height: 50vh;
        border-radius: 12px;
    }

    .camera-controls {
        gap: 12px;
        padding: 12px 8px;
    }

    .capture-btn {
        width: 60px;
        height: 60px;
        font-size: 1.4rem;
    }

    .camera-action-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .ocr-results {
        max-height: 150px;
        padding: 12px;
        margin: 10px 0;
        font-size: 0.8rem;
    }
}

/* Tablet Translation Overlays */
@media (min-width: 768px) and (max-width: 1023px) {
    #voice-translation-overlay .overlay-content,
    #camera-translation-overlay .overlay-content {
        width: 85%;
        max-width: 600px;
        padding: 25px;
    }

    .voice-visualizer {
        height: 180px;
        margin: 20px 0;
    }

    .voice-btn {
        width: 80px;
        height: 80px;
        font-size: 2rem;
    }

    .camera-preview {
        max-height: 65vh;
        border-radius: 20px;
    }

    .capture-btn {
        width: 80px;
        height: 80px;
        font-size: 1.8rem;
    }

    .camera-action-btn {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    .language-selector {
        flex-direction: row;
        gap: 20px;
    }

    .language-dropdown {
        flex: 1;
        padding: 12px;
    }
}

/* Desktop Translation Overlays */
@media (min-width: 1024px) {
    #voice-translation-overlay .overlay-content {
        width: 70%;
        max-width: 700px;
        padding: 35px;
    }

    #camera-translation-overlay .overlay-content {
        width: 75%;
        max-width: 900px;
        padding: 35px;
    }

    .voice-visualizer {
        height: 200px;
        margin: 25px 0;
    }

    .voice-btn {
        width: 90px;
        height: 90px;
        font-size: 2.2rem;
        transition: transform 0.2s ease;
    }

    .voice-btn:hover {
        transform: scale(1.05);
    }

    .camera-preview {
        max-height: 70vh;
        border-radius: 25px;
    }

    .capture-btn {
        width: 90px;
        height: 90px;
        font-size: 2rem;
        transition: transform 0.2s ease;
    }

    .capture-btn:hover {
        transform: scale(1.05);
    }

    .camera-action-btn {
        width: 55px;
        height: 55px;
        font-size: 1.3rem;
        transition: transform 0.2s ease;
    }

    .camera-action-btn:hover {
        transform: scale(1.1);
    }

    .language-selector {
        flex-direction: row;
        gap: 25px;
    }

    .language-dropdown {
        flex: 1;
        padding: 15px;
        font-size: 1rem;
    }

    .ocr-results {
        max-height: 300px;
        padding: 20px;
        margin: 20px 0;
    }
}

/* ========================================
   TRANSLATION RESULTS RESPONSIVE
   ======================================== */

@media (max-width: 767px) {
    .translation-display {
        padding: 15px;
        margin: 10px 0;
        border-radius: 15px;
    }

    .translation-text {
        font-size: 0.95rem;
        line-height: 1.4;
    }

    .translation-actions {
        gap: 8px;
        margin-top: 12px;
    }

    .action-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
        border-radius: 8px;
    }

    .confidence-score {
        font-size: 0.75rem;
        padding: 4px 8px;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .translation-display {
        padding: 20px;
        margin: 15px 0;
        border-radius: 18px;
        max-width: 600px;
        margin-left: auto;
        margin-right: auto;
    }

    .translation-actions {
        gap: 12px;
        margin-top: 15px;
    }

    .action-btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
}

@media (min-width: 1024px) {
    .translation-display {
        padding: 25px;
        margin: 20px auto;
        border-radius: 20px;
        max-width: 700px;
    }

    .translation-actions {
        gap: 15px;
        margin-top: 18px;
    }

    .action-btn {
        padding: 12px 20px;
        font-size: 1rem;
        transition: transform 0.2s ease;
    }

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

/* ========================================
   LANGUAGE DETECTION OVERLAYS
   ======================================== */

/* Language Detection Button in Header */
.language-detect-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.language-detect-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.language-detect-btn .btn-icon {
    font-size: 1rem;
}

/* Language Detection Overlay - Match app styling */
.language-detection-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.language-detection-overlay.show {
    opacity: 1;
}

.language-detection-overlay .overlay-content {
    max-width: 500px;
    width: 90%;
    padding: 0;
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 25px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    margin: 0 auto;
    overflow: hidden;
}

.language-detection-overlay .overlay-header,
.language-result-overlay .overlay-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px 20px 30px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.language-detection-overlay .overlay-title,
.language-result-overlay .overlay-title {
    font-size: 1.6rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.language-detection-overlay .close-btn,
.language-result-overlay .close-btn {
    background: rgba(255, 255, 255, 0.8);
    border: none;
    font-size: 1.2rem;
    color: #4a5568;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.language-detection-overlay .close-btn:hover,
.language-result-overlay .close-btn:hover {
    background: rgba(255, 255, 255, 1);
    color: #2d3748;
    transform: scale(1.1);
}

.detection-interface {
    padding: 30px;
    background: rgba(255, 255, 255, 0.5);
}

.detection-status {
    margin-bottom: 30px;
}

.status-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.status-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 10px;
}

.status-description {
    color: #4a5568;
    font-size: 1rem;
    line-height: 1.5;
}

/* Voice Visualizer */
.voice-visualizer {
    margin: 30px 0;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sound-wave {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 60px;
}

.wave-bar {
    width: 4px;
    height: 20px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.wave-bar.active {
    animation: waveAnimation 1.5s ease-in-out infinite;
}

@keyframes waveAnimation {
    0%, 100% { height: 20px; opacity: 0.3; }
    50% { height: 60px; opacity: 1; }
}

/* Detection Controls */
.detection-controls {
    margin: 30px 0;
}

.detection-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 15px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 auto;
    min-width: 160px;
    justify-content: center;
}

.detection-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.detection-btn .btn-icon {
    font-size: 1.2rem;
}

.stop-detection {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.stop-detection:hover {
    box-shadow: 0 10px 30px rgba(239, 68, 68, 0.3);
}

/* Example Phrases */
.example-phrases {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.example-title {
    font-size: 0.9rem;
    color: #718096;
    margin-bottom: 15px;
}

.example-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.example-phrase {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-style: italic;
}

/* Language Result Overlay - Match app styling */
.language-result-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.language-result-overlay.show {
    opacity: 1;
}

.language-result-overlay .overlay-content {
    max-width: 600px;
    width: 90%;
    padding: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 25px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    margin: 0 auto;
    max-height: 90vh;
    overflow-y: auto;
    overflow: hidden;
}

.result-interface {
    padding: 30px;
    background: rgba(255, 255, 255, 0.5);
}

.detection-result {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    padding: 25px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    border-radius: 15px;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.result-icon {
    font-size: 3rem;
    flex-shrink: 0;
}

.result-details {
    flex: 1;
    text-align: left;
}

.detected-language {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 5px;
}

.language-native {
    font-size: 1.1rem;
    color: #667eea;
    margin-bottom: 15px;
    font-style: italic;
}

.confidence-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
}

.confidence-label {
    font-size: 0.9rem;
    color: #4a5568;
    font-weight: 600;
}

.confidence-bar {
    flex: 1;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.confidence-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.confidence-fill.high {
    background: linear-gradient(90deg, #10b981, #059669);
}

.confidence-fill.medium {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

.confidence-fill.low {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

.confidence-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: #2d3748;
}

/* Transcript Display */
.transcript-display {
    margin-bottom: 25px;
    padding: 20px;
    background: #f7fafc;
    border-radius: 12px;
    border-left: 4px solid #667eea;
}

.transcript-label {
    font-size: 0.9rem;
    color: #4a5568;
    margin-bottom: 8px;
    font-weight: 600;
}

.transcript-text {
    font-size: 1.1rem;
    color: #2d3748;
    font-style: italic;
    line-height: 1.5;
}

/* Language Info */
.language-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 30px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 15px;
    background: #f7fafc;
    border-radius: 8px;
}

.info-label {
    font-weight: 600;
    color: #4a5568;
}

.info-value {
    color: #2d3748;
    font-family: monospace;
}

/* Confirmation Section */
.confirmation-section {
    margin-bottom: 25px;
    text-align: center;
}

.confirmation-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 10px;
}

.confirmation-description {
    color: #4a5568;
    line-height: 1.5;
    margin-bottom: 25px;
}

.confirmation-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.action-btn {
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 200px;
    justify-content: center;
}

.primary-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

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

.secondary-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.secondary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.tertiary-btn {
    background: #f7fafc;
    color: #4a5568;
    border: 1px solid #e2e8f0;
}

.tertiary-btn:hover {
    background: #edf2f7;
    transform: translateY(-1px);
}

/* Feature Preview */
.feature-preview {
    padding: 20px;
    background: #f7fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.preview-title {
    font-size: 1rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 15px;
}

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

.preview-list li {
    padding: 8px 0;
    color: #4a5568;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Mobile Responsive */
@media (max-width: 767px) {
    .language-detection-overlay .overlay-content,
    .language-result-overlay .overlay-content {
        width: 95%;
        padding: 20px;
        margin: 20px auto;
    }

    .detection-result {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .result-details {
        text-align: center;
    }

    .language-info {
        grid-template-columns: 1fr;
    }

    .confirmation-actions {
        gap: 10px;
    }

    .action-btn {
        min-width: 100%;
    }

    .language-detect-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
    }

    .language-detect-btn .btn-text {
        display: none;
    }
}
