/* ========================================
   TTCHMS - Main Style Sheet
   Tanzania Cultural Heritage Management System
   ======================================== */

:root {
    --primary: #003087;
    --secondary: #006400;
    --accent: #FFCC00;
    --white: #ffffff;
    --light-gray: #f8f9fa;
    --dark: #2c3e50;
    --gray: #6c757d;
    --gray-dark: #343a40;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --info: #17a2b8;
    
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px rgba(0,0,0,0.15);
    
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

/* ========================================
   Global Styles
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-gray);
    color: var(--dark);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: var(--primary);
}

a:hover {
    color: var(--secondary);
}

/* ========================================
   Header Styles
   ======================================== */
.header {
    background: linear-gradient(90deg, var(--primary), #002255);
    color: var(--white);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 1rem 0;
}

.flag-strip {
    height: 6px;
    width: 60px;
    background: linear-gradient(to right, #006400 33%, #FFCC00 33%, #FFCC00 66%, #0099ff 66%);
    border-radius: var(--radius-sm);
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* User Menu */
/* User Avatar Styles */
.user-menu {
    position: relative;
    cursor: pointer;
}

.user-avatar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px 4px 4px;
    border-radius: 40px;
    background: rgba(255,255,255,0.1);
    transition: all 0.3s;
    cursor: pointer;
}

.user-avatar:hover {
    background: rgba(255,255,255,0.2);
}

.avatar-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
}

.dropdown-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.3);
}

.user-avatar i {
    font-size: 0.8rem;
    transition: transform 0.2s;
}

.user-menu:hover .user-avatar i {
    transform: rotate(180deg);
}

/* User Dropdown */
.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    min-width: 280px;
    display: none;
    margin-top: 10px;
    z-index: 1000;
    overflow: hidden;
    animation: fadeInDown 0.2s ease;
}

.user-dropdown.show {
    display: block;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-header {
    padding: 15px 20px;
    background: linear-gradient(135deg, var(--primary), #002255);
    color: white;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    transition: all 0.2s;
}

.dropdown-item:hover {
    background: #f0f7f0;
    color: var(--secondary);
}

.dropdown-item i {
    width: 20px;
    font-size: 1rem;
}

.dropdown-divider {
    height: 1px;
    background: #e0e0e0;
    margin: 5px 0;
}

.dropdown-item.logout {
    color: #dc3545;
}

.dropdown-item.logout:hover {
    background: #fee;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .user-avatar {
        padding: 4px;
    }
    
    .avatar-img {
        width: 32px;
        height: 32px;
    }
    
    .user-avatar i {
        display: none;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-header {
    padding: 15px 20px;
    background: linear-gradient(135deg, var(--primary), #002255);
    color: white;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    transition: all 0.2s;
}

.dropdown-item:hover {
    background: #f0f7f0;
    color: var(--secondary);
}

.dropdown-item i {
    width: 20px;
    font-size: 1rem;
}

.dropdown-divider {
    height: 1px;
    background: #e0e0e0;
    margin: 5px 0;
}

.dropdown-item.logout {
    color: #dc3545;
}

.dropdown-item.logout:hover {
    background: #fee;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-header {
    padding: 15px 20px;
    background: linear-gradient(135deg, var(--primary), #002255);
    color: var(--white);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--dark);
    transition: background 0.2s;
}

.dropdown-item:hover {
    background: #f0f7f0;
    color: var(--secondary);
}

.dropdown-divider {
    height: 1px;
    background: #e9ecef;
    margin: 5px 0;
}

.dropdown-item.logout {
    color: var(--danger);
}

.dropdown-item.logout:hover {
    background: #fee;
}

/* ========================================
   Sidebar Styles
   ======================================== */
.sidebar {
    width: 280px;
    background: var(--white);
    border-right: 1px solid #e5e5e5;
    min-height: calc(100vh - 80px);
    flex-shrink: 0;
}

.sidebar .nav-link {
    padding: 12px 20px;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background: #f0f7f0;
    color: var(--secondary);
    border-left-color: var(--secondary);
}

.sidebar .nav-link i {
    width: 20px;
    font-size: 1.1rem;
}

/* ========================================
   Main Content
   ======================================== */
.main-content {
    flex: 1;
    padding: 30px;
    min-height: calc(100vh - 80px);
}

/* ========================================
   Cards
   ======================================== */
.card {
    background: var(--white);
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.card-header {
    background: var(--white);
    border-bottom: 1px solid #e5e5e5;
    padding: 1rem 1.25rem;
    font-weight: 600;
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    background: var(--white);
    border-top: 1px solid #e5e5e5;
    padding: 0.75rem 1.25rem;
}

/* Stat Cards */
.stat-card {
    border-left: 4px solid var(--secondary);
}

.stat-card h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0;
}

/* ========================================
   Section Title
   ======================================== */
.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--accent);
    display: inline-block;
}

/* ========================================
   Buttons
   ======================================== */
.btn-primary {
    background: var(--primary);
    border: none;
}

.btn-primary:hover {
    background: #002255;
}

.btn-success {
    background: var(--secondary);
    border: none;
}

.btn-success:hover {
    background: #004d00;
}

.btn-outline-primary {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-outline-primary:hover {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-outline-success {
    border-color: var(--secondary);
    color: var(--secondary);
}

.btn-outline-success:hover {
    background: var(--secondary);
    border-color: var(--secondary);
}

/* ========================================
   Tables
   ======================================== */
.table {
    margin-bottom: 0;
}

.table thead {
    background: var(--primary);
    color: var(--white);
}

.table thead th {
    font-weight: 500;
    padding: 12px 16px;
    border: none;
}

.table tbody td {
    padding: 12px 16px;
    vertical-align: middle;
    border-bottom: 1px solid #e5e5e5;
}

.table tbody tr:hover {
    background: #f8f9fa;
}

/* ========================================
   Forms
   ======================================== */
.form-control,
.form-select {
    border: 1px solid #ced4da;
    border-radius: var(--radius-md);
    padding: 0.5rem 0.75rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 0.2rem rgba(0, 100, 0, 0.25);
}

.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

/* ========================================
   Alerts
   ======================================== */
.alert {
    border-radius: var(--radius-md);
    border: none;
    border-left: 4px solid;
}

.alert-success {
    border-left-color: var(--success);
    background: #d4edda;
    color: #155724;
}

.alert-warning {
    border-left-color: var(--warning);
    background: #fff3cd;
    color: #856404;
}

.alert-danger {
    border-left-color: var(--danger);
    background: #f8d7da;
    color: #721c24;
}

.alert-info {
    border-left-color: var(--info);
    background: #d1ecf1;
    color: #0c5460;
}

/* ========================================
   Badges
   ======================================== */
.badge {
    padding: 0.35rem 0.65rem;
    font-weight: 500;
    border-radius: 30px;
}

.badge-success {
    background: var(--success);
}

.badge-warning {
    background: var(--warning);
    color: #333;
}

.badge-danger {
    background: var(--danger);
}

.badge-info {
    background: var(--info);
}

/* ========================================
   Quick Actions Grid
   ======================================== */
.quick-action {
    transition: all 0.2s;
    border: 1px solid #e5e5e5;
    border-radius: var(--radius-md);
    padding: 1rem;
    text-align: center;
}

.quick-action:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--secondary);
}

.quick-action i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.quick-action span {
    font-size: 0.85rem;
    font-weight: 500;
}

/* ========================================
   Footer
   ======================================== */
.footer {
    background: linear-gradient(90deg, var(--primary), #002255);
    color: var(--white);
    padding: 1.5rem 0;
    margin-top: 2rem;
}

.footer a {
    color: rgba(255,255,255,0.7);
}

.footer a:hover {
    color: var(--white);
}

/* ========================================
   Utility Classes
   ======================================== */
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--secondary) !important; }
.text-accent { color: var(--accent) !important; }
.bg-light-gray { background: var(--light-gray); }

.hover-shadow:hover {
    box-shadow: var(--shadow-md);
    transition: box-shadow 0.2s;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 992px) {
    .sidebar {
        position: fixed;
        left: -280px;
        top: 80px;
        z-index: 999;
        transition: left 0.3s;
        height: calc(100vh - 80px);
        overflow-y: auto;
    }
    
    .sidebar.show {
        left: 0;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .menu-toggle {
        display: block;
    }
}

@media (max-width: 768px) {
    .logo-text {
        font-size: 1rem;
    }
    
    .stat-card h2 {
        font-size: 1.5rem;
    }
    
    .section-title {
        font-size: 1.25rem;
    }
    
    .main-content {
        padding: 15px;
    }
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
    .sidebar, .header, .footer, .btn, .no-print {
        display: none !important;
    }
    
    .main-content {
        padding: 0;
        margin: 0;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }
}