/* Material UI Theme Variables */
:root {
    --primary: #5e72e4;
    --secondary: #8392ab;
    --success: #2dce89;
    --info: #11cdef;
    --warning: #fb6340;
    --danger: #f5365c;
    --light: #f8f9fa;
    --dark: #344767;
    --background: #f8f9fa;
    --card-shadow: 0 7px 14px 0 rgba(65, 69, 88, 0.1), 0 3px 6px 0 rgba(0, 0, 0, 0.07);
    --transition-speed: 0.3s;
    --border-radius: 0.75rem;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--background);
    color: #495057;
    transition: all var(--transition-speed);
}

/* Sidebar */
.wrapper {
    display: flex;
    min-height: 100vh;
}

#sidebar {
    width: 250px;
    height: 100vh;
    background: linear-gradient(195deg, #42424a 0%, #191919 100%);
    color: #fff;
    transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    box-shadow: var(--card-shadow);
}

#sidebar.active {
    width: 0;
    min-width: 0;
    display: none;
    transform: translateX(-100%);
}

#sidebar .sidebar-header {
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#sidebar ul.components {
    padding: 20px 0;
}

#sidebar ul li a {
    padding: 12px 20px;
    font-size: 0.9rem;
    display: block;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    border-radius: 0.5rem;
    margin: 5px 15px;
    transition: all 0.2s ease;
}

#sidebar ul li a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: translateX(5px);
}

#sidebar ul li a i {
    margin-right: 10px;
    opacity: 0.7;
    transition: all 0.2s ease;
}

#sidebar ul li a:hover i {
    opacity: 1;
}

#sidebar ul ul a {
    padding-left: 40px !important;
    background: rgba(0, 0, 0, 0.1);
    font-size: 0.85rem;
}

/* Content */
#content {
    flex: 1 1 auto;
    width: calc(100% - 250px);
    margin-left: 250px;
    transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 20px !important;
}

/* When sidebar is hidden, content stretches full width */
.wrapper.sidebar-hidden #sidebar {
    display: none;
    width: 0;
    min-width: 0;
    transform: translateX(-100%);
}
.wrapper.sidebar-hidden #content {
    width: 100%;
    margin-left: 0;
}

/* Navbar always stretches to fill #content */
#content .navbar {
    width: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    margin-bottom: 20px;
    padding: 10px 20px;
}

/* Cards */
.card {
    margin-bottom: 20px;
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
    position: unset !important;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.06);
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 15px 20px;
    font-weight: 500;
}

/* Badges */
.badge {
    padding: 6px 12px;
    font-weight: 500;
    border-radius: 30px;
    letter-spacing: 0.3px;
    font-size: 0.75rem;
    text-transform: uppercase;
}

/* Buttons */
.btn {
    border-radius: 0.5rem;
    padding: 0.5rem 1.5rem;
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.025em;
    transition: all 0.15s ease;
    box-shadow: 0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 7px 14px rgba(50, 50, 93, 0.1), 0 3px 6px rgba(0, 0, 0, 0.08);
}

.btn:active {
    transform: translateY(1px);
    box-shadow: 0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08);
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
}

/* Tables */
.table {
    margin-bottom: 0;
}

.table th {
    border-top: none;
    background-color: rgba(0, 0, 0, 0.01);
    font-weight: 600;
    color: var(--dark);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.025em;
}

.table td {
    vertical-align: middle;
    padding: 12px 16px;
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.015);
}

/* Responsive */
@media (max-width: 768px) {
    #sidebar {
        margin-left: -250px;
        transform: translateX(-100%);
        position: fixed;
        z-index: 1050;
    }
    #sidebar.active {
        margin-left: 0;
        transform: translateX(0);
        width: 250px;
        min-width: 250px;
        display: flex;
    }
    #content {
        margin-left: 0;
        width: 100%;
    }
    #content.active {
        margin-left: 0;
        width: 100%;
    }
    
    /* Overlay when sidebar is active on mobile */
    body.sidebar-active::before {
        content: "";
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1040;
        transition: all 0.3s;
    }
    
    /* Mobile navbar and toggle button fixes */
    #content .navbar {
        padding: 10px;
    }
    
    #content .navbar .container-fluid {
        padding: 0;
    }
    
    #sidebarCollapse {
        margin-right: 10px;
        padding: 6px 10px;
        font-size: 0.9rem;
    }
    
    /* Better spacing for welcome message and logout button */
    #content .navbar .container-fluid .ms-auto {
        display: flex;
        align-items: center;
        margin-top: 0;
    }
    
    #content .navbar .container-fluid .ms-auto span {
        font-size: 0.9rem;
        margin-right: 10px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 150px;
    }
}

/* Agent Management */
#agentSubmenu {
    background: rgba(0, 0, 0, 0.1);
    border-radius: var(--border-radius);
    margin: 5px 15px;
}

#agentSubmenu a {
    padding-left: 40px;
    font-size: 0.85rem;
}

/* Stats Cards */
.border-left-primary {
    border-left: 4px solid var(--primary) !important;
    border-radius: var(--border-radius);
}

.border-left-success {
    border-left: 4px solid var(--success) !important;
    border-radius: var(--border-radius);
}

.border-left-info {
    border-left: 4px solid var(--info) !important;
    border-radius: var(--border-radius);
}

.border-left-warning {
    border-left: 4px solid var(--warning) !important;
    border-radius: var(--border-radius);
}

/* Status Colors */
.bg-open { 
    background-color: var(--primary);
    color: white;
}
.bg-in_progress { 
    background-color: var(--warning);
    color: white;
}
.bg-resolved { 
    background-color: var(--success);
    color: white;
}
.bg-closed { 
    background-color: var(--secondary);
    color: white;
}

/* Priority Colors */
.bg-low { 
    background-color: var(--secondary);
    color: white;
}
.bg-medium { 
    background-color: var(--primary);
    color: white;
}
.bg-high { 
    background-color: var(--warning);
    color: white;
}
.bg-urgent { 
    background-color: var(--danger);
    color: white;
}

/* Center login form on login page */
.login-center {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1000;
    background: linear-gradient(195deg, #f6f9fc 0%, #edf2f7 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-center .card {
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Form controls */
.form-control {
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    border: 1px solid #dee2e6;
    transition: all 0.2s ease;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(94, 114, 228, 0.25);
}

/* Mobile responsive search bars and filters */
@media (max-width: 768px) {
    .d-flex.justify-content-between.align-items-center {
        flex-direction: column;
        align-items: flex-start !important;
    }
    
    .d-flex.align-items-center {
        flex-direction: column;
        align-items: flex-start !important;
        width: 100%;
    }
    
    .d-flex.align-items-center form {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .d-flex.align-items-center form input[type="text"] {
        width: 100% !important;
        display: block !important;
    }
    
    .d-flex.align-items-center .dropdown,
    .d-flex.align-items-center .btn {
        margin-bottom: 10px;
        width: 100%;
    }
    
    .d-flex.align-items-center .dropdown .dropdown-menu {
        width: 100%;
    }
    
    /* Dashboard search bars */
    .card-header form {
        width: 100%;
        margin: 10px 0;
    }
    
    .card-header form input[type="text"] {
        width: 100% !important;
        display: block !important;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

body .wrapper, body #content {
    min-height: 0 !important;
    height: auto !important;
} 