/* Modern, Responsive Theme Stylesheet for User & Admin Management Application */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #e0e7ff;
    --secondary: #7c3aed;
    --accent: #06b6d4;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --sidebar-bg: #1e1b4b;
    --sidebar-hover: rgba(255, 255, 255, 0.08);
    --sidebar-active: #4f46e5;
    --sidebar-width: 260px;
    --topbar-height: 64px;
    --body-bg: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1.25rem;
    --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-2xl: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--body-bg);
    color: var(--text-primary);
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ===============================================================
   ULTRA-MODERN AUTH STYLES (User & Admin Eye-Catchy Login/Register)
   =============================================================== */

/* User Auth Background: Vibrant Ambient Glow & Mesh */
.auth-page-user {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 40%),
                radial-gradient(circle at 90% 80%, rgba(168, 85, 247, 0.18) 0%, transparent 45%),
                radial-gradient(circle at 50% 50%, rgba(6, 182, 212, 0.08) 0%, transparent 60%),
                #f8fafc;
    position: relative;
    padding: 2.5rem 1rem;
    overflow: hidden;
}

/* Admin Auth Background: Cyberpunk / Executive Dark Glassmorphism */
.auth-page-admin {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 20% 15%, rgba(225, 29, 72, 0.15) 0%, transparent 40%),
                radial-gradient(circle at 80% 85%, rgba(79, 70, 229, 0.2) 0%, transparent 45%),
                radial-gradient(circle at 50% 50%, rgba(15, 23, 42, 1) 0%, #090d16 100%);
    position: relative;
    padding: 2.5rem 1rem;
    overflow: hidden;
    color: #f8fafc;
}

/* Floating Ambient Orbs for Visual Depth */
.auth-bg-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: 0;
    pointer-events: none;
    opacity: 0.7;
    animation: floatBlob 12s infinite alternate ease-in-out;
}

.auth-bg-blob-1 {
    width: 320px;
    height: 320px;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    top: -50px;
    left: -50px;
}

.auth-bg-blob-2 {
    width: 380px;
    height: 380px;
    background: linear-gradient(135deg, #06b6d4, #3b82f6);
    bottom: -60px;
    right: -60px;
    animation-delay: -6s;
}

.auth-bg-blob-admin-1 {
    width: 350px;
    height: 350px;
    background: linear-gradient(135deg, #e11d48, #be123c);
    top: -60px;
    right: -60px;
    opacity: 0.35;
}

.auth-bg-blob-admin-2 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #4338ca, #6366f1);
    bottom: -80px;
    left: -80px;
    opacity: 0.3;
}

@keyframes floatBlob {
    0% { transform: translateY(0px) scale(1); }
    100% { transform: translateY(35px) scale(1.08); }
}

/* Modern Eye-Catchy Auth Card */
.modern-auth-card {
    background: #ffffff;
    border-radius: var(--radius-xl);
    box-shadow: 0 20px 40px -15px rgba(15, 23, 42, 0.12), 0 0 1px 1px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(226, 232, 240, 0.8);
    width: 100%;
    max-width: 460px;
    position: relative;
    z-index: 10;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.modern-auth-card.wide-card {
    max-width: 620px;
}

/* Admin Glassmorphism Card */
.admin-glass-card {
    background: rgba(30, 27, 75, 0.65);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-xl);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6), 0 0 20px 2px rgba(225, 29, 72, 0.15);
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 10;
    overflow: hidden;
    color: #ffffff;
}

/* Card Header Stylings */
.auth-brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.auth-brand-badge.user-badge {
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary);
    border: 1px solid rgba(79, 70, 229, 0.2);
}

.auth-brand-badge.admin-badge {
    background: rgba(225, 29, 72, 0.18);
    color: #fb7185;
    border: 1px solid rgba(225, 29, 72, 0.35);
}

.auth-icon-circle {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    font-size: 1.75rem;
    position: relative;
}

.auth-icon-circle.user-circle {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: #ffffff;
    box-shadow: 0 10px 20px -5px rgba(79, 70, 229, 0.4);
}

.auth-icon-circle.admin-circle {
    background: linear-gradient(135deg, #e11d48 0%, #be123c 100%);
    color: #ffffff;
    box-shadow: 0 10px 25px -5px rgba(225, 29, 72, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

/* Inputs & Form Groups */
.form-floating-custom {
    position: relative;
    margin-bottom: 1.25rem;
}

.form-floating-custom label {
    font-size: 0.825rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
    display: block;
}

.admin-glass-card .form-floating-custom label {
    color: #cbd5e1;
}

.input-icon-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon-group .input-icon {
    position: absolute;
    left: 1rem;
    color: #94a3b8;
    font-size: 1rem;
    transition: var(--transition);
    pointer-events: none;
    z-index: 5;
}

.input-icon-group .form-control {
    padding-left: 2.75rem;
    padding-right: 2.75rem;
    height: 48px;
    border-radius: 0.65rem;
    border: 1.5px solid var(--border-color);
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
    background-color: #ffffff;
}

.admin-glass-card .input-icon-group .form-control {
    background: rgba(15, 23, 42, 0.6);
    border-color: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.input-icon-group .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15);
    outline: none;
}

.admin-glass-card .input-icon-group .form-control:focus {
    border-color: #f43f5e;
    box-shadow: 0 0 0 4px rgba(244, 63, 94, 0.25);
}

.input-icon-group .form-control:focus + .input-icon,
.input-icon-group .form-control:focus ~ .input-icon {
    color: var(--primary);
}

.admin-glass-card .input-icon-group .form-control:focus ~ .input-icon {
    color: #f43f5e;
}

.toggle-password-btn {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0.5rem;
    font-size: 0.95rem;
    transition: var(--transition);
    z-index: 5;
}

.toggle-password-btn:hover {
    color: var(--primary);
}

.admin-glass-card .toggle-password-btn:hover {
    color: #f43f5e;
}

/* Gradient Action Buttons */
.btn-auth-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: #ffffff;
    border: none;
    border-radius: 0.65rem;
    height: 48px;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 10px 20px -5px rgba(79, 70, 229, 0.4);
    transition: var(--transition);
}

.btn-auth-primary:hover {
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 15px 25px -5px rgba(79, 70, 229, 0.5);
}

.btn-auth-primary:active {
    transform: translateY(0);
}

.btn-auth-admin {
    background: linear-gradient(135deg, #e11d48 0%, #be123c 100%);
    color: #ffffff;
    border: none;
    border-radius: 0.65rem;
    height: 48px;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 10px 25px -5px rgba(225, 29, 72, 0.5);
    transition: var(--transition);
}

.btn-auth-admin:hover {
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 15px 30px -5px rgba(225, 29, 72, 0.65);
}

/* Quick Fill Demo Chip */
.demo-fill-chip {
    background: rgba(79, 70, 229, 0.06);
    border: 1px dashed rgba(79, 70, 229, 0.3);
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.785rem;
    color: var(--primary);
    font-weight: 600;
}

.demo-fill-chip:hover {
    background: rgba(79, 70, 229, 0.12);
}

.admin-glass-card .demo-fill-chip {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fca5a5;
}

.admin-glass-card .demo-fill-chip:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* ===============================================================
   APP SHELL & DASHBOARDS
   =============================================================== */
.app-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.app-sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1040;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.sidebar-brand {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: #ffffff;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.15);
}

.sidebar-brand i {
    margin-right: 0.75rem;
    color: #818cf8;
}

.sidebar-menu {
    list-style: none;
    padding: 1rem 0.75rem;
    margin: 0;
    flex: 1;
}

.sidebar-menu-heading {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    padding: 0.75rem 0.75rem 0.25rem;
    font-weight: 600;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: #cbd5e1;
    text-decoration: none;
    border-radius: var(--radius-md);
    margin-bottom: 0.25rem;
    font-size: 0.925rem;
    font-weight: 500;
    transition: var(--transition);
}

.sidebar-link i {
    width: 24px;
    font-size: 1.1rem;
    margin-right: 0.75rem;
    color: #94a3b8;
    transition: var(--transition);
}

.sidebar-link:hover {
    color: #ffffff;
    background-color: var(--sidebar-hover);
}

.sidebar-link:hover i {
    color: #ffffff;
}

.sidebar-link.active {
    color: #ffffff;
    background-color: var(--sidebar-active);
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.3);
}

.sidebar-link.active i {
    color: #ffffff;
}

/* Explicit High-Contrast Logout Link in Sidebar */
.sidebar-link.sidebar-link-logout {
    color: #f87171 !important;
    font-weight: 600;
    margin-top: 0.5rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.sidebar-link.sidebar-link-logout i {
    color: #ef4444 !important;
}

.sidebar-link.sidebar-link-logout:hover {
    color: #ffffff !important;
    background: #dc2626 !important;
    border-color: #dc2626 !important;
}

.sidebar-link.sidebar-link-logout:hover i {
    color: #ffffff !important;
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

.app-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.app-topbar {
    height: var(--topbar-height);
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.app-content {
    flex: 1;
    padding: 1.5rem;
}

/* Stat Cards */
.stat-card {
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    color: #ffffff;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.stat-card.bg-gradient-indigo {
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
}

.stat-card.bg-gradient-emerald {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
}

.stat-card.bg-gradient-amber {
    background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
}

.stat-card.bg-gradient-rose {
    background: linear-gradient(135deg, #e11d48 0%, #f43f5e 100%);
}

.stat-card.bg-gradient-purple {
    background: linear-gradient(135deg, #7c3aed 0%, #8b5cf6 100%);
}

.stat-card.bg-gradient-cyan {
    background: linear-gradient(135deg, #0891b2 0%, #06b6d4 100%);
}

.stat-icon {
    position: absolute;
    right: 1.25rem;
    bottom: 1.25rem;
    font-size: 3.5rem;
    opacity: 0.15;
}

.stat-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0;
}

/* Custom Cards */
.card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    background-color: #ffffff;
    margin-bottom: 1.5rem;
}

.card-header {
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
    font-weight: 600;
    border-top-left-radius: var(--radius-lg) !important;
    border-top-right-radius: var(--radius-lg) !important;
}

/* Support Tickets Chat Thread */
.chat-thread {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 500px;
    overflow-y: auto;
    padding: 1rem;
    background-color: #f8fafc;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.chat-bubble {
    max-width: 75%;
    padding: 0.85rem 1.15rem;
    border-radius: var(--radius-lg);
    position: relative;
}

.chat-bubble.user-bubble {
    align-self: flex-end;
    background: var(--primary);
    color: #ffffff;
    border-bottom-right-radius: var(--radius-sm);
}

.chat-bubble.admin-bubble {
    align-self: flex-start;
    background: #ffffff;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: var(--radius-sm);
}

.chat-meta {
    font-size: 0.75rem;
    margin-bottom: 0.25rem;
    opacity: 0.8;
}

/* Mobile Responsiveness */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1035;
}

@media (max-width: 991.98px) {
    .app-sidebar {
        transform: translateX(-100%) !important;
        box-shadow: none;
    }

    .app-sidebar.show {
        transform: translateX(0) !important;
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.4) !important;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.6);
        z-index: 1035;
        backdrop-filter: blur(2px);
    }

    .sidebar-overlay.show {
        display: block !important;
    }

    .app-main {
        margin-left: 0 !important;
    }
}
