:root {
    --bg-body: #0D0C1D;
    --bg-card: #161B33;
    --bg-glass: rgba(22, 27, 51, 0.7);
    --accent-gold: #F1DAC4;
    --accent-purple: #8b5cf6;
    --text-main: #ffffff;
    --text-muted: #A69CAC;
    --success: #10b981;
    --danger: #ef4444;
    --font-main: 'Inter', sans-serif;
    --glass-border: 1px solid rgba(255, 255, 255, 0.05);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-body);
    font-family: var(--font-main);
    color: var(--text-main);
    overflow-x: hidden;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-main);
    font-weight: 700;
}

.text-gold {
    color: var(--accent-gold);
}

.text-purple {
    color: var(--accent-purple);
}

a {
    text-decoration: none;
    color: var(--text-main);
    transition: color 0.3s;
}

a:hover {
    color: var(--accent-gold);
}

/* Glassmorphism Classes */
.glass {
    background: var(--bg-glass);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: var(--glass-border);
}

.card {
    background-color: var(--bg-card);
    border-radius: 20px;
    padding: 20px;
    border: var(--glass-border);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
    border-color: var(--accent-gold);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.3s;
}

.btn-primary {
    background-color: var(--accent-gold);
    color: var(--bg-body);
}

.btn-primary:hover {
    background-color: #e0c9b3;
    transform: scale(1.05);
}

.btn-secondary {
    background-color: transparent;
    border: 1px solid var(--accent-gold);
    color: var(--accent-gold);
}

.btn-secondary:hover {
    background-color: var(--accent-gold);
    color: var(--bg-body);
}

.btn-danger {
    background-color: var(--danger);
    color: white;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 9999;
    /* Ensure it's on top of sidebar */
    padding: 15px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: var(--glass-border);
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent-gold);
}

.nav-links {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-links li {
    list-style: none;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
}

input,
select,
textarea {
    width: 100%;
    padding: 12px;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text-main);
    font-family: inherit;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

/* Fix for Select Options (Dropdown) */
select option {
    background-color: var(--bg-card);
    color: var(--text-main);
    padding: 10px;
}

select optgroup {
    background-color: var(--bg-card);
    color: var(--accent-gold);
    font-weight: bold;
}

/* Dashboard Layout */
.dashboard-container {
    display: flex;
    min-height: 100vh;
    padding-top: 80px;
    /* Space for navbar */
}

.sidebar {
    width: 250px;
    padding: 30px 20px;
    background: var(--bg-card);
    border-right: var(--glass-border);
    position: fixed;
    top: 80px;
    /* Below navbar */
    bottom: 0;
    left: 0;
    overflow-y: auto;
    z-index: 100;
}

.main-content {
    margin-left: 250px;
    flex-grow: 1;
    padding: 40px;
    width: calc(100% - 250px);
}

/* Mobile Responsive */
.burger-menu {
    display: none;
    font-size: 1.5rem;
    color: var(--accent-gold);
    cursor: pointer;
}

@media (max-width: 768px) {
    .dashboard-container {
        flex-direction: column;
        padding-top: 60px;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        top: 0;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding: 15px;
    }

    .sidebar h3 {
        display: none;
        /* Hide huge title on mobile sidebar to save space */
    }

    .sidebar ul {
        display: flex;
        overflow-x: auto;
        gap: 10px;
        padding-bottom: 5px;
    }

    .sidebar li {
        margin-bottom: 0 !important;
        white-space: nowrap;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 15px;
    }

    /* Navbar Mobile */
    .burger-menu {
        display: block;
    }

    .nav-links {
        position: fixed;
        top: 70px;
        right: -100%;
        background: var(--bg-card);
        height: calc(100vh - 70px);
        width: 100%;
        flex-direction: column;
        justify-content: center;
        transition: 0.3s;
        border-left: var(--glass-border);
    }

    .nav-links.active {
        right: 0;
    }

    /* Admin Tickets Mobile */
    .card[style*="height: calc(100vh - 150px)"] {
        flex-direction: column !important;
        height: auto !important;
    }

    #ticket-detail-panel {
        display: none;
        /* Hidden by default on mobile until clicked */
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 1000;
        background: #1a1f35;
        padding: 20px;
        padding-top: 80px;
        /* clear navbar */
    }

    /* Add a close button for mobile detail view logic if needed, 
       but for now standard flow or back button logic is implied. 
       Actually, let's make the list visible and detail visible when active.
    */
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card h3 {
    font-size: 2rem;
    color: var(--accent-gold);
}

.stat-card p {
    color: var(--text-muted);
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th,
td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

th {
    color: var(--accent-gold);
}

/* Chat */
.chat-box {
    height: 400px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 15px;
    line-height: 1.4;
}

.message.sent {
    align-self: flex-end;
    background-color: var(--accent-purple);
    color: white;
}

.message.received {
    align-self: flex-start;
    background-color: rgba(255, 255, 255, 0.1);
}

@media (max-width: 768px) {
    .mobile-only {
        display: inline-block !important;
    }
}