/* Reset & basic styles */
body, html {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background-color: #f8f9fa;
}

h1, h2, h3 {
    margin: 0;
}

p {
    margin: 0.5rem 0;
}


/*------------------------------------*/

/*------------------------------------*/
/*--------- Header Band ---------------*/
header {
    position: relative;
    /*background: linear-gradient(135deg, #a00000, #ff3c3c);*/
    background-color: #244855;
    color: rgb(255, 255, 255);
    height: 30px;                   /* Fixed height for the header */
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    overflow: hidden;               /* Required for shine effect */
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
}

/* Moving shine effect overlay */
header::after {
    content: "";
    position: absolute;
    top: 0;
    left: -75%;                     
    width: 50%;                     /* Control shine width*/
    height: 100%;
    background: linear-gradient(
        120deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 190, 0.3) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    animation: shine 5s linear infinite;
}

/* Keyframes for shine movement */
@keyframes shine {
    from {
        left: -75%;
    }
    to {
        left: 125%;
    }
}

/* Make sure h1 doesn't take full width */
header h1 {
    font-size: 1.2rem;
    font-weight: 600;
    color: white;
    margin: 0;
    white-space: nowrap;
    flex-shrink: 0;
}

.menu-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    margin-right: 1rem;
    cursor: pointer;
    z-index: 2; /* Keeps toggle visible above shine */
}
/*------------------------------------*/


/*------------------------------------*/


/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: -250px;
    width: 250px;
    height: 100%;
    background-color: rgba(34, 34, 34, 0.8);
    color: #fff;
    transition: left 0.3s;
    z-index: 1000;
    padding-top: 60px;
    padding-bottom: 80px; /* ✅ NEW: Space for logout button */
    backdrop-filter: blur(6px);
    display: flex;
    flex-direction: column;
}

.sidebar nav {
    flex: 1; /* ✅ NEW: Takes available space */
    overflow-y: auto; /* ✅ NEW: Scroll if content is too long */
    position: relative;
}

.sidebar.visible {
    left: 0;
}

.sidebar nav a {
    display: block;
    padding: 1rem;
    color: #fff;
    text-decoration: none;
    font-weight: normal;        /* Normal text instead of bold*/ 
}

.sidebar nav a.active {
    background-color: #E64833;
}

/* Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.3);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 999;
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Main content */
main {
    padding: 1rem;
    transition: margin-left 0.3s;
}

.page-title {
    font-size: 1.5rem;
    margin-bottom: 0.3rem;
}

.page-subtitle {
    color: #555;
    margin-bottom: 1rem;
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    background-color: #b00;
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 4px;
}

.btn-secondary {
    background-color: #555;
}

/* Content cards */
.content-card {
    background: white;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* Data tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
}

.data-table th, .data-table td {
    padding: 0.5rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.status-badge {
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    color: white;
    font-size: 0.85rem;
}

.status-active { background-color: green; }
.status-scheduled { background-color: orange; }
.status-completed { background-color: blue; }

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

/* Status Card with left red line */
.stat-card {
    background-color: #fff;
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-left: 3px solid #b00;  /* Red vertical line on the left */
}


.stat-value {
    font-size: 1.3rem;
    font-weight: bold;
}

.stat-change {
    font-size: 0.85rem;
    color: #555;
}

/*------------------------------------*/
/*--------- Footer ------------------*/
footer {
    position: fixed;                /* Stick at the bottom */
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: white;       /* matching header */
    color: #b00;
    text-align: center;
    padding: 0.07rem 0;             /* smaller padding */
    font-size: 0.65rem;             /* smaller font */
    z-index: 500;                   /* above other content */
}


/*-------------------------------*/
/* Rotating Gear wheel-----------*/

/* ===== Rotating Gear Animation ===== */
/* Header content - use flexbox with three sections */
/* Header content - use flexbox with three sections */
.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 20px;
    padding: 0 20px;
}

/* Left section (empty but takes space for balance) */
.header-left-section {
    flex: 0;
    min-width: 0;
}

/* Center section - contains title and gears */
.header-center-section {
    display: flex;
    align-items: center;
    justify-content: flex-start;  /* Changed from center to flex-start */
    gap: 1px;
    flex-shrink: 0;
    flex: 2;  /* Add this - gives more space to center section */
}

/* Right section - contains user info, role badge, notifications */
.header-right-section {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 15px;
    min-width: 150px;
}

.gear-container {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
     margin-left: 20px;
}

.gear {
    width: 100%;
    height: 100%;
    animation: rotateGear 15s linear infinite;
    filter: drop-shadow(0 0 6px rgba(255, 0, 0, 0.6));
    opacity: 0.9;
}

@keyframes rotateGear {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}
/*--------------------2nd gear ---------------------*/
.gear-container1 {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.gear1 {
    width: 80%;
    height: 80%;
    animation: rotateGear1 4s linear infinite;
    filter: drop-shadow(0 0 6px rgba(255, 0, 0, 0.6));
    opacity: 0.9;
}

@keyframes rotateGear1 {
    from {
        transform: rotate(360deg);
    }
    to {
        transform: rotate(0deg);
    }
}

/*--------------------3rd gear ---------------------*/
.gear-container2 {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.gear2 {
    width: 100%;
    height: 100%;
    animation: rotateGear2 10s linear infinite;
    filter: drop-shadow(0 0 6px rgba(255, 0, 0, 0.6));
    opacity: 0.9;
}

@keyframes rotateGear2 {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/*---------------------------------*/


/* Status badges */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-inactive {
    background: #f8d7da;
    color: #721c24;
}

.status-maintenance {
    background: #fff3cd;
    color: #856404;
}

/* Action buttons */
.btn-action {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 5px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.btn-action:hover {
    background: #f0f0f0;
    transform: scale(1.1);
}

.btn-view:hover {
    background: #e3f2fd;
}

.btn-edit:hover {
    background: #fff3e0;
}

.btn-delete:hover {
    background: #ffebee;
}

/* Assets page layout with folder tree */
.assets-content-wrapper {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.assets-folder-container {
    min-width: 300px;
    max-width: 350px;
    flex-shrink: 0;
    background: white;
    border-radius: 6px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.assets-folder-container h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 18px;
    border-bottom: 2px solid #f0b05d;
    padding-bottom: 10px;
}

.assets-table-container {
    flex: 1;
    min-width: 0;
}

/* Folder item clickable style for assets page */
.assets-folder-container .folder-item {
    cursor: pointer;
}

.assets-folder-container .folder-content:hover {
    background: #e3f2fd !important;
}

.folder-selected .folder-content {
    background: #007bff !important;
}

.folder-selected .folder-name {
    color: rgb(112, 111, 111) !important;
    font-weight: 600;
}

.folder-selected .folder-icon {
    color: white !important;
}

/* ============================================
   USER INFO & LOGOUT BUTTON STYLES
   ============================================ */

/* Header User Info */
/* Header User Info - FIXED POSITION */
.header-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.3);
    padding: 6px 12px;
    border-radius: 20px;
    backdrop-filter: blur(5px);
    /* ✅ Removed: position, left, top, transform - now flows naturally */
}

#userInfo {
    color: white;
    font-size: 0.8rem; /* ✅ Even smaller text */
    font-weight: 500;
    white-space: nowrap;
}

/* Add to .logout-btn (around line 485) */
.logout-btn {
    background: #E64833;
    border: none;
    color: white;
    padding: 5px 10px; /* ✅ Adjusted for icon */
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex; /* ✅ NEW: For icon alignment */
    align-items: center;
    gap: 5px; /* ✅ NEW: Space between icon and text */
}

/* ✅ NEW: Icon styling for header logout button */
.logout-btn img {
    width: 16px;
    height: 16px;
    filter: brightness(0) invert(1); /* Makes SVG white */
}

.logout-btn:hover {
    background: #d12a00; /* ✅ Darker red on hover */
    transform: scale(1.05);
}

/* Sidebar User Info Section */
.sidebar-user-info {
    padding: 1rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1rem;
    text-align: center;
}

.user-avatar {
    width: 80px; /* ✅ Size for profile image */
    height: 80px;
    margin: 0 auto 0.75rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
}

.user-name {
    color: white;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.user-role {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    font-style: italic;
}


/* Logout Link in Sidebar - ALWAYS VISIBLE */
.logout-link {
    position: absolute; /* ✅ CHANGED: absolute instead of fixed */
    bottom: 80px;
    left: 0;
    right: 0;
    margin: 0 10px; /* ✅ Add margin for spacing */
    padding: 12px 1rem;
    background: #E64833 !important;
    border-radius: 6px;
    text-align: center;
    font-weight: 600;
    font-size: 0.95rem;
    z-index: 10; /* ✅ Lower z-index since it's inside sidebar */
    box-shadow: 0 4px 12px rgba(230, 72, 51, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.logout-link img {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
}

/* NO NEED for .sidebar.visible .logout-link anymore */

.logout-link:hover {
    background: #d12a00 !important;
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(230, 72, 51, 0.6);
}
/* Responsive adjustments */
@media (max-width: 768px) {
    .header-user-info {
        right: 1rem;
    }
    
    #userInfo {
        display: none; /* Hide full name on mobile */
    }
}

/* ✅ NEW: Hide name on medium screens to prevent overlap */
@media (max-width: 1200px) {
    #userInfo {
        display: none; /* Hide name text, keep logout button */
    }
    
    .header-user-info {
        right: 1rem;
    }
}

@media (max-width: 768px) {
    .header-user-info {
        right: 0.5rem;
    }
    
    .logout-btn {
        padding: 4px 8px;
        font-size: 0.8rem;
    }
}

/* Make footer NOT cover sidebar button */
footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: white;
    color: #b00;
    text-align: center;
    padding: 0.07rem 0;
    font-size: 0.65rem;
    z-index: 500; /* ✅ Lower than logout button (1100) */
    pointer-events: none; /* ✅ Allow clicks through footer */
}

/* But allow clicks on footer content */
footer p {
    pointer-events: auto;
}


/* ============================================
   NOTIFICATIONS BUTTON & SIDEBAR STYLES
   ============================================ */

/* Notifications Button in Header */
.notifications-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    padding: 8px 10px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    /* ✅ Removed: position, left, top, transform - now flows naturally */
}

.notifications-btn img {
    width: 22px;
    height: 22px;
    filter: brightness(0) invert(1); /* Makes SVG white */
}

.notifications-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

/* Notification Badge (red circle with count) */
.notification-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #E64833;
    color: white;
    border-radius: 50%;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px;
    box-shadow: 0 2px 6px rgba(230, 72, 51, 0.5);
}

.notification-badge:empty,
.notification-badge.hidden {
    display: none;
}

/* Notifications Sidebar Panel (Like Left Sidebar) */
.notifications-panel {
    position: fixed;
    top: 0;
    right: -350px; /* Hidden off-screen to the right */
    width: 350px;
    height: 100%;
    background-color: rgba(34, 34, 34, 0.95);
    color: #fff;
    transition: right 0.3s ease;
    z-index: 1000;
    padding-top: 20px;
    padding-bottom: 80px;
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
}

.notifications-panel.visible {
    right: 0; /* Slide in from right */
}

/* Notifications Overlay (Like Sidebar Overlay) */
.notifications-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 999;
}

.notifications-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Notifications Header */
.notifications-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

.notifications-header h3 {
    margin: 0;
    font-size: 1.3rem;
    color: #fff;
    font-weight: 600;
}

/* Close Button (X) */
.close-notifications-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
}

.close-notifications-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Notifications Subheader with Mark All Read */
.notifications-subheader {
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.mark-read-btn {
    background: rgba(36, 72, 85, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.mark-read-btn:hover {
    background: rgba(36, 72, 85, 0.8);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Notifications List */
.notifications-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

/* Custom Scrollbar for Notifications List */
.notifications-list::-webkit-scrollbar {
    width: 8px;
}

.notifications-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.notifications-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.notifications-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Individual Notification Item */
.notification-item {
    padding: 1rem;
    margin: 0.5rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-left: 4px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.notification-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(-4px);
}

.notification-item.unread {
    background: rgba(36, 72, 85, 0.3);
    border-left-color: #244855;
}

.notification-item.unread:hover {
    background: rgba(36, 72, 85, 0.5);
}

.notification-title {
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    padding-right: 60px; /* Space for priority badge */
}

.notification-message {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.notification-time {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
    font-style: italic;
}

/* Priority Badge */
.notification-priority {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.priority-high {
    background: #E64833;
    color: white;
    box-shadow: 0 0 10px rgba(230, 72, 51, 0.5);
}

.priority-medium {
    background: #f57c00;
    color: white;
    box-shadow: 0 0 10px rgba(245, 124, 0, 0.5);
}

.priority-low {
    background: #2e7d32;
    color: white;
    box-shadow: 0 0 10px rgba(46, 125, 50, 0.5);
}

/* No Notifications State */
.no-notifications {
    text-align: center;
    padding: 3rem 1.5rem;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.95rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .notifications-panel {
        width: 300px;
        right: -300px;
    }
}

@media (max-width: 480px) {
    .notifications-panel {
        width: 85%;
        right: -85%;
    }
}



/* Header styling fixes */
.header-right-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-right-section .role-badge {
    margin: 0 5px;
}

#headerUserRole {
    display: none; /* Hide the empty div */
}

/* Ensure user name is visible */
#userInfo {
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* Ensure user name displays properly */
#userInfo {
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: capitalize; /* This will capitalize first letter if needed */
}

/* Fix for the header layout */
.header-right-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-right-section .role-badge {
    margin: 0 5px;
}