/* Shared Admin Styles - ESP32 Fingerprint Application */
/* Common CSS variables and styles for all admin pages */

:root {
    /* Color Scheme - Blue Purple Gradient */
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --sidebar-bg: var(--primary-gradient);
    --sidebar-text: #ffffff;
    --sidebar-hover: rgba(255, 255, 255, 0.1);
    --sidebar-active: rgba(255, 255, 255, 0.2);
    --sidebar-border: rgba(255, 255, 255, 0.1);

    /* Layout Dimensions */
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;
    --navbar-height: 60px;

    /* Backgrounds and Colors */
    --content-bg: #f8f9fa;
    --card-bg: #ffffff;
    --navbar-bg: #ffffff;

    /* Shadows and Effects */
    --card-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --card-hover-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    --navbar-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);

    /* Border Radius */
    --border-radius: 8px;
    --border-radius-lg: 15px;
    --border-radius-xl: 25px;

    /* Transitions */
    --transition: all 0.3s ease;
}

/* Global Styles */
body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--content-bg);
    overflow-x: hidden;
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    transition: var(--transition);
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--sidebar-border);
    text-align: center;
}

.sidebar.collapsed .sidebar-header {
    padding: 20px 10px;
}

.sidebar-logo {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 10px;
    transition: var(--transition);
}

.sidebar.collapsed .sidebar-logo {
    font-size: 1.2rem;
}

.sidebar-subtitle {
    font-size: 0.8rem;
    opacity: 0.8;
    transition: var(--transition);
}

.sidebar.collapsed .sidebar-subtitle {
    display: none;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 20px 0 0 0;
}

.sidebar-menu li {
    margin: 0;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.sidebar.collapsed .sidebar-menu a {
    padding: 15px;
    justify-content: center;
}

.sidebar-menu a:hover {
    background: var(--sidebar-hover);
    border-left-color: rgba(255, 255, 255, 0.5);
    color: var(--sidebar-text);
}

.sidebar-menu a.active {
    background: var(--sidebar-active);
    border-left-color: #ffffff;
}

.sidebar-menu i {
    margin-right: 15px;
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

.sidebar.collapsed .sidebar-menu i {
    margin-right: 0;
}

.sidebar-menu .menu-text {
    transition: var(--transition);
}

.sidebar.collapsed .menu-text {
    display: none;
}

/* Top Navbar */
.top-navbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--navbar-height);
    background: var(--navbar-bg);
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    transition: left 0.3s ease;
    z-index: 999;
    box-shadow: var(--navbar-shadow);
}

.sidebar.collapsed + .top-navbar,
.sidebar.collapsed ~ .top-navbar {
    left: var(--sidebar-collapsed-width);
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #6c757d;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.sidebar-toggle:hover {
    background: #f8f9fa;
    color: #495057;
}

.navbar-title {
    font-weight: 600;
    color: #495057;
    margin: 0;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.navbar-actions .btn {
    border-radius: var(--border-radius);
}

/* Content Area */
.content-area {
    margin-left: var(--sidebar-width);
    margin-top: var(--navbar-height);
    padding: 30px;
    min-height: calc(100vh - var(--navbar-height));
    transition: margin-left 0.3s ease;
}

.sidebar.collapsed ~ .content-area {
    margin-left: var(--sidebar-collapsed-width);
}

/* Content Container for max-width and centering */
.content-container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Cards */
.card {
    border: none;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    background: var(--card-bg);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-hover-shadow);
}

.card-header {
    background: var(--primary-gradient);
    color: white;
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0 !important;
    border: none;
    padding: 20px;
}

.card-header h5 {
    margin: 0;
    font-weight: 600;
}

/* Buttons */
.btn-primary {
    background: var(--primary-gradient);
    border: none;
 
    padding: 10px 20px;
    font-weight: 600;
    transition: var(--transition);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-outline-primary {
    border-color: #667eea;
    color: #667eea;

    transition: var(--transition);
}

.btn-outline-primary:hover {
    background-color: #667eea;
    border-color: #667eea;
    transform: translateY(-2px);
}

.btn-outline-success {
    border-color: #28a745;
    color: #28a745;
 
    transition: var(--transition);
}

.btn-outline-success:hover {
    background-color: #28a745;
    border-color: #28a745;
    transform: translateY(-2px);
}

/* Tables */
.table {
    margin-bottom: 0;
}

.table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    color: #495057;
    font-weight: 600;
    padding: 15px;
}

.table tbody td {
    padding: 15px;
    vertical-align: middle;
    border-top: 1px solid #e9ecef;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

/* Badges */
.badge {
    font-size: 0.75rem;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 500;
}

/* Alerts */
.alert {
    border-radius: var(--border-radius);
    border: none;
    padding: 15px 20px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
}

/* Modal */
.modal-content {
    border-radius: var(--border-radius-lg);
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.modal-header {
    background: var(--primary-gradient);
    color: white;
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
    border: none;
    padding: 20px;
}

.modal-title {
    font-weight: 600;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.page-header h1 {
    color: #343a40;
    margin: 0;
    font-weight: 600;
}

.page-actions .btn {
    margin-left: 10px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content,
    .content-area {
        margin-left: 0;
    }

    .main-content.expanded,
    .sidebar.collapsed ~ .content-area {
        margin-left: 0;
    }

    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 999;
        display: none;
    }

    .sidebar-overlay.show {
        display: block;
    }

    .top-navbar {
        left: 0;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .page-actions {
        width: 100%;
        display: flex;
        justify-content: flex-end;
    }

    .table-responsive {
        font-size: 0.9rem;
    }

    .btn-group {
        flex-direction: column;
        gap: 5px;
    }

    .btn-group .btn {
        width: 100%;
    }
}

/* Custom scrollbar for sidebar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: var(--sidebar-hover);
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--sidebar-active);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Stats Cards (Dashboard specific) */
.stats-card {
    transition: var(--transition);
}

.stats-card:hover {
    transform: translateY(-5px);
}

.stats-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.stats-number {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.stats-label {
    font-size: 0.9rem;
    opacity: 0.8;
}

.card-header .text-muted {
    color: #ffffff !important;
}

