/* assets/css/style.css - Common and User Styles */

:root {
    --primary-color: #1e2a3a;
    --secondary-color: #2c3e50;
    --accent-color: #3498db;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --light-bg: #f4f7fc;
    --dark-text: #333;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--light-bg);
    color: var(--dark-text);
    line-height: 1.6;
}

.container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar - User */
.sidebar {
    width: 260px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    padding: 20px 0;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.sidebar h2 {
    text-align: center;
    padding: 0 15px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    font-size: 1.5rem;
    letter-spacing: 1px;
}

.sidebar ul {
    list-style: none;
    margin-top: 30px;
}

.sidebar ul li {
    padding: 12px 25px;
    transition: var(--transition);
}

.sidebar ul li:hover {
    background: rgba(255,255,255,0.1);
    padding-left: 30px;
}

.sidebar ul li a {
    color: #ecf0f1;
    text-decoration: none;
    display: block;
    font-weight: 500;
}

.content {
    flex: 1;
    padding: 30px;
    background-color: var(--light-bg);
    overflow-y: auto;
}

/* Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #fff;
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    border-left: 4px solid var(--accent-color);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.stat-card h3 {
    color: #7f8c8d;
    font-size: 0.9rem;
    text-transform: uppercase;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.stat-card .value {
    font-size: 2.2rem;
    font-weight: bold;
    color: var(--primary-color);
}

/* Tables */
.table {
    width: 100%;
    background: #fff;
    border-collapse: collapse;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    margin-top: 20px;
}

.table thead {
    background: var(--primary-color);
    color: #fff;
}

.table th, .table td {
    padding: 14px 15px;
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

.table td .badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-warning {
    background-color: #ffc107;
    color: #212529;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

.badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

.badge-secondary {
    background-color: #6c757d;
    color: #fff;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #2c3e50;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #dcdcdc;
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(52,152,219,0.2);
}

/* Buttons */
.btn {
    display: inline-block;
    background: #fff;
    color: var(--dark-text);
    padding: 10px 20px;
    border: 1px solid #dcdcdc;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1rem;
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
}

.btn:hover {
    background: #f4f4f4;
}

.btn-primary {
    background: var(--accent-color);
    color: #fff;
    border: none;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-success {
    background: var(--success-color);
    color: #fff;
    border: none;
}

.btn-success:hover {
    background: #1e8449;
}

.btn-danger {
    background: var(--danger-color);
    color: #fff;
    border: none;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.875rem;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: var(--border-radius);
    border-left: 4px solid transparent;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left-color: #28a745;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border-left-color: #dc3545;
}

/* Utility */
.text-center {
    text-align: center;
}

.mt-3 {
    margin-top: 20px;
}

.mb-3 {
    margin-bottom: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .table {
        display: block;
        overflow-x: auto;
    }
}

.alert-dismissible {
    position: relative;
}
.alert-dismissible .close {
    position: absolute;
    top: 0;
    right: 0;
    padding: 10px;
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
}

/* Mobile Hamburger Menu */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.8rem;
    color: #1e2a3a;
    cursor: pointer;
    padding: 5px 10px;
    position: relative;
    top: 10px;
    left: 10px;
    z-index: 1001;
    background: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.sidebar {
    transition: transform 0.3s ease;
}

.sidebar.open {
    transform: translateX(0);
}

/* Admin sidebar override */
.sidebar.admin-sidebar {
    background: linear-gradient(135deg, #2c3e50, #1a252f);
}

/* Responsive */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        height: 100vh;
        transform: translateX(-100%);
        z-index: 1000;
        overflow-y: auto;
        box-shadow: 2px 0 10px rgba(0,0,0,0.2);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .content {
        margin-left: 0;
        padding: 20px 15px;
    }

    /* Overlay when sidebar is open */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 999;
    }

    .sidebar-overlay.active {
        display: block;
    }
}
/* Image Modal */
.image-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    justify-content: center;
    align-items: center;
    cursor: pointer;
}
.image-modal-content {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
}
.image-modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}
.image-modal-close:hover {
    color: #ccc;
}
#notificationBell i {
    transition: transform 0.2s;
}
#notificationBell i:hover {
    transform: scale(1.1);
}
#notificationDropdown {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    padding: 10px;
}
#notificationList div:last-child {
    border-bottom: none !important;
}