/* === GLOBAL THEME VARIABLES === */
:root {
    /* Light Theme */
    --bg-color: #f4f7fa;
    --text-color: #1a202c;
    --text-secondary: #718096;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --header-bg: #ffffff;
    --header-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    --primary-color: #377dff;
    --primary-hover: #5c94ff;
  }
  
  [data-theme="dark"] {
    /* Dark Theme */
    --bg-color: #121829;
    --text-color: #e0e0e0;
    --text-secondary: #a0aec0;
    --card-bg: #1a2236;
    --border-color: #2d3748;
    --header-bg: #1a2236;
    --header-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    --primary-color: #377dff;
    --primary-hover: #5c94ff;
  }
  
  /* === RESET & BASE === */
  *, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  
  html, body {
    width: 100%;
    height: 100%;
  }
  
  body {
    font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    transition: background 0.3s, color 0.3s;
    overflow-x: hidden;
  }

  /* Accessibility helper class */
  .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
  }
  
  /* === VIDEO BACKGROUND === */
  .video-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
  }
  
  .video-background video {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  
  .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 20, 40, 0.6);
  }
  
  /* === DASHBOARD HEADER === */
  .dashboard-header {
    background: var(--header-bg);
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--header-shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 100;
    transition: background 0.3s, border-color 0.3s;
  }

  .header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
  }
  
  .header-logo {
    height: 40px; /* Increased container size slightly for better alignment */
    display: flex;
    align-items: center;
  }
  
  .header-logo img {
    height: 40px;
    width: 40px;
    border-radius: 50%; /* Makes the image round */
    object-fit: cover; /* Ensures the image fills the circle */
  }
  
  .header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
  }

  .header-nav-links {
    display: flex;
    align-items: center;
    gap: 1rem;
  }

  .nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s;
  }

  .nav-link:hover {
    color: var(--primary-color);
    background-color: var(--bg-color);
  }
  
  /* --- Admin Link --- */
  .header-admin-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.3s;
  }
  
  .header-admin-link:hover {
    color: var(--primary-color);
    background-color: var(--bg-color);
  }
  
  /* --- User Profile --- */
  .user-profile {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    cursor: pointer;
  }
  
  .user-profile i {
    font-size: 1.8rem;
    color: var(--text-secondary);
  }
  
  .user-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
  }
  
  .user-profile span {
    font-weight: 600;
    color: var(--text-color);
  }
  
  .user-profile-link {
    text-decoration: none;
    color: inherit;
  }
  
  /* === DROPDOWN MENU === */
  .user-profile-container {
    position: relative; /* This is required for positioning the dropdown */
  }
  .user-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 10px); /* Position it below the user profile with a small gap */
    right: 0; /* Align the right edge of the menu with the right edge of the profile container */
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 220px; /* Slightly wider for better spacing */
    z-index: 110;
    padding: 0.5rem 0;
  }
  /* Show menu when the container has the 'dropdown-active' class (from JS) */
  .user-profile-container.dropdown-active .user-dropdown-menu {
    display: block;
  }
  
  .user-dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--text-color);
    font-size: 0.9rem;
    transition: background-color 0.2s;
  }
  
  .user-dropdown-menu a:hover {
    background-color: var(--bg-color);
  }
  
  .user-dropdown-menu a i {
    width: 20px;
  }
  
  /* === THEME SWITCH === */
  .switch {
    font-size: 17px;
    position: relative;
    display: inline-block;
    width: 3.5em;
    height: 2em;
  }
  
  .switch input {
    opacity: 0;
    width: 0;
    height: 0;
  }
  
  .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 30px;
  }
  
  .slider:before {
    position: absolute;
    content: "";
    height: 1.4em;
    width: 1.4em;
    border-radius: 50%;
    left: 0.3em;
    bottom: 0.3em;
    background-color: white;
    transition: 0.4s;
    z-index: 1; /* Ensures click events pass through correctly */
  }
  
  [data-theme="light"] .slider {
    background-color: #f4f4f5;
  }
  
  [data-theme="light"] .slider:before {
    background-color: #2c2c2c;
  }
  
  .switch input:checked + .slider {
    background-color: var(--primary-color);
  }
  
  .switch input:checked + .slider:before {
    transform: translateX(1.5em);
    background-color: #ffcf48; /* Sun color */
  }
  
  /* === LOGOUT BUTTON === */
  .logout-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.3s;
  }
  
  .logout-btn:hover {
    color: #e53e3e; /* Red on hover */
  }
  
/* Profile page header height fix */
.profile-header {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

/* --- MOBILE DROPDOWN POSITIONING --- */
@media (max-width: 768px) {
  .user-dropdown-menu {
    /* On mobile, align to the left instead of the right */
    left: 0;
    right: auto;
  }

  /* --- MOBILE MODAL BUTTONS --- */
  .modal-actions button {
    padding: 0.75rem 1rem; /* Slightly reduce horizontal padding on all modal buttons */
  }

  .btn-confirm-no {
    background: transparent;
    border: none;
    box-shadow: none;
  }
}

/* === CONFIRMATION MODAL STYLES === */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000; /* Ensure it's on top of everything */
  padding: 1rem;
}

.modal-overlay .modal-content {
  background: var(--card-bg);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  max-width: 450px;
  width: 100%;
  text-align: center;
}

.modal-overlay .modal-content p {
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--text-color);
  margin-bottom: 2rem;
}

.modal-overlay .modal-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.modal-actions button {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-confirm-no {
  background: var(--bg-color);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}
.btn-confirm-no:hover {
  background: var(--border-color);
  color: var(--text-color);
}

/* Destructive action buttons (Delete/Logout) - Outline style */
.btn-confirm-yes, .btn-confirm-logout { 
  background-color: transparent; 
  color: #e63946; 
  border: 1px solid #e63946;
}
.btn-confirm-yes:hover, .btn-confirm-logout:hover { 
  background-color: #e63946; color: #fff; 
}

.btn-confirm-save { background-color: var(--primary-color); color: #fff; }
.btn-confirm-save:hover { background-color: var(--primary-hover); }

/* === INFO MODAL SPECIFIC STYLES === */
.info-modal-title {
  font-size: 1.5rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.modal-content .info-modal-title + p {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* === GLOBAL BUTTON STYLES === */
.btn-primary, .btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-primary {
  background-color: var(--primary-color);
  color: #fff;
}
.btn-primary:hover {
  background-color: var(--primary-hover);
}
.btn-primary:disabled {
  background-color: var(--border-color);
  color: var(--text-secondary);
  cursor: not-allowed;
}

.btn-secondary {
  background-color: var(--card-bg);
  color: var(--text-secondary);
  border-color: var(--border-color);
}
.btn-secondary:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background-color: var(--bg-color);
}
  