/* ==========================================================================
   Swarajya Career Academy - UI Components CSS
   ========================================================================== */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
  line-height: 1.2;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 16px 32px;
  font-size: 1.05rem;
  border-radius: var(--radius-md);
}

.btn-full {
  width: 100%;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--on-primary);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background-color: var(--primary-container);
  color: var(--on-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background-color: var(--secondary);
  color: var(--on-secondary);
}

.btn-secondary:hover {
  background-color: var(--secondary-container);
  transform: translateY(-2px);
}

.btn-gold {
  background-color: var(--tertiary);
  color: var(--on-tertiary);
}

.btn-gold:hover {
  background-color: var(--tertiary-container);
}

.btn-outline {
  background-color: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-outline:hover {
  background-color: var(--primary);
  color: var(--on-primary);
  transform: translateY(-2px);
}

.btn-outline-white {
  background-color: transparent;
  color: #ffffff;
  border: 2px solid #ffffff;
}

.btn-outline-white:hover {
  background-color: #ffffff;
  color: var(--on-background);
}

.btn-surface {
  background-color: var(--surface-container-lowest);
  color: var(--primary);
  border: 1px solid var(--outline-variant);
  box-shadow: var(--shadow-xs);
}

.btn-surface:hover {
  background-color: var(--primary-fixed);
  color: var(--on-primary-fixed);
  border-color: var(--primary);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-primary {
  background: var(--primary-fixed);
  color: var(--on-primary-fixed);
  border: 1px solid var(--outline-variant);
}

.badge-secondary {
  background: var(--secondary-fixed);
  color: var(--on-secondary-fixed);
}

.badge-gold {
  background: var(--tertiary-fixed);
  color: var(--on-tertiary-fixed);
}

.badge-pulse {
  position: relative;
}

.badge-pulse::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--secondary);
  display: inline-block;
  animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

/* Cards & Bento Grid */
.card {
  background-color: var(--surface-container-lowest);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-normal);
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
  border-color: var(--primary-fixed-dim);
}

.grid-cols-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

.grid-cols-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.grid-cols-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

/* Bento Box Grid */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.bento-large {
  grid-column: span 2;
  grid-row: span 2;
  position: relative;
  min-height: 480px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 36px;
  background-color: var(--inverse-surface);
  color: #ffffff;
}

.bento-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.bento-large:hover .bento-bg-img {
  transform: scale(1.04);
}

.bento-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.1) 0%, rgba(20,15,10,0.85) 60%, rgba(10,5,0,0.96) 100%);
}

.bento-content {
  position: relative;
  z-index: 2;
}

.bento-card {
  background: var(--surface-container-lowest);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-xl);
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-normal);
}

.bento-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.bento-icon-box {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

/* Stats Counter Bar */
.stats-bar {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-container) 100%);
  color: #ffffff;
  padding: 36px 0;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  margin-top: -40px;
  position: relative;
  z-index: 20;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  text-align: center;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 16px;
  border-right: 1px solid rgba(255, 255, 255, 0.25);
}

.stat-item:last-child {
  border-right: none;
}

.stat-number {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 3.5vw, 3rem);
  font-weight: 800;
  line-height: 1;
  margin-bottom: 6px;
  color: var(--tertiary-fixed);
}

.stat-label {
  font-size: 0.95rem;
  font-weight: 600;
  opacity: 0.95;
}

/* Student Hall of Fame Cards */
.student-card {
  background: var(--surface-container-lowest);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  position: relative;
  cursor: pointer;
}

.student-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.student-poster-wrap {
  position: relative;
  overflow: hidden;
  background: var(--surface-container-high);
  aspect-ratio: 1 / 1;
}

.student-poster-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.student-card:hover .student-poster-img {
  transform: scale(1.05);
}

.student-badge-corner {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--tertiary-fixed);
  color: var(--on-tertiary-fixed);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 2;
}

.student-info {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.student-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--on-surface);
}

.student-post {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
}

.student-batch {
  font-size: 0.85rem;
  color: var(--on-surface-variant);
}

/* Filter Tabs */
.filter-tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 40px;
}

.filter-btn {
  background: var(--surface-container-high);
  border: 1px solid var(--outline-variant);
  color: var(--on-surface-variant);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 8px 20px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-btn:hover {
  background: var(--surface-variant);
  color: var(--on-surface);
}

.filter-btn.active {
  background: var(--primary);
  color: var(--on-primary);
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* Feature Grid Cards */
.feature-item {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  padding: 20px;
  border-radius: var(--radius-lg);
  background: var(--surface-container-lowest);
  border: 1px solid var(--outline-variant);
  transition: all var(--transition-fast);
}

.feature-item:hover {
  border-color: var(--primary-fixed-dim);
  background: var(--surface-container-low);
}

.feature-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--primary-fixed);
  color: var(--on-primary-fixed);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Forms */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--on-surface);
  margin-bottom: 8px;
}

.form-control, .form-select {
  width: 100%;
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--on-surface);
  background-color: var(--surface-container-lowest);
  border: 1.5px solid var(--outline-variant);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(164, 55, 0, 0.15);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

/* Daily Routine Timeline */
.timeline {
  position: relative;
  padding-left: 32px;
  border-left: 3px solid var(--primary-fixed);
  margin: 32px 0;
}

.timeline-item {
  position: relative;
  margin-bottom: 32px;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -40px;
  top: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary);
  border: 3px solid var(--surface);
}

.timeline-time {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--primary);
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.timeline-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--on-surface);
  margin-bottom: 6px;
}

.timeline-desc {
  font-size: 0.95rem;
  color: var(--on-surface-variant);
}

/* Modals & Lightbox */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--surface-container-lowest);
  border-radius: var(--radius-xl);
  max-width: 640px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  position: relative;
  padding: 32px;
  transform: scale(0.95);
  transition: transform var(--transition-normal);
}

.modal-backdrop.open .modal-card {
  transform: scale(1);
}

.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--surface-container-high);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--on-surface);
  transition: background var(--transition-fast);
}

.modal-close-btn:hover {
  background: var(--error-container);
  color: var(--on-error-container);
}

/* Lightbox Image Preview */
.lightbox-card {
  background: transparent;
  max-width: 800px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-img {
  max-height: 80vh;
  max-width: 100%;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  object-fit: contain;
}

/* Banner Carousel */
.hero-slider-wrap {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: var(--surface-container-high);
}

.hero-slide {
  display: none;
  width: 100%;
}

.hero-slide.active {
  display: block;
  animation: fadeIn 0.6s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.slider-nav {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}

.slider-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.slider-dot.active {
  background: var(--primary);
  width: 28px;
  border-radius: var(--radius-full);
}

/* Interactive Calculator Box */
.calc-box {
  background: var(--surface-container-low);
  border: 2px solid var(--outline-variant);
  border-radius: var(--radius-xl);
  padding: 32px;
}

.calc-result-box {
  background: var(--surface-container-lowest);
  border: 2px dashed var(--primary);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-top: 24px;
}

/* Responsive Overrides */
@media (max-width: 1024px) {
  .bento-grid {
    grid-template-columns: 1fr 1fr;
  }
  .bento-large {
    grid-column: span 2;
  }
  .grid-cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
  }
  .stat-item:nth-child(2) {
    border-right: none;
  }
}

@media (max-width: 768px) {
  .grid-cols-2, .grid-cols-3, .bento-grid {
    grid-template-columns: 1fr;
  }
  .bento-large {
    grid-column: span 1;
    min-height: 380px;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .grid-cols-4, .stats-grid {
    grid-template-columns: 1fr;
  }
  .stat-item {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 16px;
  }
}

/* ==========================================================================
   Page Loader - Unique Animated Circular Avatar Badge & Light Theme
   ========================================================================== */
.page-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background-color: #ffffff;
  background-image: radial-gradient(circle at center, #ffffff 0%, #f7f3f0 100%);
  z-index: 9999999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  visibility: visible;
  clip-path: circle(150% at 50% 50%);
  transition: clip-path 0.85s cubic-bezier(0.77, 0, 0.175, 1),
              opacity 0.65s cubic-bezier(0.4, 0, 0.2, 1),
              visibility 0.65s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: all;
  user-select: none;
}

.page-loader-inner {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 160px;
  height: 160px;
  transition: transform 0.75s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.5s ease;
}

/* Outer Spinning Gradient Ring */
.page-loader-inner::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--primary), var(--secondary), var(--tertiary-container), var(--primary));
  animation: loaderSpinRing 2.5s linear infinite;
  opacity: 0.85;
  filter: blur(1px);
}

/* Inner White Mask behind the spinning ring */
.page-loader-inner::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(164, 55, 0, 0.18), inset 0 0 15px rgba(0, 0, 0, 0.05);
}

/* Circular Avatar Image Badge */
.page-loader-inner .loader-logo {
  position: relative;
  z-index: 3;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  border: 4px solid #ffffff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  background: #ffffff;
  padding: 4px;
  animation: loaderAvatarPulse 2s ease-in-out infinite alternate;
}

/* Keyframe Animations */
@keyframes loaderSpinRing {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes loaderAvatarPulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 8px 24px rgba(164, 55, 0, 0.15);
  }
  100% {
    transform: scale(1.05);
    box-shadow: 0 16px 36px rgba(164, 55, 0, 0.28);
  }
}

/* Unique Circular Reveal Exit Opening */
.page-loader.loaded {
  clip-path: circle(0% at 50% 50%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.page-loader.loaded .page-loader-inner {
  transform: scale(1.5) rotate(15deg);
  opacity: 0;
}
