/* ========================================
   📱 MOBILE STYLES (Loaded via media query)
   ======================================== */

/* Generic Mobile Fixes */
html,
body {
    text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    position: relative;
    margin: 0;
    padding: 0;
    /* Masking Layout Shifts - RESTORED */
    background-color: #fce4ec;
}

/* Safe Area Insets (Notch Support) */
.chat-page,
.home-page {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

.chat-header {
    padding-top: env(safe-area-inset-top);
}

/* Fix Mobile Background Issues */
.background-gradient {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    /* Fallback */
    height: 100dvh !important;
    /* Dynamic Viewport */
    z-index: -10;
    overflow: hidden;
    /* Reset any width inheritance */
    max-width: none !important;
    max-height: none !important;
    transform: none !important;
}

/* 
   Input Container: STRICT Bottom Spacing 
   User requested "eliminate whitespace completely".
*/

/* 
   Input Container: STRICT Bottom Spacing 
   User requested "eliminate whitespace completely".
*/
.chat-input-container {
    width: 100%;
    width: 95%;
    /* Centered width */
    /* Centered width */
    bottom: 2rem !important;
    /* Restore some float */
    margin-bottom: env(safe-area-inset-bottom);
    padding-bottom: 0;
}

/* Add extra padding to body/chat-container instead of input */
.chat-page {
    height: 100dvh;
    /* Use dynamic viewport height */
}

/* Raise input when keyboard might be open? No, just base position */
@media (max-width: 480px) {
    .chat-input-container {
        bottom: 1rem !important;
        margin-bottom: env(safe-area-inset-bottom);
    }
}

.sidebar {
    width: 100%;
    height: 100dvh;
    background: rgba(255, 255, 255, 0.95);
    /* Mobile: Full screen, reset positioning */
    right: 0 !important;
    left: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    border-radius: 0;
}

/* Prevent Header Overlap */
.header-center {
    position: static !important;
    transform: none !important;
    order: 2;
}

.header-container {
    justify-content: space-between;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
}

/* Floating Status Indicator on Mobile */
.status-indicator {
    position: absolute !important;
    top: 80px !important;
    /* Clearly below header */
    left: 50% !important;
    transform: translateX(-50%) !important;
    background: rgba(255, 255, 255, 0.6) !important;
    backdrop-filter: blur(15px) !important;
    padding: 6px 16px !important;
    border-radius: 50px !important;
    border: 1px solid rgba(255, 255, 255, 0.6) !important;
    font-size: 0.85rem !important;
    font-weight: 500 !important;
    z-index: 100 !important;
    white-space: nowrap !important;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08) !important;
    color: var(--text-primary) !important;
    width: auto !important;
    justify-content: center !important;
}

/* Adjust Home Page Alignment for small screens */
.home-page {
    justify-content: flex-start;
    padding-top: 4rem;
    padding-bottom: 2rem;
    height: 100dvh;
    overflow-y: auto;
}

/* Ensure Home Page scrolls on short screens (Landscape, etc.) */
@media (max-height: 700px) {
    .home-page {
        justify-content: flex-start;
        padding-top: 2rem;
        height: 100dvh;
        overflow-y: auto;
    }
}

/* 
   Button & Action Refinements for Touch
*/
.conversation-actions {
    opacity: 1 !important;
    transform: none !important;
}

/* Disable Hover on Mobile, Use Active */
@media (hover: none) {
    .conversation-item:hover {
        background: rgba(255, 255, 255, 0.05);
        /* Reset to default */
        transform: none;
        box-shadow: none;
    }

    .conversation-item:active {
        background: rgba(255, 255, 255, 0.15);
        transform: scale(0.98);
    }

    .glass-button:hover,
    .glass-button-small:hover {
        transform: none;
        box-shadow: var(--shadow-sm);
        background: rgba(255, 255, 255, 0.4);
    }

    .glass-button:active,
    .glass-button-small:active {
        background: white;
        transform: scale(0.95);
    }

    .glass-button:active,
    .glass-button-small:active {
        background: white;
        transform: scale(0.95);
    }
}

/* ========================================
   Strict Mobile Overrides (Regardless of input type)
   ======================================== */
.lang-toggle-btn {
    background: rgba(255, 255, 255, 0.4) !important;
    transition: background 0.1s, transform 0.1s !important;
}

.lang-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.4) !important;
    /* No hover change */
    transform: none !important;
    box-shadow: none !important;
}

.lang-toggle-btn:active {
    background: transparent !important;
    /* Disappear on press */
    transform: scale(0.95) !important;
    /* Slight press effect */
}