:root {
    --bg-dark: #f5f6f8;
    --sidebar-bg: #ffffff;
    --accent: #00a1e0;
    --accent-glow: rgba(0, 161, 224, 0.25);
    --text-primary: #0a0b0d;
    --text-secondary: #556070;
    --border: rgba(0, 0, 0, 0.08);
    --glass: rgba(0, 0, 0, 0.03);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: #2c3e50;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #34495e;
}

/* Firefox support */
* {
    scrollbar-width: thin;
    scrollbar-color: #2c3e50 var(--bg-dark);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    height: 100vh;
    display: flex;
    overflow: hidden;
}

.app-container {
    display: flex;
    width: 100%;
    height: 100%;
}

/* Sidebar */
.sidebar {
    width: 240px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 16px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 48px;
}

.brand img {
    height: 32px;
}

.brand h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 20px;
    letter-spacing: -1px;
}

.brand h2 span {
    font-size: 12px;
    color: var(--accent);
    vertical-align: top;
}

.nav-section {
    margin-bottom: 32px;
}

.nav-section h3 {
    font-size: 10px;
    color: var(--text-secondary);
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot.online {
    background-color: #23d160;
    box-shadow: 0 0 8px rgba(35, 209, 96, 0.4);
}

.nav-btn {
    width: 100%;
    padding: 10px;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    text-align: left;
    font-size: 13px;
    cursor: pointer;
    margin-bottom: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    border-color: var(--accent);
}

.nav-btn.active {
    background: var(--accent);
    box-shadow: 0 4px 15px var(--accent-glow);
    border-color: transparent;
}

.user-info-mini {
    margin-bottom: 25px;
    padding: 10px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 8px;
}

.user-info-mini:hover {
    background: rgba(0, 0, 0, 0.04);
}

.user-info-mini.active {
    background: rgba(0, 161, 224, 0.1);
    border-color: var(--accent);
}

/* Chat Area */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    background: radial-gradient(circle at 50% 0%, #ffffff 0%, #f5f6f8 100%);
}

.chat-header {
    height: 60px;
    padding: 0 30px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-info h1 {
    font-size: 18px;
    font-weight: 600;
}

.header-info p {
    font-size: 12px;
    color: var(--text-secondary);
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message {
    max-width: 85%;
    animation: fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.message-content {
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.4;
    position: relative;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.user-message {
    align-self: flex-end;
}

.user-message .message-content {
    background: linear-gradient(135deg, var(--accent) 0%, #0077b6 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.assistant-message {
    align-self: flex-start;
}

.assistant-message .message-content {
    background-color: #ffffff;
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

/* Chat Input */
.chat-input-container {
    padding: 24px 40px 40px;
}

.input-wrapper {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 16px;
    display: flex;
    align-items: center;
    padding: 8px 16px;
    transition: all 0.2s;
}

.input-wrapper:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 10px;
    font-size: 14px;
}

input:focus {
    outline: none;
}

#send-btn {
    background: var(--accent);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s;
}

#send-btn:hover {
    transform: scale(1.05);
}

.input-hint {
    font-size: 11px;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 12px;
}

/* Markdown styling in messages */
.message-content strong {
    color: var(--accent);
}

.message-content b {
    color: var(--accent);
}

/* Typing indicator */
/* Mobile Toggle */
.mobile-only {
    display: none;
}

/* Media Query for Mobile */
@media (max-width: 768px) {
    .mobile-only {
        display: flex;
        background: transparent;
        border: none;
        color: var(--text-primary);
        font-size: 20px;
        cursor: pointer;
        margin-right: 15px;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: 80%;
        max-width: 300px;
        box-shadow: 20px 0 50px rgba(0, 0, 0, 0.5);
        overflow-y: auto;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .chat-header {
        padding: 0 20px;
        height: 70px;
    }

    .header-info {
        display: flex;
        align-items: center;
    }

    .messages-container {
        padding: 20px 15px;
        gap: 16px;
    }

    .message {
        max-width: 90%;
    }

    .chat-input-container {
        padding: 15px;
    }

    .input-wrapper {
        padding: 4px 12px;
        border-radius: 25px;
    }

    input {
        padding: 10px 5px;
        font-size: 14px;
    }

    #send-btn {
        width: 36px;
        height: 36px;
        border-radius: 50%;
    }

    /* Overlay when sidebar is active */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(4px);
        z-index: 999;
    }

    .sidebar-overlay.active {
        display: block;
    }
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #2c3e50;
    transition: 0.3s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked+.toggle-slider {
    background-color: #f39c12;
}

.toggle-switch input:checked+.toggle-slider:before {
    transform: translateX(24px);
}

.toggle-slider:hover {
    opacity: 0.9;
}

/* --- Login Page Styles --- */
.login-body {
    background: url('https://images.unsplash.com/photo-1451187580459-43490279c0fa?q=80&w=2072&auto=format&fit=crop') no-repeat center center fixed;
    background-size: cover;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-body::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(245, 246, 248, 0.85);
    /* Overlay Light */
    backdrop-filter: blur(5px);
    z-index: -1;
}

.login-container {
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-card {
    background: rgba(255, 255, 255, 0.75);
    /* Glass */
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    padding: 50px 40px;
    border-radius: 24px;
    width: 400px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

.login-header {
    margin-bottom: 30px;
}

.login-header .logo {
    font-family: 'Outfit', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
    letter-spacing: -1px;
}

.login-header .logo i {
    color: var(--accent);
}

.login-header h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 5px;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.input-group {
    position: relative;
    margin-bottom: 20px;
    text-align: left;
}

.input-group label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    margin-left: 5px;
}

.input-group input {
    width: 100%;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 14px 14px 14px 45px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.3s;
}

.input-group input:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

.input-group i {
    position: absolute;
    left: 15px;
    top: 38px;
    color: var(--text-secondary);
    font-size: 16px;
    transition: 0.3s;
}

.input-group input:focus+i {
    color: var(--accent);
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--accent) 0%, #0077b6 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px var(--accent-glow);
}

.login-footer {
    margin-top: 25px;
    font-size: 13px;
    color: var(--text-secondary);
}

.alert {
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 13px;
    text-align: left;
}

.alert-error,
.alert-danger {
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.3);
    color: #ff6b6b;
}

/* --- Profile Section Styles --- */
.section-view {
    padding: 40px;
    overflow-y: auto;
}

.profile-card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    padding: 30px;
    max-width: 800px;
    margin-bottom: 30px;
}

.profile-header {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.profile-avatar {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--accent) 0%, #0077b6 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.profile-info h2 {
    margin: 0 0 5px 0;
    font-size: 24px;
}

.profile-info p {
    color: var(--text-secondary);
    margin: 0;
}

.role-badge {
    margin-top: 10px;
    display: inline-block;
    padding: 4px 12px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 20px;
    font-size: 12px;
    color: var(--text-primary);
}

.settings-label {
    display: block;
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 8px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.report-input-wrapper {
    padding: 15px;
    margin-bottom: 15px;
    text-align: left;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

.report-input-wrapper input {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-primary) !important;
    font-family: 'Inter';
    font-size: 14px;
    outline: none;
    padding: 0 !important;
}

.info-banner {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 30px;
    line-height: 1.6;
    display: flex;
    gap: 10px;
}

/* Media Queries for Mobile - Profile */
@media (max-width: 768px) {
    .section-view {
        padding: 20px;
    }

    .profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 15px;
    }

    .profile-card {
        padding: 20px;
    }

    .profile-info h2 {
        font-size: 20px;
    }
}