/**
 * Responsive Design for Evenly Dialog
 * Mobile-first approach with accessibility focus
 * ~50 lines extracted from main HTML file
 */

/* ===========================================
   MOBILE FIRST APPROACH
   =========================================== */

@media (max-width: 768px) {

    .document-metadata-inline {
        font-size: 0.85rem; /* Slightly smaller on mobile */
        line-height: 1.8; /* More line height for better readability */
    }


    .key-entities-inline {
        display: flex !important;
        flex-direction: column !important;
        gap: var(--spacing-xs) !important;
    }
    
    /* Keep conversation button centered on mobile */
    .conversation-controls {
        justify-content: center !important;
    }
    
    .conversation-toggle {
        width: auto !important;
        max-width: 90% !important;
    }
}




/* Base mobile styles (already defined in other files) */

/* ===========================================
   TABLET STYLES (768px and up)
   =========================================== */
@media screen and (min-width: 768px) {
    .container {
        padding: var(--spacing-lg);
    }
    
    .app-container {
        padding: 40px;
    }
    
    .playback-controls {
        flex-direction: row;
        justify-content: center;
        gap: var(--spacing-md);
    }
    
    .playback-controls > * {
        width: auto;
        margin: 0;
    }
    
    .upload-btn-wrapper {
        width: auto;
    }
    
    .language-selector {
        width: auto;
    }
    
    .section-item {
        padding: var(--spacing-lg);
    }
}

/* ===========================================
   MOBILE STYLES (767px and below)
   =========================================== */
@media screen and (max-width: 767px) {
    /* Adjust container for mobile */
    .container {
        padding: var(--spacing-md);
    }
    
    .app-container {
        padding: var(--spacing-lg);
        margin-bottom: var(--spacing-lg);
    }
    
    /* Stack controls vertically on mobile */
    .playback-controls {
        flex-direction: column;
        align-items: stretch;
        gap: var(--spacing-sm);
    }
    
    .playback-controls > * {
        width: 100%;
        margin: 0;
    }
    
    /* Full width buttons on mobile */
    .upload-btn-wrapper {
        width: 100%;
        margin: 0;
    }
    
    .language-selector {
        width: 100%;
    }
    
    .control-btn {
        min-height: 48px; /* Larger touch targets */
        font-size: 1rem;
        padding: var(--spacing-md) var(--spacing-lg);
    }
    
    /* Mobile section styling */
    .section-item {
        padding: var(--spacing-md);
        margin-bottom: var(--spacing-sm);
        min-height: 48px; /* Larger touch targets */
    }
    
    .section-title {
        font-size: 1rem;
        margin-bottom: var(--spacing-xs);
    }
    
    .section-meta {
        font-size: 0.85rem;
        margin-bottom: var(--spacing-xs);
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-xs);
    }
    
    .section-summary {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    .section-preview {
        font-size: 0.85rem;
        line-height: 1.4;
        margin-top: var(--spacing-sm);
        padding-top: var(--spacing-sm);
    }
    
    /* Mobile typography adjustments */
    body {
        font-size: var(--font-size-base);
        line-height: 1.6;
    }
    
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    /* Mobile language dropdown */
    .language-dropdown {
        left: 0;
        right: 0;
        transform: none;
        min-width: auto;
        margin-top: var(--spacing-xs);
    }
    
    .language-option {
        padding: var(--spacing-md);
        min-height: 48px;
    }
    
    /* Mobile service selector */
    .service-selector-group {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .service-selector-group fieldset {
        padding: var(--spacing-md);
    }
    
    .service-selector-group label {
        display: block;
        margin-bottom: var(--spacing-sm);
        padding: var(--spacing-xs) 0;
        min-height: 44px;
        line-height: 2;
    }
    
    /* Mobile processing view */
    .processing-view {
        padding: 40px var(--spacing-lg);
    }
    
    .processing-view h2 {
        font-size: 1.5rem;
    }
    
    .processing-view p {
        font-size: 1rem;
    }

   .processing-wrapper .app-title,
    .app-title {
        font-size: 2.5rem;
    }
    
    .processing-wrapper .app-subtitle,
    .app-subtitle {
        font-size: 1rem;
    }
    
    .processing-title {
        font-size: 1.5rem;
    }

    
    /* Mobile demo note */
    .demo-note {
        padding: var(--spacing-md);
        font-size: 0.9rem;
        text-align: left;
    }
    
    /* Mobile keyboard nav hint */
    .keyboard-nav-hint {
        padding: var(--spacing-sm);
        font-size: 0.85rem;
    }
}

/* ===========================================
   LARGE DESKTOP STYLES (1200px and up)
   =========================================== */
@media screen and (min-width: 1200px) {
    .container {
        padding: var(--spacing-xl);
    }
    
    .app-container {
        padding: 50px;
    }
    
    .playback-controls {
        gap: var(--spacing-lg);
    }
    
    .section-item {
        padding: var(--spacing-xl);
    }
    
    .processing-view {
        padding: 100px 60px;
    }
}

/* ===========================================
   LANDSCAPE ORIENTATION
   =========================================== */
@media screen and (orientation: landscape) and (max-height: 600px) {
    /* Compact vertical spacing for landscape mobile */
    .voice-commands-header {
        margin-bottom: var(--spacing-md);
    }
    
    .app-container {
        padding: var(--spacing-md);
    }
    
    .processing-view {
        padding: var(--spacing-lg);
    }
    
    .demo-note {
        padding: var(--spacing-sm);
        margin-bottom: var(--spacing-md);
    }
}

/* ===========================================
   HIGH DPI DISPLAYS
   =========================================== */
@media screen and (-webkit-min-device-pixel-ratio: 2),
       screen and (min-resolution: 192dpi) {
    /* Sharper borders and shadows for high DPI */
    .control-btn {
        border-width: 1px;
    }
    
    .section-item {
        border-width: 1px;
    }
    
    .language-dropdown {
        border-width: 1px;
    }
}

/* ===========================================
   PRINT STYLES
   =========================================== */
@media print {
    /* Hide interactive elements */
    .playback-controls,
    .control-btn,
    .language-dropdown,
    .service-selector-pane,
    .session-indicator,
    .keyboard-nav-hint {
        display: none !important;
    }
    
    /* Print-friendly colors */
    body {
        background: white !important;
        color: black !important;
    }
    
    .app-container,
    .document-analysis,
    .section-item {
        background: white !important;
        border: 1px solid #ccc !important;
        box-shadow: none !important;
    }
    
    /* Better spacing for print */
    .container {
        max-width: none;
        padding: 0;
    }
    
    .section-item {
        break-inside: avoid;
        margin-bottom: var(--spacing-md);
    }
    
    /* Print typography */
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    h1 { font-size: 18pt; }
    h2 { font-size: 16pt; }
    h3 { font-size: 14pt; }
}

/* ===========================================
   ACCESSIBILITY - FORCED COLORS MODE
   =========================================== */
@media (forced-colors: active) {
    .control-btn {
        border: 2px solid ButtonText;
        background: ButtonFace;
        color: ButtonText;
    }
    
    .control-btn:hover,
    .control-btn:focus {
        border: 2px solid Highlight;
        background: Highlight;
        color: HighlightText;
    }
    
    .section-item {
        border: 1px solid ButtonText;
        background: Canvas;
        color: CanvasText;
    }
    
    .section-item:focus {
        border: 2px solid Highlight;
        outline: 2px solid Highlight;
    }
}

/* ===========================================
   ACCESSIBILITY - PREFERS CONTRAST
   =========================================== */
@media (prefers-contrast: high) {
    /* Higher contrast for accessibility */
    .control-btn {
        border-width: 2px;
        font-weight: 600;
    }
    
    .section-item {
        border-width: 2px;
    }
    
    .section-title {
        font-weight: 700;
    }
    
    /* Higher contrast focus indicators */
    *:focus {
        outline: 3px solid #000;
        outline-offset: 2px;
    }
    
    /* Higher contrast text */
    .section-meta {
        color: #000;
    }
    
    .section-summary {
        color: #000;
    }

    .section-preview {
        color: #000;
        border-top-color: #000;
        opacity: 1;
    }

}



/* ===========================================
   TOUCH DEVICE OPTIMIZATIONS
   =========================================== */
@media (hover: none) and (pointer: coarse) {
    /* Touch-friendly adjustments */
    .control-btn {
        min-height: 48px;
        min-width: 48px;
        padding: var(--spacing-md) var(--spacing-lg);
    }
    
    .section-item {
        min-height: 48px;
        padding: var(--spacing-md);
    }
    
    .language-option {
        min-height: 48px;
        padding: var(--spacing-md) var(--spacing-lg);
    }
    
    /* Remove hover effects on touch devices */
    .control-btn:hover,
    .section-item:hover,
    .language-option:hover {
        transform: none;
        box-shadow: none;
    }
    
    /* Larger touch targets for small elements */
    input[type="radio"] {
        min-width: 20px;
        min-height: 20px;
    }
}