/* ==========================================================================
   LuminaNotes - Elegant Design System & Stylesheet
   ========================================================================== */

/* 1. Design Tokens & Root Variables */
:root {
    /* Color Palette */
    --bg-app: #08090f;
    --bg-sidebar: rgba(13, 15, 28, 0.7);
    --bg-card: rgba(22, 26, 47, 0.45);
    --bg-card-hover: rgba(28, 33, 60, 0.6);
    --bg-modal: rgba(18, 22, 39, 0.9);
    --bg-input: rgba(30, 36, 66, 0.5);
    
    --border-color: rgba(255, 255, 255, 0.07);
    --border-color-hover: rgba(255, 255, 255, 0.15);
    
    /* Text Colors */
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    /* Brand Accents */
    --accent-primary: #6366f1; /* Indigo */
    --accent-secondary: #a855f7; /* Violet */
    --accent-glow: rgba(99, 102, 241, 0.4);
    
    /* System Colors */
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    
    /* Glassmorphism Specs */
    --glass-blur: blur(16px);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --glass-border: 1px solid rgba(255, 255, 255, 0.08);
    
    /* Font family */
    --font-primary: 'Outfit', sans-serif;
    
    /* Transitions */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Card Theme Gradients (Preset) */
    --theme-violet: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(168, 85, 247, 0.08));
    --theme-violet-border: rgba(168, 85, 247, 0.3);
    --theme-violet-tag: #a855f7;
    
    --theme-sunset: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(239, 68, 68, 0.08));
    --theme-sunset-border: rgba(245, 158, 11, 0.3);
    --theme-sunset-tag: #f59e0b;
    
    --theme-emerald: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(5, 150, 105, 0.08));
    --theme-emerald-border: rgba(16, 185, 129, 0.3);
    --theme-emerald-tag: #10b981;
    
    --theme-ocean: linear-gradient(135deg, rgba(6, 182, 212, 0.08), rgba(59, 130, 246, 0.08));
    --theme-ocean-border: rgba(6, 182, 212, 0.3);
    --theme-ocean-tag: #06b6d4;
    
    --theme-rose: linear-gradient(135deg, rgba(236, 72, 153, 0.08), rgba(244, 63, 94, 0.08));
    --theme-rose-border: rgba(236, 72, 153, 0.3);
    --theme-rose-tag: #ec4899;
    
    --theme-monochrome: linear-gradient(135deg, rgba(241, 245, 249, 0.02), rgba(241, 245, 249, 0.04));
    --theme-monochrome-border: rgba(255, 255, 255, 0.15);
    --theme-monochrome-tag: #9ca3af;
}

/* 2. Global Reset & Scrollbars */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-app);
    color: var(--text-primary);
    font-family: var(--font-primary);
    overflow-x: hidden;
    min-height: 100vh;
    background-image: 
        radial-gradient(at 10% 20%, rgba(99, 102, 241, 0.05) 0px, transparent 50%),
        radial-gradient(at 90% 80%, rgba(168, 85, 247, 0.05) 0px, transparent 50%);
    background-attachment: fixed;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* 3. Main Application Layout */
.app-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

/* 4. Sidebar Navigation */
.app-sidebar {
    background: var(--bg-sidebar);
    border-right: var(--glass-border);
    backdrop-filter: var(--glass-blur);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    z-index: 10;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
}

.sidebar-header {
    margin-bottom: 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.logo-glow {
    position: absolute;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    filter: blur(8px);
    opacity: 0.6;
    border-radius: 50%;
    z-index: -1;
}

.logo-icon {
    color: var(--text-primary);
    width: 24px;
    height: 24px;
    filter: drop-shadow(0 0 4px var(--accent-primary));
}

.logo h1, .logo h2 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: linear-gradient(to right, #ffffff, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Action Buttons */
.btn-new-note {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border: none;
    border-radius: 12px;
    padding: 12px 20px;
    font-family: var(--font-primary);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition-normal);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    margin-bottom: 30px;
}

.btn-new-note:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
    filter: brightness(1.1);
}

.btn-new-note:active {
    transform: translateY(0);
}

.btn-glow {
    animation: glow-pulse 2s infinite alternate;
}

@keyframes glow-pulse {
    0% {
        box-shadow: 0 0 5px rgba(99, 102, 241, 0.4), 0 0 10px rgba(99, 102, 241, 0.2);
    }
    100% {
        box-shadow: 0 0 15px rgba(99, 102, 241, 0.6), 0 0 25px rgba(168, 85, 247, 0.4);
    }
}

/* Sidebar Nav List */
.sidebar-nav {
    flex-grow: 1;
}

.nav-section-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 12px;
    padding-left: 8px;
}

.category-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.category-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-fast);
    border: 1px solid transparent;
}

.category-list li:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

.category-list li.active {
    background: rgba(99, 102, 241, 0.12);
    color: var(--text-primary);
    border: 1px solid rgba(99, 102, 241, 0.2);
    position: relative;
}

.category-list li.active::before {
    content: '';
    position: absolute;
    left: -4px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 16px;
    background: var(--accent-primary);
    border-radius: 0 4px 4px 0;
}

.cat-link {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    font-weight: 500;
}

.cat-link i {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
}

.category-list li.active .cat-link i {
    color: var(--accent-primary);
}

.category-list li.active .icon-pin {
    color: var(--color-warning) !important;
}

.count-badge {
    background: rgba(255, 255, 255, 0.08);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    color: var(--text-secondary);
}

.category-list li.active .count-badge {
    background: rgba(99, 102, 241, 0.2);
    color: var(--text-primary);
}

/* Sidebar Footer */
.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 16px;
}

.footer-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.btn-icon {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    font-family: var(--font-primary);
    font-size: 0.8rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: var(--transition-fast);
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.1);
}

.btn-icon i {
    width: 14px;
    height: 14px;
}

.app-version {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: center;
}

/* 5. Main Content Frame */
.app-main {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* Topbar Design */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 32px;
    border-bottom: var(--glass-border);
    background: rgba(8, 9, 15, 0.6);
    backdrop-filter: var(--glass-blur);
    z-index: 5;
}

.search-box {
    position: relative;
    width: 450px;
    max-width: 100%;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 18px;
    height: 18px;
    pointer-events: none;
}

.search-box input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 10px 16px 10px 44px;
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 0.9rem;
    transition: var(--transition-normal);
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.15);
    background: rgba(30, 36, 66, 0.75);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-view-toggle {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    border-radius: 10px;
    width: 38px;
    height: 38px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.btn-view-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.btn-view-toggle i {
    width: 18px;
    height: 18px;
}

/* User Profile Menu */
.user-profile-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 4px 4px 4px 16px;
    border-radius: 14px;
}

.user-email {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-logout {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.btn-logout:hover {
    color: var(--color-danger);
    background: rgba(239, 68, 68, 0.1);
}

.btn-logout i {
    width: 16px;
    height: 16px;
}

.avatar {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
}

/* 6. Workspace Scroll Content */
.notes-workspace {
    flex-grow: 1;
    overflow-y: auto;
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.notes-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.section-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title i {
    width: 16px;
    height: 16px;
    color: var(--accent-primary);
}

#section-pinned .section-title i {
    color: var(--color-warning);
}

/* Grid Mode & List Mode */
.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.notes-grid.list-view {
    grid-template-columns: 1fr;
}

/* 7. Beautiful Glassmorphic Note Cards */
.note-card {
    background: var(--bg-card);
    border: var(--glass-border);
    backdrop-filter: var(--glass-blur);
    border-radius: 16px;
    padding: 20px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 180px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), 
                box-shadow 0.3s ease, 
                border-color 0.3s ease;
    animation: fadeInUp 0.4s ease forwards;
}

.note-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

/* Accent Card Themes styling in runtime */
.note-card.theme-violet { 
    background: linear-gradient(135deg, rgba(22, 26, 47, 0.45), rgba(168, 85, 247, 0.04));
    --accent-theme-color: var(--theme-violet-tag); 
}
.note-card.theme-sunset { 
    background: linear-gradient(135deg, rgba(22, 26, 47, 0.45), rgba(245, 158, 11, 0.04));
    --accent-theme-color: var(--theme-sunset-tag); 
}
.note-card.theme-emerald { 
    background: linear-gradient(135deg, rgba(22, 26, 47, 0.45), rgba(16, 185, 129, 0.04));
    --accent-theme-color: var(--theme-emerald-tag); 
}
.note-card.theme-ocean { 
    background: linear-gradient(135deg, rgba(22, 26, 47, 0.45), rgba(6, 182, 212, 0.04));
    --accent-theme-color: var(--theme-ocean-tag); 
}
.note-card.theme-rose { 
    background: linear-gradient(135deg, rgba(22, 26, 47, 0.45), rgba(236, 72, 153, 0.04));
    --accent-theme-color: var(--theme-rose-tag); 
}
.note-card.theme-monochrome { 
    background: linear-gradient(135deg, rgba(22, 26, 47, 0.45), rgba(255, 255, 255, 0.01));
    --accent-theme-color: var(--theme-monochrome-tag); 
}

.note-card:hover {
    border-color: var(--accent-theme-color);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2), 0 0 15px rgba(var(--accent-theme-color), 0.1);
}

/* Card Header */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Pin Action / Indicator */
.card-pin-indicator {
    color: var(--color-warning);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.card-pin-indicator i {
    width: 14px;
    height: 14px;
    fill: var(--color-warning);
}

/* Card Body Content */
.card-body {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    word-break: break-word;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.list-view .card-body {
    -webkit-line-clamp: 2;
}

/* Card Footer */
.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.card-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.card-category-badge {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 99px;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.note-card.theme-violet .card-category-badge { background: rgba(168, 85, 247, 0.15); border-color: rgba(168, 85, 247, 0.15); }
.note-card.theme-sunset .card-category-badge { background: rgba(245, 158, 11, 0.15); border-color: rgba(245, 158, 11, 0.15); }
.note-card.theme-emerald .card-category-badge { background: rgba(16, 185, 129, 0.15); border-color: rgba(16, 185, 129, 0.15); }
.note-card.theme-ocean .card-category-badge { background: rgba(6, 182, 212, 0.15); border-color: rgba(6, 182, 212, 0.15); }
.note-card.theme-rose .card-category-badge { background: rgba(236, 72, 153, 0.15); border-color: rgba(236, 72, 153, 0.15); }
.note-card.theme-monochrome .card-category-badge { background: rgba(241, 245, 249, 0.08); border-color: rgba(241, 245, 249, 0.08); }

/* Quick Hover Action Overlay buttons on Card */
.card-actions {
    position: absolute;
    right: 12px;
    bottom: 12px;
    display: flex;
    gap: 6px;
    opacity: 0;
    transform: translateY(8px);
    transition: var(--transition-fast);
}

.note-card:hover .card-actions {
    opacity: 1;
    transform: translateY(0);
}

.card-actions .btn-action {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(13, 15, 28, 0.9);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.card-actions .btn-action:hover {
    color: var(--text-primary);
    transform: scale(1.05);
}

.card-actions .btn-action.btn-pin-toggle:hover {
    color: var(--color-warning);
    border-color: rgba(245, 158, 11, 0.3);
}

.card-actions .btn-action.btn-delete:hover {
    color: var(--color-danger);
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.1);
}

.card-actions .btn-action i {
    width: 14px;
    height: 14px;
}

/* 8. Glassmorphic Modal Editor UI */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(3, 4, 7, 0.65);
    backdrop-filter: blur(12px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: var(--bg-modal);
    border: var(--glass-border);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    border-radius: 20px;
    width: 100%;
    max-width: 650px;
    padding: 28px;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 20px;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .modal-card {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
}

.btn-close {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.btn-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.btn-close i {
    width: 16px;
    height: 16px;
}

.modal-body {
    max-height: 70vh;
    overflow-y: auto;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-group.half {
    flex: 1;
}

.form-group.flex-row {
    flex-direction: row;
}

.form-group.align-end {
    justify-content: flex-end;
}

.form-group label {
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

/* Styled Inputs */
#note-title {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 0;
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 1.4rem;
    font-weight: 600;
    transition: var(--transition-fast);
}

#note-title:focus {
    outline: none;
    border-bottom-color: var(--accent-primary);
}

/* Custom Select styling */
.custom-select-wrapper {
    position: relative;
    width: 100%;
}

.custom-select-wrapper::after {
    content: '▾';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
    font-size: 0.8rem;
}

#note-category {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 10px 14px;
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 0.9rem;
    appearance: none;
    cursor: pointer;
}

#note-category:focus {
    outline: none;
    border-color: var(--accent-primary);
}

#note-category option {
    background: #111425;
    color: var(--text-primary);
    padding: 10px;
}

/* Custom Checkbox (Pin Note) */
.pin-toggle-container {
    cursor: pointer;
    display: inline-block;
    width: 100%;
}

.pin-toggle-container input {
    display: none;
}

.pin-custom-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--bg-input);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 10px 16px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition-fast);
    text-transform: none !important;
}

.pin-toggle-container input:checked + .pin-custom-box {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.4);
    color: var(--color-warning);
}

.pin-custom-box i {
    width: 16px;
    height: 16px;
}

.pin-toggle-container input:checked + .pin-custom-box i {
    fill: var(--color-warning);
}

/* Theme Picker Swatches */
.theme-picker {
    display: flex;
    gap: 12px;
    align-items: center;
}

.theme-option {
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-option input {
    display: none;
}

.theme-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid transparent;
    transition: var(--transition-fast);
    position: relative;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.theme-circle.theme-violet { background: linear-gradient(135deg, #6366f1, #a855f7); }
.theme-circle.theme-sunset { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.theme-circle.theme-emerald { background: linear-gradient(135deg, #10b981, #059669); }
.theme-circle.theme-ocean { background: linear-gradient(135deg, #06b6d4, #3b82f6); }
.theme-circle.theme-rose { background: linear-gradient(135deg, #ec4899, #f43f5e); }
.theme-circle.theme-monochrome { background: linear-gradient(135deg, #64748b, #94a3b8); }

.theme-option input:checked + .theme-circle {
    border-color: white;
    transform: scale(1.15);
    box-shadow: 0 0 12px var(--accent-primary);
}

/* Modal Content Textarea */
#note-content {
    width: 100%;
    min-height: 200px;
    max-height: 350px;
    background: var(--bg-input);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 14px;
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 0.95rem;
    line-height: 1.6;
    resize: vertical;
    transition: var(--transition-fast);
}

#note-content:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.15);
}

/* Modal Footer Buttons */
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 16px;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    padding: 10px 20px;
    border-radius: 10px;
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 10px;
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition-fast);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.btn-primary:hover {
    filter: brightness(1.1);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
}

.btn-full {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 12px;
    font-size: 0.95rem;
}

/* 9. Empty State Illustration */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    background: rgba(22, 26, 47, 0.25);
    border: 1px dashed rgba(255, 255, 255, 0.07);
    border-radius: 20px;
    max-width: 500px;
    margin: 40px auto;
    animation: fadeIn 0.5s ease;
}

.empty-illustration {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.15);
}

.empty-illustration i {
    width: 38px;
    height: 38px;
}

.empty-state h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.empty-state p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
    max-width: 320px;
    line-height: 1.5;
}

/* 10. Toast Notification styling */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: rgba(18, 22, 39, 0.9);
    border-left: 4px solid var(--accent-primary);
    border-top: var(--glass-border);
    border-right: var(--glass-border);
    border-bottom: var(--glass-border);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    backdrop-filter: var(--glass-blur);
    border-radius: 8px;
    padding: 12px 20px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: toastIn 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.success { border-left-color: var(--color-success); }
.toast.info { border-left-color: var(--accent-primary); }
.toast.warning { border-left-color: var(--color-warning); }
.toast.error { border-left-color: var(--color-danger); }

.toast i {
    width: 18px;
    height: 18px;
}

.toast.success i { color: var(--color-success); }
.toast.info i { color: var(--accent-primary); }
.toast.warning i { color: var(--color-warning); }
.toast.error i { color: var(--color-danger); }

/* 11. Full Screen Auth Panel Styles */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #030407;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s ease, visibility 0.4s;
    visibility: visible;
    opacity: 1;
    overflow-y: auto;
    padding: 24px;
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.12) 0px, transparent 40%),
        radial-gradient(at 100% 100%, rgba(168, 85, 247, 0.12) 0px, transparent 40%);
}

.auth-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.auth-glow {
    position: absolute;
    width: 350px;
    height: 350px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(168, 85, 247, 0.2));
    filter: blur(80px);
    border-radius: 50%;
    z-index: 1;
    pointer-events: none;
}

.auth-card {
    background: rgba(13, 16, 32, 0.65);
    border: var(--glass-border);
    backdrop-filter: blur(24px);
    width: 100%;
    max-width: 440px;
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    z-index: 2;
    animation: zoomIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-header .logo {
    justify-content: center;
    margin-bottom: 12px;
}

.auth-header h2 {
    font-size: 1.7rem;
    font-weight: 700;
}

.auth-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.auth-form-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
    animation: fadeIn 0.3s ease;
}

.label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Inputs with Icons */
.input-icon-wrapper {
    position: relative;
    width: 100%;
}

.input-icon-wrapper i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 18px;
    height: 18px;
    pointer-events: none;
    transition: var(--transition-fast);
}

.input-icon-wrapper input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 12px 16px 12px 46px;
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 0.95rem;
    transition: var(--transition-normal);
}

.input-icon-wrapper input:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: rgba(30, 36, 66, 0.7);
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.2);
}

.input-icon-wrapper input:focus + i {
    color: var(--accent-primary);
    filter: drop-shadow(0 0 2px rgba(99, 102, 241, 0.4));
}

.auth-link {
    color: var(--accent-primary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition-fast);
}

.auth-link:hover {
    color: var(--accent-secondary);
    text-decoration: underline;
}

.auth-footer {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 10px;
}

.input-hint {
    font-size: 0.75rem;
    color: var(--color-warning);
    background: rgba(245, 158, 11, 0.08);
    border: 1px dashed rgba(245, 158, 11, 0.2);
    padding: 8px 12px;
    border-radius: 8px;
    margin-top: 6px;
    word-break: break-all;
    line-height: 1.4;
}

/* 12. Custom Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.note-card.deleting {
    animation: fadeOutShrink 0.3s cubic-bezier(0.4, 0, 1, 1) forwards;
    pointer-events: none;
}

@keyframes fadeOutShrink {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.85);
        height: 0;
        min-height: 0;
        padding-top: 0;
        padding-bottom: 0;
        margin: 0;
        border-width: 0;
    }
}

/* ==========================================================================
   Workspace Tabs & Chat Layout Styles
   ========================================================================== */

/* Workspace Tabs in Sidebar */
.workspace-tabs {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 24px;
}

.workspace-tabs li {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-fast);
    border: 1px solid transparent;
    color: var(--text-secondary);
}

.workspace-tabs li:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

.workspace-tabs li.active {
    background: rgba(99, 102, 241, 0.12);
    color: var(--text-primary);
    border: 1px solid rgba(99, 102, 241, 0.2);
    font-weight: 600;
}

.workspace-tabs li.active i {
    color: var(--accent-primary);
}

/* Chat Workspace Containers */
.chat-workspace {
    display: flex;
    height: calc(100vh - 80px); /* Subtract topbar height */
    background: rgba(8, 9, 15, 0.2);
    overflow: hidden;
}

/* Chat Sidebar (Contacts List) */
.chat-sidebar {
    width: 340px;
    border-right: var(--glass-border);
    background: rgba(13, 15, 28, 0.35);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.chat-search-box {
    padding: 16px;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.chat-search-icon {
    position: absolute;
    left: 28px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 16px;
    height: 16px;
}

#contact-search-input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 8px 12px 8px 36px;
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 0.85rem;
    transition: var(--transition-fast);
}

#contact-search-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.15);
}

.contacts-list {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Contact Items */
.contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    transition: var(--transition-fast);
}

.contact-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.contact-item.active {
    background: rgba(99, 102, 241, 0.08);
}

.contact-item .avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    flex-shrink: 0;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow: hidden;
    flex-grow: 1;
}

.contact-details h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.contact-details p {
    font-size: 0.75rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Active Chat Window Area */
.chat-window {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background: rgba(8, 9, 15, 0.4);
    position: relative;
}

/* Empty State */
.chat-empty-state {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px;
    z-index: 2;
}

.chat-empty-glow {
    position: absolute;
    width: 250px;
    height: 250px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(168, 85, 247, 0.1));
    filter: blur(60px);
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
}

.chat-empty-illustration {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.08);
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.1);
}

.chat-empty-illustration i {
    width: 32px;
    height: 32px;
}

.chat-empty-state h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.chat-empty-state p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    max-width: 360px;
    line-height: 1.5;
    margin-bottom: 20px;
}

.chat-secure-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.03);
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.chat-secure-badge i {
    width: 12px;
    height: 12px;
}

/* Chat Active Layout */
.chat-active-state {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Chat Header */
.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: rgba(13, 15, 28, 0.4);
    border-bottom: var(--glass-border);
    backdrop-filter: var(--glass-blur);
}

.chat-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-chat-back {
    display: none; /* Desktop hide */
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: var(--transition-fast);
}

.btn-chat-back:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.btn-chat-back i {
    width: 18px;
    height: 18px;
}

.chat-user-info .avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
}

.chat-user-details h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.status-indicator {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.status-indicator::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
}

.status-indicator.online {
    color: var(--color-success);
}

.status-indicator.online::before {
    background: var(--color-success);
    box-shadow: 0 0 6px var(--color-success);
}

.chat-header-actions {
    display: flex;
    gap: 8px;
}

.btn-chat-action {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    width: 34px;
    height: 34px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.btn-chat-action:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.btn-chat-action i {
    width: 18px;
    height: 18px;
}

/* Chat Messages Container */
.chat-messages-container {
    flex-grow: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.015) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(168, 85, 247, 0.015) 0%, transparent 40%);
}

/* Chat Message Bubbles */
.chat-message {
    display: flex;
    flex-direction: column;
    padding: 10px 14px;
    max-width: 65%;
    line-height: 1.5;
    font-size: 0.9rem;
    position: relative;
    word-break: break-word;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    animation: chatPopIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes chatPopIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(12px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.chat-message.sender {
    align-self: flex-end;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.9), rgba(168, 85, 247, 0.9));
    color: white;
    border-radius: 16px 16px 2px 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.chat-message.recipient {
    align-self: flex-start;
    background: rgba(30, 35, 60, 0.65);
    color: var(--text-primary);
    border-radius: 16px 16px 16px 2px;
    border: var(--glass-border);
    backdrop-filter: var(--glass-blur);
}

.chat-message-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    margin-top: 4px;
    font-size: 0.7rem;
    align-self: flex-end;
}

.chat-message.sender .chat-message-meta {
    color: rgba(255, 255, 255, 0.65);
}

.chat-message.recipient .chat-message-meta {
    color: var(--text-muted);
}

.msg-ticks {
    display: flex;
    align-items: center;
    justify-content: center;
}

.msg-ticks i {
    width: 12px;
    height: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.chat-message.sender .msg-ticks i {
    color: #38bdf8; /* Light blue ticks for read */
}

/* Chat Input Bar */
.chat-input-area {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    background: rgba(13, 15, 28, 0.4);
    border-top: var(--glass-border);
    backdrop-filter: var(--glass-blur);
}

.btn-chat-input {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.btn-chat-input:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.btn-chat-input i {
    width: 20px;
    height: 20px;
}

#chat-message-input {
    flex-grow: 1;
    background: var(--bg-input);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 11px 16px;
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

#chat-message-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: rgba(30, 36, 66, 0.75);
}

.btn-send-message {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border: none;
    border-radius: 12px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

.btn-send-message:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
    box-shadow: 0 6px 14px rgba(99, 102, 241, 0.4);
}

.btn-send-message i {
    width: 16px;
    height: 16px;
}

/* ==========================================================================
   Realtime Voice Call WebRTC Styles
   ========================================================================== */

/* Fullscreen Call Overlay */
.call-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(8, 9, 20, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(15px);
    overflow: hidden;
}

/* Video container layout */
.video-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #050508;
    z-index: 1000;
}

#remote-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#local-video {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 120px;
    height: 160px;
    object-fit: cover;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    z-index: 1002;
    transition: all 0.3s ease;
}

/* Video Mode HUD Overrides */
.call-overlay.video-mode {
    backdrop-filter: none;
}

.call-overlay.video-mode .call-overlay-glow {
    display: none !important;
}

.call-overlay.video-mode .call-avatar-container {
    display: none !important;
}

.call-overlay.video-mode .call-card {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    padding: 40px 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    z-index: 1003;
    pointer-events: none;
}

.call-overlay.video-mode .call-card > * {
    pointer-events: auto;
}

.call-overlay.video-mode .call-card h2,
.call-overlay.video-mode .call-card p,
.call-overlay.video-mode .call-timer {
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.85);
}

.call-overlay.video-mode .call-actions {
    margin-top: 0;
}

.call-overlay-glow {
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, rgba(168, 85, 247, 0.05) 50%, transparent 100%);
    filter: blur(80px);
    pointer-events: none;
    z-index: 999;
}

.call-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 20px;
    z-index: 1001;
    width: 90%;
    max-width: 400px;
}

/* Call Avatar container & pulsing */
.call-avatar-container {
    width: 120px;
    height: 120px;
    position: relative;
    margin-bottom: 10px;
}

.call-avatar-container .avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 40px rgba(99, 102, 241, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.call-avatar-pulse {
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border-radius: 50%;
    border: 2px solid var(--accent-primary);
    animation: callPulse 2s infinite ease-in-out;
    opacity: 0;
}

@keyframes callPulse {
    0% {
        transform: scale(0.95);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.15);
        opacity: 0.3;
    }
    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

.call-card h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.call-card p {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.call-timer {
    font-size: 1.2rem;
    font-family: monospace;
    color: var(--accent-secondary);
    background: rgba(255, 255, 255, 0.04);
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    letter-spacing: 1px;
}

/* Call Control Buttons */
.call-actions {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-top: 30px;
}

.btn-call-control {
    background: rgba(255, 255, 255, 0.06);
    border: var(--glass-border);
    color: var(--text-primary);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.btn-call-control:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.05);
}

.btn-call-control.active {
    background: #f43f5e;
    border-color: #f43f5e;
    color: white;
}

.btn-call-control.btn-hangup {
    background: #ef4444;
    border: none;
    width: 66px;
    height: 66px;
    box-shadow: 0 0 25px rgba(239, 68, 68, 0.5);
    color: white;
}

.btn-call-control.btn-hangup:hover {
    background: #dc2626;
    box-shadow: 0 0 35px rgba(239, 68, 68, 0.7);
    transform: scale(1.08);
}

.btn-call-control i {
    width: 24px;
    height: 24px;
}

/* Incoming Call Banner Modal */
.incoming-call-overlay {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1010;
    width: calc(100% - 48px);
    max-width: 460px;
    animation: slideDownBanner 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes slideDownBanner {
    from {
        opacity: 0;
        transform: translate(-50%, -40px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.incoming-call-card {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px);
}

.incoming-info {
    display: flex;
    align-items: center;
    gap: 14px;
    overflow: hidden;
}

.incoming-info .avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.incoming-info h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
}

.incoming-info p {
    font-size: 0.8rem;
    color: var(--accent-secondary);
    margin-top: 2px;
}

.incoming-actions {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.incoming-actions button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    color: white;
}

.btn-incoming-accept {
    background: #10b981;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}

.btn-incoming-accept:hover {
    background: #059669;
    transform: scale(1.08);
}

.btn-incoming-decline {
    background: #ef4444;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}

.btn-incoming-decline:hover {
    background: #dc2626;
    transform: scale(1.08);
}

.incoming-actions i {
    width: 20px;
    height: 20px;
}

/* Mobile Controls Hide on Desktop */
.btn-menu-toggle {
    display: none;
}
.sidebar-overlay {
    display: none;
}

/* Responsive Breakpoints */
@media (max-width: 900px) {
    .app-container {
        grid-template-columns: 1fr;
    }
    
    /* Hamburger Menu Toggle Show on Mobile */
    .btn-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.08);
        color: var(--text-secondary);
        border-radius: 10px;
        width: 38px;
        height: 38px;
        cursor: pointer;
        transition: var(--transition-fast);
        margin-right: 12px;
        flex-shrink: 0;
    }
    
    .btn-menu-toggle:hover {
        background: rgba(255, 255, 255, 0.1);
        color: var(--text-primary);
    }
    
    .btn-menu-toggle i {
        width: 18px;
        height: 18px;
    }

    /* Fixed Sliding Sidebar on Mobile */
    .app-sidebar {
        position: fixed;
        left: -290px;
        top: 0;
        bottom: 0;
        height: 100vh;
        width: 280px;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 100;
    }
    
    .app-sidebar.mobile-open {
        left: 0;
    }
    
    /* Sidebar Backdrop Overlay on Mobile */
    .sidebar-overlay {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(3, 4, 7, 0.6);
        backdrop-filter: blur(4px);
        z-index: 90;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }
    
    .sidebar-overlay.active {
        opacity: 1;
        pointer-events: auto;
    }
    
    .topbar {
        padding: 16px 20px;
        gap: 12px;
    }
    
    .search-box {
        flex-grow: 1;
        width: auto;
    }
    
    /* Hide Email text in profile menu to prevent overflow on mobile */
    .user-profile-menu {
        padding: 4px;
        gap: 4px;
    }
    
    .user-email {
        display: none;
    }
    
    .notes-workspace {
        padding: 20px;
    }
    
    .notes-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 16px;
    }
    
    .auth-card {
        padding: 28px 24px;
        border-radius: 20px;
    }

    /* Mobile Chat Responsiveness */
    .chat-workspace {
        height: calc(100vh - 72px);
    }
    
    .chat-sidebar {
        width: 100%;
        border-right: none;
    }
    
    .chat-window {
        display: none; /* Hide chat window initially on mobile */
    }
    
    /* Switch display when chat is active on mobile */
    .chat-workspace.chat-active .chat-sidebar {
        display: none;
    }
    
    .chat-workspace.chat-active .chat-window {
        display: flex;
        width: 100%;
    }
    
    .chat-workspace.chat-active .btn-chat-back {
        display: flex;
    }
}

@media (max-width: 600px) {
    .notes-workspace {
        padding: 16px;
        gap: 20px;
    }
    
    .notes-grid {
        grid-template-columns: 1fr;
    }
    
    .note-card {
        padding: 16px;
        min-height: 150px;
    }
    
    .card-actions {
        opacity: 1;
        transform: none;
        position: static;
        margin-top: 12px;
        justify-content: flex-end;
    }
    
    /* Responsive Modal Card behavior */
    .modal-card {
        padding: 20px 16px;
        width: 95%;
        border-radius: 16px;
        max-height: 95vh;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .form-group.half {
        width: 100%;
    }
    
    .form-group.align-end {
        justify-content: flex-start;
        margin-top: 8px;
    }
    
    #note-title {
        font-size: 1.25rem;
    }
    
    .theme-picker {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .theme-circle {
        width: 24px;
        height: 24px;
    }
    
    .modal-footer {
        padding-top: 12px;
    }

    /* Small screen chat bubbles */
    .chat-messages-container {
        padding: 12px 16px;
        gap: 8px;
    }
    
    .chat-message {
        max-width: 85%;
        padding: 8px 12px;
    }
    
    .chat-input-area {
        padding: 12px 16px;
        gap: 8px;
    }
    
    #chat-message-input {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    /* Mobile video call picture-in-picture size */
    #local-video {
        width: 90px;
        height: 120px;
        top: 16px;
        right: 16px;
        border-radius: 8px;
    }
}
