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

:root {
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-card-hover: #334155;
    --primary: #0284c7;
    --primary-hover: #0369a1;
    --accent: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --sidebar-width: 260px;
}

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

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

/* Screen Switcher */
.app-screen {
    display: none;
    width: 100%;
    height: 100vh;
}
.app-screen.active {
    display: flex;
}

/* LOGIN SCREEN */
.login-wrapper {
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100vh;
    background: radial-gradient(circle at top right, #1e1b4b, #0f172a);
}

.login-card {
    background: rgba(30, 41, 59, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

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

.login-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.login-header h1 i {
    color: var(--primary);
}

.login-header p {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 6px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: #0f172a;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.form-control:focus {
    border-color: var(--primary);
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-primary:active {
    transform: scale(0.98);
}

/* MAIN DASHBOARD */
.dashboard-container {
    display: flex;
    width: 100%;
    height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: #1e293b;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-header i {
    font-size: 24px;
    color: var(--primary);
}

.sidebar-header h2 {
    font-size: 18px;
    font-weight: 700;
}

.sidebar-menu {
    list-style: none;
    padding: 16px;
    flex: 1;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s;
    margin-bottom: 4px;
}

.sidebar-menu li a:hover,
.sidebar-menu li a.active {
    background: rgba(2, 132, 199, 0.15);
    color: #fff;
}

.sidebar-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.agent-info p {
    font-size: 14px;
    font-weight: 600;
}

.agent-info span {
    font-size: 12px;
    color: var(--accent);
}

.btn-logout {
    background: transparent;
    border: none;
    color: var(--danger);
    font-size: 16px;
    cursor: pointer;
}

/* MAIN CONTENT AREA */
.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #0f172a;
}

.content-tab {
    display: none;
    height: 100%;
    width: 100%;
}

.content-tab.active {
    display: flex;
}

/* CHAT QUEUE & WORKSPACE (TAWK.TO LAYOUT) */
.chat-workspace {
    display: flex;
    width: 100%;
    height: 100%;
}

.queue-panel {
    width: 320px;
    background: #1e293b;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    font-size: 15px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.badge {
    background: var(--primary);
    color: #fff;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
}

.badge-danger {
    background: var(--danger);
}

.queue-list {
    flex: 1;
    overflow-y: auto;
}

.queue-item {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s;
}

.queue-item:hover,
.queue-item.active {
    background: var(--bg-card-hover);
}

.queue-item-header {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.queue-item-platform {
    font-size: 11px;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.queue-item-wait {
    font-size: 12px;
    color: var(--warning);
}

.btn-accept {
    margin-top: 8px;
    width: 100%;
    padding: 6px 12px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

/* CHAT MAIN PANEL */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #0f172a;
}

.chat-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
}

.chat-empty i {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.chat-header {
    padding: 16px 24px;
    background: #1e293b;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-user-details h3 {
    font-size: 16px;
    font-weight: 600;
}

.chat-user-details p {
    font-size: 13px;
    color: var(--text-muted);
}

.btn-close-chat {
    padding: 8px 16px;
    background: var(--danger);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
}

.chat-messages {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message-bubble {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
}

.message-bubble.user {
    align-self: flex-start;
    background: #334155;
    color: #fff;
    border-bottom-left-radius: 2px;
}

.message-bubble.agent {
    align-self: flex-end;
    background: var(--primary);
    color: #fff;
    border-bottom-right-radius: 2px;
}

.message-bubble.system {
    align-self: center;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-size: 12px;
    border-radius: 20px;
    padding: 6px 16px;
}

.message-meta {
    font-size: 10px;
    opacity: 0.7;
    margin-top: 4px;
    text-align: right;
}

.chat-input-area {
    padding: 16px 24px;
    background: #1e293b;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
}

.chat-input-area input {
    flex: 1;
    background: #0f172a;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    color: #fff;
    outline: none;
}

.chat-input-area button {
    padding: 12px 24px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

/* USER INFO RIGHT SIDEBAR */
.info-panel {
    width: 280px;
    background: #1e293b;
    border-left: 1px solid var(--border-color);
    padding: 24px;
    overflow-y: auto;
}

.info-panel h4 {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.info-item {
    margin-bottom: 16px;
}

.info-item label {
    font-size: 12px;
    color: var(--text-muted);
    display: block;
}

.info-item p {
    font-size: 14px;
    font-weight: 500;
    margin-top: 2px;
}

/* ADMIN PANELS */
.admin-container {
    padding: 32px;
    width: 100%;
    overflow-y: auto;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #1e293b;
    border-radius: 12px;
    overflow: hidden;
}

.data-table th,
.data-table td {
    padding: 14px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

.data-table th {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    font-weight: 600;
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal-overlay.active {
    display: flex;
}

.modal-card {
    background: #1e293b;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 32px;
    width: 100%;
    max-width: 500px;
}
