/* ═══════════════════════════════════════════════════════════════════════════════
   pageLoader.css - Complete Loading Screen System
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ─── Base Loader Styles ─── */
#page-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  color: white;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  transition: opacity 0.3s ease-out;
  opacity: 1;
}

/* ─── Spinner Animation ─── */
.loader-spinner {
  width: 60px;
  height: 60px;
  border: 5px solid rgba(255, 255, 255, 0.2);
  border-top: 5px solid white;
  border-radius: 50%;
  animation: loaderSpin 1s linear infinite;
  margin-bottom: 32px;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

@keyframes loaderSpin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* ─── Loading Text Styles ─── */
.loader-title {
  margin: 0 0 12px 0;
  font-weight: 300;
  font-size: 28px;
  text-align: center;
  letter-spacing: 1px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.loader-subtitle {
  margin: 0;
  opacity: 0.85;
  font-size: 16px;
  text-align: center;
  font-weight: 400;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* ─── Theme Variations ─── */

/* Blue Theme - Perfect for Calendar/Dashboard */
.loader-theme-blue {
  background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%);
}

.loader-theme-blue .loader-spinner {
  border-top-color: #60a5fa;
  box-shadow: 0 0 25px rgba(96, 165, 250, 0.3);
}

/* Green Theme - Perfect for Clients/Data */
.loader-theme-green {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.loader-theme-green .loader-spinner {
  border-top-color: #34d399;
  box-shadow: 0 0 25px rgba(52, 211, 153, 0.3);
}

/* Purple Theme - Perfect for Admin/Settings */
.loader-theme-purple {
  background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
}

.loader-theme-purple .loader-spinner {
  border-top-color: #a78bfa;
  box-shadow: 0 0 25px rgba(167, 139, 250, 0.3);
}

/* Orange Theme - Perfect for Billing/Finance */
.loader-theme-orange {
  background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
}

.loader-theme-orange .loader-spinner {
  border-top-color: #fb923c;
  box-shadow: 0 0 25px rgba(251, 146, 60, 0.3);
}

/* Red Theme - Perfect for Reports/Analytics */
.loader-theme-red {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

.loader-theme-red .loader-spinner {
  border-top-color: #f87171;
  box-shadow: 0 0 25px rgba(248, 113, 113, 0.3);
}

/* ─── Hide Content While Loading ─── */
body.loading #websitecontainer,
body.loading #maincontentclientlistpage,
body.loading .main-content,
body.loading .page-content,
body.loading #contentcontainer,
body.loading #rightsidepagecontainer {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease-in-out;
}

/* ─── Show Content After Loading ─── */
#websitecontainer,
#maincontentclientlistpage,
.main-content,
.page-content,
#contentcontainer,
#rightsidepagecontainer {
  opacity: 1;
  transition: opacity 0.3s ease-in-out;
}

/* ─── Responsive Design ─── */
@media (max-width: 768px) {
  .loader-title {
    font-size: 22px;
    margin-bottom: 8px;
  }
  
  .loader-subtitle {
    font-size: 14px;
    padding: 0 20px;
    line-height: 1.4;
  }
  
  .loader-spinner {
    width: 50px;
    height: 50px;
    border-width: 4px;
    margin-bottom: 24px;
  }
}

@media (max-width: 480px) {
  .loader-title {
    font-size: 18px;
  }
  
  .loader-subtitle {
    font-size: 12px;
  }
  
  .loader-spinner {
    width: 40px;
    height: 40px;
    border-width: 3px;
    margin-bottom: 20px;
  }
}

/* ─── Accessibility ─── */
@media (prefers-reduced-motion: reduce) {
  .loader-spinner {
    animation: none;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top: 5px solid white;
  }
}

/* ─── Print Styles ─── */
@media print {
  #page-loader {
    display: none !important;
  }
  
  body.loading #websitecontainer,
  body.loading #maincontentclientlistpage,
  body.loading .main-content,
  body.loading .page-content {
    opacity: 1 !important;
    pointer-events: auto !important;
  }
}