/* Google Fonts - Plus Jakarta Sans */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
    /* Brand Colors - Premium Feel */
    --primary: #4318FF;
    --primary-light: #F4F7FE;
    --primary-dark: #2B3674;
    --secondary: #A3AED0;

    /* UI Colors */
    --background: #F4F7FE;
    --surface: #FFFFFF;
    --surface-alt: #F8F9FA;
    --glass: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);

    /* Text Colors */
    --text-main: #2B3674;
    --text-secondary: #A3AED0;
    --text-white: #FFFFFF;

    /* Status Colors */
    --success: #05CD99;
    --warning: #FFB547;
    --danger: #EE5D50;
    --info: #11CDEF;

    /* Borders & Shadows */
    --border: #E0E5F2;
    --shadow-sm: 0px 2px 4px rgba(112, 144, 176, 0.08);
    --shadow-md: 0px 8px 16px rgba(112, 144, 176, 0.12);
    --shadow-lg: 0px 18px 40px rgba(112, 144, 176, 0.12);
    --shadow-premium: 0px 20px 50px rgba(67, 24, 255, 0.15);

    /* Spacing */
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 30px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--background);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.2s;
}

ul {
    list-style: none;
}

button {
    font-family: inherit;
}

/* === Layout Utilities === */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.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-1 {
    gap: 0.5rem;
}

.gap-2 {
    gap: 1rem;
}

.truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gap-4 {
    gap: 2rem;
}

.w-full {
    width: 100%;
}

.h-screen {
    height: 100vh;
}

.h-full {
    height: 100%;
}

.flex-1 {
    flex: 1;
}

.hidden {
    display: none !important;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.text-center {
    text-align: center;
}

.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}

.text-warning {
    color: var(--warning);
}

/* === Landing Page Components === */
.hero-section {
    padding: 8rem 0 4rem;
    text-align: center;
    background: radial-gradient(circle at top right, rgba(67, 24, 255, 0.05) 0%, transparent 50%);
}

.hero-title {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    line-height: 1.1;
    letter-spacing: -2px;
}

/* Auth Pages */
.auth-layout {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--background);
    padding: 2rem;
}

.auth-card {
    width: 100%;
    max-width: 450px;
    text-align: center;
}

.auth-header {
    margin-bottom: 2.5rem;
}

.auth-logo {
    width: 64px;
    height: 64px;
    background: var(--primary);
    color: white;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--secondary);
    max-width: 700px;
    margin: 0 auto 2.5rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem;
    padding: 4rem 0;
}

.feature-card {
    background: white;
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    border: 1px solid var(--border);
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.feature-icon {
    width: 60px;
    height: 60px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.feature-icon svg {
    width: 30px;
    height: 30px;
}

/* === Typography === */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-main);
    font-weight: 700;
}

h1 {
    font-size: 2.5rem;
    line-height: 1.2;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

.text-sm {
    font-size: 0.875rem;
}

.text-xs {
    font-size: 0.75rem;
}

.text-secondary {
    color: var(--text-secondary);
}

.text-primary {
    color: var(--primary);
}

/* === Components === */

/* Buttons - Modernized */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 1.75rem;
    border-radius: var(--radius-xl);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    outline: none;
    text-transform: capitalize;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    border-radius: var(--radius-md);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #6A4BFF 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(67, 24, 255, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 8px 25px rgba(67, 24, 255, 0.4);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: var(--surface);
    color: var(--text-main);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background-color: var(--surface-alt);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
    font-weight: 700;
}

.btn-outline:hover {
    background: var(--primary-light);
}

.btn-danger {
    background: #FF5630;
    color: white;
    box-shadow: 0 4px 15px rgba(255, 86, 48, 0.3);
}

.btn-danger:hover {
    background: #DE350B;
}

/* Cards - Premium Glassmorphism Effect */
.card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid white;
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-premium);
}

/* Forms - Modern Inputs */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
}

.form-control,
.form-input {
    width: 100%;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--surface-alt);
    color: var(--text-main);
    font-size: 0.95rem;
    transition: all 0.2s;
}

.form-control:focus,
.form-input:focus {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(67, 24, 255, 0.1);
    outline: none;
}

.form-row {
    display: flex;
    gap: 1.5rem;
}

.form-row .form-group {
    flex: 1;
}

/* === Modal - New Centered Premium Design === */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
    display: none;
    /* JS toggles flex */
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal {
    background: white;
    width: 90%;
    max-width: 500px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    transform: scale(0.9);
    animation: zoomIn 0.3s ease forwards;
    overflow: hidden;
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
}

.modal-body {
    padding: 2rem;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes zoomIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}


/* === Sidebar === */
.sidebar {
    width: 280px;
    background: white;
    border-right: none;
    box-shadow: var(--shadow-sm);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 10;
}

.sidebar-brand {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 3rem;
    padding-left: 0.5rem;
}

.brand-icon {
    color: var(--primary);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    color: var(--secondary);
    font-weight: 600;
    margin-bottom: 0.5rem;
    transition: all 0.2s;
    position: relative;
}

.nav-link:hover {
    color: var(--primary);
    background: var(--primary-light);
}

.nav-link.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 10px 20px rgba(67, 24, 255, 0.2);
}

.nav-link.active::before {
    content: '';
    position: absolute;
    right: -1.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    background: var(--primary);
    border-radius: 4px;
}

.nav-link svg {
    width: 22px;
    height: 22px;
}


/* === Main Content === */
.main-content {
    margin-left: 280px;
    flex: 1;
    padding: 2.5rem;
    background: var(--background);
    min-height: 100vh;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

.page-title {
    font-size: 0.9rem;
    color: var(--secondary);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.page-heading {
    font-size: 2.25rem;
    color: var(--text-main);
    letter-spacing: -1px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: white;
    padding: 0.75rem 1.25rem;
    border-radius: 40px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: 0.2s;
}

.user-profile:hover {
    box-shadow: var(--shadow-md);
}

.avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4318FF, #868CFF);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}

/* === Custom Feature Components === */

/* QR Code Area */
.qr-container {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-md);
    text-align: center;
    border: 2px dashed var(--border);
}

.qr-placeholder {
    width: 250px;
    height: 250px;
    margin: 0 auto 1.5rem;
    background: var(--surface-alt);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* List Groups */
.auto-reply-list,
.options-list {
    display: grid;
    gap: 1rem;
}

/* Status Dots */
.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
}

.status-dot.connected {
    background: var(--success);
    box-shadow: 0 0 12px rgba(5, 205, 153, 0.5);
}

.status-dot.disconnected {
    background: var(--danger);
}

.status-dot.waiting {
    background: var(--warning);
    animation: pulse 1s infinite;
}

/* Chat Window */
.chat-window {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    display: flex;
    height: calc(90vh - 100px);
    border: 1px solid var(--border);
}

.chat-list {
    width: 360px;
    border-right: 1px solid var(--border);
    background: white;
    overflow-y: auto;
}

.chat-item {
    transition: 0.2s;
    border-bottom: 1px solid var(--border);
}

.chat-item:hover {
    background: var(--primary-light);
}

.chat-item.active {
    background: var(--primary-light);
    border-left: 4px solid var(--primary);
}

.chat-view {
    flex: 1;
    background: #e5ddd5;
    background-image: url("https://user-images.githubusercontent.com/15075759/28719144-86dc0f70-73b1-11e7-911d-60d70fcded21.png");
    display: flex;
    flex-direction: column;
}

.message-bubble {
    max-width: 70%;
    padding: 0.85rem 1.25rem;
    border-radius: 12px;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    line-height: 1.4;
}

.message-bubble.received {
    background: white;
    border-top-left-radius: 2px;
    align-self: flex-start;
}

.message-bubble.sent {
    background: #dcf8c6;
    border-top-right-radius: 2px;
    align-self: flex-end;
}


/* Auto Reply & Menu List Items */
.list-item-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: 0.2s;
}

.list-item-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 1000;
    border-left: 5px solid var(--success);
    animation: slideIn 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes slideIn {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* === Grid Utilities (Tailwind-like) === */
.grid {
    display: grid;
}

.gap-6 {
    gap: 1.5rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.grid-cols-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

@media (min-width: 768px) {
    .md\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .md\:grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .lg\:grid-cols-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}