/* Critical CSS for Azhary Academy - Above-the-fold content only */

/* Essential variables */
:root {
  --islamic-gold: #d4af37;
  --islamic-green: #228b22;
  --islamic-blue: #1e3a8a;
}

/* Critical body styles */
body {
  font-family: "Roboto", system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  color: #212529;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* Critical header styles */
.fixed-top {
  background-color: rgb(2, 37, 108);
  opacity: 0.88;
  color: #fff;
  z-index: 1040;
  transition: box-shadow 0.3s ease;
}

.navbar {
  background: white !important;
  border: none !important;
}

.navbar-brand img {
  max-height: 60px;
}

/* Critical hero styles */
.hero {
  background: url('../img/hero-back.jpg') no-repeat center center;
  background-size: cover;
  position: relative;
  direction: ltr;
  min-height: 560px;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgb(2, 37, 108);
  opacity: 0.88;
}

/* Critical button styles */
.btn-islamic {
  background: linear-gradient(135deg, var(--islamic-gold), var(--islamic-green));
  border: none;
  color: white;
  padding: 12px 30px;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  display: inline-block;
}

/* Loading spinner - Critical for UX */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.98);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease;
}

.loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-content {
  text-align: center;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #d4af37;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

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

/* Critical mobile styles */
@media (max-width: 768px) {
  .hero {
    min-height: 400px;
  }
  
  .btn-islamic {
    padding: 10px 25px;
    font-size: 0.9rem;
  }
}

/* Performance optimizations */
* {
  box-sizing: border-box;
}

img {
  max-width: 100%;
  height: auto;
}

/* Reduce paint operations */
.hero, .navbar, .fixed-top {
  will-change: auto;
  transform: translateZ(0);
}

/* Essential utility classes */
.text-white { color: white !important; }
.text-center { text-align: center; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-lg-0 { margin-bottom: 0; }
.py-5 { padding-top: 3rem; padding-bottom: 3rem; }
.section { padding: 60px 0; }
.display-5 { font-size: 3rem; font-weight: 300; line-height: 1.2; }
.fw-bold { font-weight: 700 !important; }
.btn-lg { padding: 0.75rem 1.5rem; font-size: 1.25rem; }
.img-fluid { max-width: 100%; height: auto; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 15px; }
.row { display: flex; flex-wrap: wrap; margin: 0 -15px; }
.col-12, .col-md-4, .col-md-6, .col-lg-3, .col-lg-6 { padding: 0 15px; }
.col-12 { flex: 0 0 100%; }
.col-md-4 { flex: 0 0 33.333333%; }
.col-md-6 { flex: 0 0 50%; }
.col-lg-3 { flex: 0 0 25%; }
.col-lg-6 { flex: 0 0 50%; }

/* Mobile responsive */
@media (max-width: 768px) {
  .col-md-4, .col-md-6 { flex: 0 0 100%; }
  .display-5 { font-size: 2.5rem; }
  .section { padding: 40px 0; }
}

@media (max-width: 992px) {
  .col-lg-3, .col-lg-6 { flex: 0 0 50%; }
}
