/**
 * UXTI Mail & 5GB Members Drive Suite — Master Stylesheet
 * UnExplores Premium Cyber-Enterprise Dark Aesthetic
 */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800;900&family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
    --bg-navy-950: #04081e;
    --bg-navy-900: #060d2e;
    --bg-navy-800: #0b153f;
    --bg-surface: rgba(14, 25, 66, 0.7);
    --bg-glass: rgba(255, 255, 255, 0.03);
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-glass-hover: rgba(6, 182, 212, 0.35);
    --color-cyan: #06b6d4;
    --color-cyan-glow: rgba(6, 182, 212, 0.25);
    --color-emerald: #10b981;
    --color-amber: #f59e0b;
    --color-rose: #f43f5e;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
}

body {
    background-color: var(--bg-navy-900);
    color: var(--text-primary);
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6, .font-heading {
    font-family: 'Outfit', 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif !important;
    letter-spacing: -0.015em;
}

.font-mono, code, pre {
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Consolas, Menlo, monospace !important;
    letter-spacing: -0.01em;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(6, 182, 212, 0.4);
}

/* Glassmorphic Surfaces */
.glass-panel {
    background: var(--bg-surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
}

.glass-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.glass-card:hover {
    border-color: var(--border-glass-hover);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 0 15px -3px var(--color-cyan-glow);
}

/* Mail Navigation Items */
.nav-link-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.9rem;
    border-radius: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.825rem;
    font-weight: 500;
    transition: all 0.18s ease;
    cursor: pointer;
    user-select: none;
    text-decoration: none;
}
.nav-link-item:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}
.nav-link-item.active {
    color: var(--color-cyan);
    background: rgba(6, 182, 212, 0.12);
    border-left: 3px solid var(--color-cyan);
    font-weight: 600;
}
.nav-link-item .badge {
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
}
.nav-link-item.active .badge {
    background: var(--color-cyan);
    color: #060d2e;
}

/* Email Row item */
.email-row {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
}
.email-row:hover {
    background: rgba(255, 255, 255, 0.035);
}
.email-row.selected {
    background: rgba(6, 182, 212, 0.1);
    border-left: 3px solid var(--color-cyan);
}
.email-row.unread {
    background: rgba(6, 182, 212, 0.04);
}
.email-row.unread .email-sender,
.email-row.unread .email-subject {
    font-weight: 700;
    color: #ffffff;
}

/* Star Icon */
.star-btn {
    color: var(--text-muted);
    transition: transform 0.15s ease, color 0.15s ease;
}
.star-btn:hover {
    transform: scale(1.2);
    color: var(--color-amber);
}
.star-btn.starred {
    color: var(--color-amber) !important;
}

/* Storage Quota Meter */
.quota-meter {
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
    position: relative;
}
.quota-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #06b6d4, #10b981);
    transition: width 0.4s ease;
}
.quota-fill.warning {
    background: linear-gradient(90deg, #f59e0b, #ef4444);
}

/* Drive Grid & List Elements */
.drive-item-card {
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 1rem;
    padding: 1rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
}
.drive-item-card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.045);
    border-color: rgba(6, 182, 212, 0.4);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
}

/* Upload Dropzone */
.drive-dropzone {
    border: 2px dashed rgba(6, 182, 212, 0.35);
    border-radius: 1.25rem;
    padding: 2.5rem 1.5rem;
    text-align: center;
    background: rgba(6, 182, 212, 0.02);
    transition: all 0.2s ease;
    cursor: pointer;
}
.drive-dropzone.drag-active,
.drive-dropzone:hover {
    border-color: var(--color-cyan);
    background: rgba(6, 182, 212, 0.08);
    box-shadow: 0 0 20px -3px var(--color-cyan-glow);
}

/* Modals */
.uxti-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(4, 8, 30, 0.82);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
.uxti-modal-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}
.uxti-modal-box {
    background: #091238;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8), 0 0 35px -5px rgba(6, 182, 212, 0.2);
    border-radius: 1.25rem;
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.2s ease;
}
.uxti-modal-backdrop.active .uxti-modal-box {
    transform: scale(1);
}

/* Toast Notifications */
#uxtiToast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 10000;
    padding: 0.85rem 1.4rem;
    background: #0b153f;
    border: 1px solid rgba(6, 182, 212, 0.4);
    border-radius: 1rem;
    box-shadow: 0 15px 30px rgba(0,0,0,0.6);
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transform: translateY(120%);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}
#uxtiToast.show {
    transform: translateY(0);
    pointer-events: auto;
}

/* ══════════════════ PRO MOBILE RESPONSIVENESS ══════════════════ */
@media (max-width: 1024px) {
    .hide-on-mobile {
        display: none !important;
    }
}

@media (max-width: 768px) {
    /* Responsive Pane Switching: List vs Reader */
    #emailListPane.mobile-hidden {
        display: none !important;
    }
    #readingPane.mobile-active {
        display: flex !important;
        flex: 1 1 100% !important;
        width: 100% !important;
        height: 100% !important;
        z-index: 25;
        background: #04081e;
    }
    
    /* Mobile Folder Pills */
    .mobile-folder-pill {
        padding: 0.35rem 0.75rem;
        border-radius: 999px;
        font-size: 0.72rem;
        font-weight: 600;
        color: #94a3b8;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.08);
        white-space: nowrap;
        cursor: pointer;
        transition: all 0.15s ease;
        display: inline-flex;
        align-items: center;
        gap: 0.35rem;
    }
    .mobile-folder-pill:hover,
    .mobile-folder-pill.active {
        color: #22d3ee;
        background: rgba(6, 182, 212, 0.15);
        border-color: rgba(6, 182, 212, 0.4);
    }
}

@media (max-width: 640px) {
    /* Full-Screen Native-feel Compose on Mobile */
    #composeModal {
        padding: 0 !important;
    }
    #composeModal .uxti-modal-box {
        width: 100vw !important;
        height: 100% !important;
        max-width: 100vw !important;
        max-height: 100% !important;
        border-radius: 0 !important;
        border: none !important;
        transform: none !important;
    }

    /* Single-row Touch-Scrollable Formatting Toolbar */
    .toolbar-container {
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding: 0.45rem !important;
        gap: 0.2rem !important;
    }
    .toolbar-container::-webkit-scrollbar {
        display: none;
    }
    .toolbar-btn {
        flex-shrink: 0;
        min-width: 32px;
        height: 32px;
    }

    /* Modals padding on small screens */
    .uxti-modal-box {
        max-height: 94vh;
        border-radius: 1rem;
    }
}

/* ── Executive Compose Toolbar & Palettes ── */
.toolbar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 6px;
    border-radius: 8px;
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    font-size: 0.8rem;
}
.toolbar-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}
.toolbar-btn:active {
    background: rgba(6, 182, 212, 0.2);
    color: #22d3ee;
}
.toolbar-divider {
    display: inline-block;
    width: 1px;
    height: 18px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0 3px;
}

#colorPaletteDropdown,
#emojiPickerDropdown {
    box-shadow: 0 20px 35px -10px rgba(0, 0, 0, 0.85), 0 0 25px rgba(6, 182, 212, 0.25);
    animation: uxtiDropdownPop 0.15s ease-out;
}

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

#recipientAutocompleteBox {
    animation: uxtiDropdownPop 0.15s ease-out;
}

/* Contact Filter Buttons */
.contact-filter-btn.active {
    background: rgba(6, 182, 212, 0.2) !important;
    color: #22d3ee !important;
    border: 1px solid rgba(6, 182, 212, 0.4) !important;
    font-weight: 600 !important;
}

/* ── Draggable Pane Resizers (Adjustable 3-Pane Borders) ── */
.pane-resizer {
    width: 6px;
    background: rgba(255, 255, 255, 0.04);
    cursor: col-resize;
    position: relative;
    z-index: 25;
    transition: background 0.15s ease, width 0.15s ease;
    user-select: none;
    flex-shrink: 0;
}
.pane-resizer:hover,
.pane-resizer.is-dragging {
    background: #06b6d4;
    box-shadow: 0 0 12px rgba(6, 182, 212, 0.7);
}
.pane-resizer::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2px;
    height: 32px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.25);
    transition: all 0.2s ease;
}
.pane-resizer:hover::after,
.pane-resizer.is-dragging::after {
    background: #ffffff;
    height: 48px;
}

/* ── Premium Two-Tier Composer Toolbar ── */
.composer-toolbar-box {
    background: #081130;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1rem;
    padding: 0.5rem 0.65rem;
    box-shadow: 0 4px 20px -5px rgba(0, 0, 0, 0.5);
}
.composer-toolbar-row {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}
.composer-toolbar-row:not(:last-child) {
    padding-bottom: 0.4rem;
    margin-bottom: 0.4rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.composer-select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 0.5rem;
    padding: 0.3rem 0.5rem;
    outline: none;
    cursor: pointer;
    transition: all 0.15s ease;
}
.composer-select:hover,
.composer-select:focus {
    border-color: #06b6d4;
    background: rgba(6, 182, 212, 0.08);
    color: #ffffff;
}
.composer-select option {
    background: #081130;
    color: #f8fafc;
}

/* ── Calendar Side Tabs ── */
.cal-tab-btn {
    padding: 0.4rem 0.75rem;
    border-radius: 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #94a3b8;
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
}
.cal-tab-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}
.cal-tab-btn.active {
    color: #22d3ee;
    background: rgba(6, 182, 212, 0.15);
    border-color: rgba(6, 182, 212, 0.3);
    box-shadow: 0 2px 8px rgba(6, 182, 212, 0.1);
}

/* ── Premium Custom Scrollbars ── */
.custom-scrollbar::-webkit-scrollbar,
#mailSidebarScroll::-webkit-scrollbar,
#emailList::-webkit-scrollbar,
#readingPaneContent::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

.custom-scrollbar::-webkit-scrollbar-track,
#mailSidebarScroll::-webkit-scrollbar-track,
#emailList::-webkit-scrollbar-track,
#readingPaneContent::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb,
#mailSidebarScroll::-webkit-scrollbar-thumb,
#emailList::-webkit-scrollbar-thumb,
#readingPaneContent::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 9999px;
    transition: background 0.2s ease;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover,
#mailSidebarScroll::-webkit-scrollbar-thumb:hover,
#emailList::-webkit-scrollbar-thumb:hover,
#readingPaneContent::-webkit-scrollbar-thumb:hover {
    background: rgba(6, 182, 212, 0.5);
}

.custom-scrollbar,
#mailSidebarScroll,
#emailList {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}
