/* ==========================================================================
   1. GLOBAL VARIABLES & ROLE THEMES (WHITE SIDEBAR BASE)
   ========================================================================== */
:root {
  --font-main: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);

  /* Global Sidebar Defaults (White Background for ALL roles) */
  --role-bg-color: #ffffff;
  --role-text-main: #1f2937; /* Dark slate text */
  --role-text-muted: #6b7280; /* Neutral gray for headings */
  --role-border: #e5e7eb; /* Clean thin gray border divider */
}

/* 🔴 ADMIN SPECIFIC ACCENTS */
.admin-sidebar {
  --role-accent-color: #6366f1; /* Indigo primary */
  --role-hover-bg: #e0e7ff; /* Very soft indigo pastel hover */
}

/* 🟡 TEACHER SPECIFIC ACCENTS (Your custom requested scheme) */
.teacher-sidebar {
  --role-accent-color: #eab308; /* Vibrant yellow primary */
  --role-hover-bg: #fef08a; /* Soft pastel yellow hover */
}

/* 🟢 STUDENT SPECIFIC ACCENTS */
.student-sidebar {
  --role-accent-color: #10b981; /* Emerald green primary */
  --role-hover-bg: #d1fae5; /* Soft pastel emerald hover */
}

/* 🔵 PARENT SPECIFIC ACCENTS */
.parent-sidebar {
  --role-accent-color: #3b82f6; /* Bright blue primary */
  --role-hover-bg: #dbeafe; /* Soft pastel blue hover */
}

/* ==========================================================================
   2. BASIC PAGE RESET & STRUCTURAL GRID
   ========================================================================== */
body {
  margin: 0;
  padding: 0;
  font-family: var(--font-main);
  background-color: #f9fafb;
  color: #1f2937;
  width: 100% !important;
}

/* 🔄 FULL WIDTH SYSTEM: Forces the outer flex grid container to stretch to screen limits */
.app-layout-wrapper {
  display: flex !important;
  width: 100% !important;
  min-height: 100vh;
  box-sizing: border-box;
}

/* 🔄 DYNAMIC FLEX CALCULATION: Extends content columns right up to the display monitor edge */
.main-content-wrapper {
  flex: 1 !important;
  margin-left: 260px; /* Leaves clear space for the fixed 260px sidebar */
  padding: 40px;
  box-sizing: border-box;
  width: calc(100% - 260px) !important;
  max-width: 100% !important;
  min-width: 0 !important; /* Critical CSS fix: breaks out of any forced narrow columns */
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important; /* Forces your table layout card to expand across the full screen space */
}
/* ==========================================================================
   3. UNIFIED WHITE SIDEBAR COMPONENTS
   ========================================================================== */
/* ==========================================================================
   3. UNIFIED WHITE SIDEBAR COMPONENTS
   ========================================================================== */
.sidebar {
  background-color: var(--role-bg-color);
  width: 260px;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  padding: 30px 16px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  border-right: 1px solid var(--role-border);
  color: var(--role-text-main);
  z-index: 100;
}

.sidebar-logo-container {
  text-align: center;
  margin-bottom: 24px;
}

.logo {
  max-width: 75%;
  height: auto;
}

.user-welcome-badge {
  padding: 10px 12px;
  font-size: 14px;
  color: var(--role-text-main);
}
.user-welcome-badge span {
  display: block;
  font-size: 11px;
  color: var(--role-text-muted);
  font-weight: 500;
}

.sidebar-divider {
  border: none;
  border-top: 1px solid var(--role-border);
  margin: 15px 0;
}

.menu-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  color: var(--role-text-muted);
  margin: 20px 0 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 🔄 DYNAMIC THEMED TITLE ICONS: Makes header titles use theme colors too */
.menu-title i {
  color: var(--role-accent-color);
}

/* Core Navigation Links */
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  color: var(--role-text-main);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-radius: 12px;
  margin-bottom: 4px;
  transition: var(--transition-smooth);
}

.sidebar-link i {
  width: 18px;
  text-align: center;
  color: var(--role-text-muted); /* Default gray state */
  font-size: 16px;
  transition: var(--transition-smooth);
}

/* 🔄 HOVER STATE: Background shifts, icon lights up with theme accent color */
.sidebar-link:hover {
  background-color: var(--role-hover-bg);
  color: var(--role-text-main);
}
.sidebar-link:hover i {
  color: var(--role-accent-color); /* Icon changes color on hover */
}

/* 🔄 ACTIVE STATE: Full solid background fill, text and icon turn pure white */
.sidebar-link.active {
  background-color: var(--role-accent-color);
  color: #ffffff !important;
  font-weight: 600;
}
.sidebar-link.active i {
  color: #ffffff !important; /* Forces active icon to become solid white */
}

.empty-msg {
  padding-left: 12px;
  font-size: 13px;
  color: var(--role-text-muted);
}

/* Parent view child structural alignments */
.child-block {
  margin-bottom: 12px;
  border: 1px solid var(--role-border);
  border-radius: 12px;
  padding: 6px;
  background-color: #f9fafb;
}
.child-name {
  display: block;
  font-weight: 600;
  font-size: 13px;
  padding: 6px 12px 4px 12px;
  color: var(--role-text-main);
}

/* 🔄 CHILD BLOCK ICON ACCENT: Light up the icon beside student names */
.child-name i {
  color: var(--role-accent-color);
  margin-right: 4px;
}

/* Logout Exit Row Button Styling rules */
.sidebar .logout {
  margin-top: auto;
}
.sidebar .logout button {
  width: 100%;
  background-color: transparent;
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
  padding: 11px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition-smooth);
}
.sidebar .logout button:hover {
  background-color: #fef2f2;
  border-color: #ef4444;
}
/* ==========================================================================
   4. PREMIUM ROLE LANDING & LOGIN PAGE STYLES (WITH FIXED ICONS)
   ========================================================================== */

.login-page-body {
  margin: 0;
  padding: 20px;
  background-color: #f8fafc;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  font-family: var(--font-main);
  box-sizing: border-box;
}

.role-selection-wrapper {
  width: 100%;
  max-width: 900px;
  animation: fadeIn 0.4s ease-out;
}

.landing-header-branding {
  text-align: center;
  margin-bottom: 40px;
}

.landing-logo-img {
  max-width: 300px;
  height: auto;
  margin-bottom: 20px;
}

.landing-header-branding h2 {
  margin: 0 0 8px 0;
  font-size: 28px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.landing-header-branding p {
  margin: 0;
  font-size: 15px;
  color: #64748b;
}

.role-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.role-select-card {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 35px 20px;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
  transition:
    transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.25s ease;
}

/* 🔍 FIXED ICON CONTAINERS: Clean, centered circles for each font-awesome icon */
.role-icon-circle {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px auto;
  transition: var(--transition-smooth);
}

/* Ensures the font-awesome icon inherits sizing and positions accurately */
.role-icon-circle i {
  font-size: 26px;
  display: inline-block;
}

.role-select-card h3 {
  margin: 0 0 8px 0;
  font-size: 19px;
  font-weight: 700;
  color: #1e293b;
}

.role-select-card span {
  font-size: 13px;
  color: #64748b;
  display: block;
  line-height: 1.4;
}

/* 🟡 TEACHER DESIGN ASSIGNMENTS */
.card-teacher .role-icon-circle {
  background-color: #fef08a;
  color: #854d0e;
}
.card-teacher:hover {
  border-color: #eab308;
  box-shadow: 0 12px 25px rgba(234, 179, 8, 0.15);
}
.card-teacher:hover .role-icon-circle {
  transform: scale(1.05);
}

/* 🔴 ADMIN DESIGN ASSIGNMENTS */
.card-admin .role-icon-circle {
  background-color: #e0e7ff;
  color: #4338ca;
}
.card-admin:hover {
  border-color: #6366f1;
  box-shadow: 0 12px 25px rgba(99, 102, 241, 0.15);
}
.card-admin:hover .role-icon-circle {
  transform: scale(1.05);
}

/* 🟢 STUDENT DESIGN ASSIGNMENTS */
.card-student .role-icon-circle {
  background-color: #d1fae5;
  color: #065f46;
}
.card-student:hover {
  border-color: #10b981;
  box-shadow: 0 12px 25px rgba(16, 185, 129, 0.15);
}
.card-student:hover .role-icon-circle {
  transform: scale(1.05);
}

/* 🔵 PARENT DESIGN ASSIGNMENTS */
.card-parent .role-icon-circle {
  background-color: #dbeafe;
  color: #1d4ed8;
}
.card-parent:hover {
  border-color: #3b82f6;
  box-shadow: 0 12px 25px rgba(59, 130, 246, 0.15);
}
.card-parent:hover .role-icon-circle {
  transform: scale(1.05);
}

.role-select-card:hover {
  transform: translateY(-6px);
}

/* --- STAGE 2: FORM BOX --- */
/* --- STAGE 2: PRECISELY CENTERED FORM CARD --- */
.login-card-container {
  background-color: #ffffff;
  border-radius: 24px;
  box-shadow:
    0 20px 25px -5px rgba(0, 0, 0, 0.05),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
  width: 100%;
  max-width: 460px; /* Spacious width */
  padding: 40px;
  box-sizing: border-box;
  border: 1px solid #e2e8f0;

  /* 🔄 CENTERING SYSTEM: Ensures the card layout balances perfectly */
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.3s ease-out;
}

/* 🔄 BIGGER LOGO CONTROL: Enlarges the image while keeping it safe and proportionate */
.login-card-container .login-logo-img {
  max-width: 160px !important; /* Increased size boundary */
  height: auto !important; /* Restores natural proportion lock */
  display: block;
  margin: 0 auto 16px auto !important; /* Perfect horizontal centering alignment */
}

/* 🔄 FIXED TEXT LABELS: Aligns field descriptions clearly to the left */
.login-form-layout {
  display: flex;
  flex-direction: column;
  gap: 18px; /* Balanced spacing between form cells */
  width: 100%;
  text-align: left; /* Forces alignment context to read left-to-right */
}

.login-form-layout .form-group {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.login-form-layout .form-label {
  display: block;
  font-size: 14px;
  font-weight: 600; /* Crisp bold look */
  color: #334155; /* Premium slate gray text */
  margin-bottom: 6px;
  text-align: left; /* Double verification for absolute left alignment */
}

/* Premium form fields dimensions */
.login-input-field {
  width: 100%;
  padding: 14px 16px !important;
  border: 1.5px solid #cbd5e1 !important;
  border-radius: 12px !important;
  font-size: 15px !important;
  background-color: #ffffff !important;
  color: #0f172a !important;
  font-weight: 500;
  box-sizing: border-box; /* Prevents input parameters from expanding outside card padding edge */
  transition: all 0.2s ease !important;
}
.btn-back-to-roles {
  background: none;
  border: none;
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  margin-bottom: 20px;
  transition: color 0.2s;
}
.btn-back-to-roles:hover {
  color: #1e293b;
}

.login-error-alert {
  background-color: #fef2f2;
  border: 1px solid #fee2e2;
  color: #991b1b;
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 20px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}

.login-theme-admin {
  --login-accent: #6366f1;
  --login-focus: rgba(99, 102, 241, 0.15);
}
.login-theme-teacher {
  --login-accent: #eab308;
  --login-focus: rgba(234, 179, 8, 0.15);
}
.login-theme-student {
  --login-accent: #10b981;
  --login-focus: rgba(16, 185, 129, 0.15);
}
.login-theme-parent {
  --login-accent: #3b82f6;
  --login-focus: rgba(59, 130, 246, 0.15);
}

.login-card-container .login-input-field:focus {
  border-color: var(--login-accent) !important;
  box-shadow: 0 0 0 4px var(--login-focus) !important;
  outline: none;
}

.login-card-container .btn-submit-modal {
  background-color: var(--login-accent) !important;
  border: none;
  color: #ffffff;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}
.login-card-container .btn-submit-modal:hover {
  filter: brightness(0.92);
  transform: translateY(-1px);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/*==========================================================================
   🔄 PREMIUM ADMIN INDIGO LOADER ANIMATION SYSTEM
   ========================================================================== */

/* Full screen glassmorphism mask layer */
.app-loader-overlay {
  position: fixed !important;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(
    15,
    23,
    42,
    0.4
  ) !important; /* Premium neutral slate gray drop shadow */
  backdrop-filter: blur(8px) !important; /* Elegant blurred glass effect */
  -webkit-backdrop-filter: blur(8px) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999999 !important; /* Sits completely on top of everything */
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}

/* Central box container alignment layout */
.loader-content-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

/* 🔄 THE SPINNER CIRCLE: Glows beautifully with your Admin Purple brand colors! */
.spinner-circle {
  width: 52px;
  height: 52px;
  border: 5px solid #eef2ff !important; /* Soft, premium light-indigo background track ring */
  border-top: 5px solid #6366f1 !important; /* 🟣 SOLID ADMIN PURPLE MOVING HEAD CAPSULE */
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.1);
  animation: ditariumSpinnerSpin 0.9s cubic-bezier(0.4, 0, 0.2, 1) infinite; /* Fast, responsive fluid rotation timing */
}

/* Dynamic Albanian status label underneath */
.loader-text-message {
  margin: 0;
  font-size: 10px;
  font-weight: 700;
  color: #4338ca !important; /* Deep contrast indigo purple font */
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Smooth hidden animation transition helper utility class hook */
.loader-hidden {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

@keyframes ditariumSpinnerSpin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* ==========================================================================
   🔄 MULTI-THEME REUSABLE PRIMARY ACTION BUTTONS
   ========================================================================== */
.btn-submit-modal,
.btn-primary-action {
  /* 🔄 DYNAMIC THEME BINDING: Pulls the active color token automatically */
  background-color: var(--role-accent-color, #eab308) !important;
  color: #ffffff !important;
  border: none !important;
  padding: 12px 22px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 12px; /* High radius smooth curves */
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition:
    transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    filter 0.2s ease;
}

.btn-submit-modal:hover,
.btn-primary-action:hover {
  filter: brightness(0.92); /* Clean uniform darken effect on hover */
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.btn-submit-modal:active,
.btn-primary-action:active {
  transform: translateY(0);
}

/* Clear Cancel / Dismiss Outline Button Style */
.btn-cancel-modal {
  background-color: #ffffff !important;
  color: #4b5563 !important;
  border: 1px solid #d1d5db !important;
  padding: 12px 22px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-cancel-modal:hover {
  background-color: #f3f4f6 !important;
  color: #1f2937 !important;
  border-color: #9ca3af !important;
}
