@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Poppins:wght@500;600;700&display=swap');

:root {
    /* Colors - Brand */
    --brand-primary: #6366f1;
    /* Indigo 500 */
    --brand-secondary: #8b5cf6;
    /* Violet 500 */
    --brand-gradient: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));

    /* Colors - Accent */
    --accent-blue: #3b82f6;
    /* Electric Blue */
    --accent-glow: rgba(59, 130, 246, 0.5);

    /* Colors - Neutral (Light Mode) */
    --bg-body: #f3f4f6;
    --bg-surface: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.7);
    --text-main: #111827;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-brand: 0 10px 25px -5px rgba(99, 102, 241, 0.4);

    /* Spacing & Radius */
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-full: 9999px;

    /* Layout */
    --sidebar-width: 260px;
    --header-height: 70px;
}

[data-theme="dark"] {
    --bg-body: #0f172a;
    /* Slate 900 */
    --bg-surface: #1e293b;
    /* Slate 800 */
    --bg-glass: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --shadow-brand: 0 10px 25px -5px rgba(99, 102, 241, 0.3);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Poppins', sans-serif;
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Utilities */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-4 {
    gap: 1rem;
}

.gap-6 {
    gap: 1.5rem;
}

.gap-8 {
    gap: 2rem;
}

.w-full {
    width: 100%;
}

.h-full {
    height: 100%;
}

.h-screen {
    height: 100vh;
}

.text-center {
    text-align: center;
}

.text-sm {
    font-size: 0.875rem;
}

.text-lg {
    font-size: 1.125rem;
}

.text-xl {
    font-size: 1.25rem;
}

.text-2xl {
    font-size: 1.5rem;
}

.font-bold {
    font-weight: 700;
}

.font-medium {
    font-weight: 500;
}

.text-muted {
    color: var(--text-muted);
}

.text-brand {
    color: var(--brand-primary);
}

.text-accent {
    color: var(--accent-blue);
}

.hidden {
    display: none;
}

/* Components */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    font-size: 0.95rem;
}

.btn-primary {
    background: var(--brand-gradient);
    color: white;
    box-shadow: var(--shadow-brand);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px -5px rgba(99, 102, 241, 0.5);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-main);
}

.btn-outline:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
    background: rgba(99, 102, 241, 0.05);
}

.card {
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s;
}

.glass-panel {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
}

[data-theme="dark"] .glass-panel {
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.input-field {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-body);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-field:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.badge-error {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* Dashboard Layout */
.dashboard-layout {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    min-height: 100vh;
}

.sidebar {
    background: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    padding: 1.5rem;
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content {
    background: var(--bg-body);
    padding: 2rem;
    overflow-y: auto;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

/* Nav Item */
.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    border-radius: var(--radius-md);
    transition: all 0.2s;
    margin-bottom: 0.5rem;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--brand-primary);
}

.nav-item i {
    font-size: 1.25rem;
}

text-align: center;
}

.text-sm {
    font-size: 0.875rem;
}

.text-lg {
    font-size: 1.125rem;
}

.text-xl {
    font-size: 1.25rem;
}

.text-2xl {
    font-size: 1.5rem;
}

.font-bold {
    font-weight: 700;
}

.font-medium {
    font-weight: 500;
}

.text-muted {
    color: var(--text-muted);
}

.text-brand {
    color: var(--brand-primary);
}

.text-accent {
    color: var(--accent-blue);
}

.hidden {
    display: none;
}

/* Components */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    font-size: 0.95rem;
}

.btn-primary {
    background: var(--brand-gradient);
    color: white;
    box-shadow: var(--shadow-brand);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px -5px rgba(99, 102, 241, 0.5);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-main);
}

.btn-outline:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
    background: rgba(99, 102, 241, 0.05);
}

.card {
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s;
}

.glass-panel {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
}

[data-theme="dark"] .glass-panel {
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.input-field {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-body);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-field:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.badge-error {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* Dashboard Layout */
.dashboard-layout {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    min-height: 100vh;
}

.sidebar {
    background: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    padding: 1.5rem;
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content {
    background: var(--bg-body);
    padding: 2rem;
    overflow-y: auto;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

/* Nav Item */
.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    border-radius: var(--radius-md);
    transition: all 0.2s;
    margin-bottom: 0.5rem;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--brand-primary);
}

.nav-item i {
    font-size: 1.25rem;
}

/* Inbox Specifics */
.inbox-layout {
    display: grid;
    grid-template-columns: 320px 1fr 280px;
    gap: 0;
    /* Remove gap to avoid overflow calculation issues */
    height: calc(100vh - 85px);
    /* Adjusted for accurate header height */
    overflow: hidden;
}

.conversation-list {
    overflow-y: auto;
    height: 100%;
}

.chat-thread {
    display: flex;
    flex-direction: column;
}

/* Chat Messages Area */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background-color: var(--bg-body);
}

.message {
    max-width: 70%;
    padding: 0.85rem 1.25rem;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.5;
    position: relative;
    word-wrap: break-word;
}

.message.received {
    background: var(--bg-surface);
    border-bottom-left-radius: 4px;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.message.sent {
    background: var(--brand-gradient);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.2);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(156, 163, 175, 0.5);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(156, 163, 175, 0.8);
}

/* Toggle Switch */
.theme-switch {
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    padding: 4px;
    display: flex;
    gap: 4px;
    cursor: pointer;
}

.theme-switch-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--text-muted);
    transition: all 0.2s;
}

.theme-switch-icon.active {
    background: var(--bg-surface);
    color: var(--brand-primary);
    box-shadow: var(--shadow-sm);
}

/* Mobile Responsiveness */
@media (max-width: 1024px) {
    .inbox-layout {
        grid-template-columns: 300px 1fr;
    }

    .inbox-layout>div:nth-child(3) {
        /* User Info */
        display: none;
    }
}

@media (max-width: 768px) {
    .dashboard-layout {
        display: block;
    }

    .sidebar {
        display: none;
        /* Hide sidebar on mobile for now */
    }

    .inbox-layout {
        display: flex;
        flex-direction: column;
        height: calc(100vh - 70px);
    }

    .inbox-layout>div:nth-child(1) {
        /* List */
        height: 40vh;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    /* Hero */
    .hero>div>div {
        grid-template-columns: 1fr !important;
        text-align: center;
        gap: 2rem !important;
    }

    .hero h1 {
        font-size: 2.5rem !important;
    }
}