:root {
  --primary-color: #1a237e; /* Navy Blue */
  --secondary-color: #2e7d32; /* Emerald Green */
  --accent-color: #4caf50;
  --bg-light: #e8f5e9; /* Light Green */
  --white: #ffffff;
  --text-dark: #333333;
  --text-muted: #666666;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Outfit", sans-serif;
  color: var(--text-dark);
  line-height: 1.6;
  position: relative;
  min-height: 100vh;
}

/* Fixed background fix for mobile */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: linear-gradient(rgba(232, 245, 233, 0.9), rgba(232, 245, 233, 0.9)), 
              url('https://images.unsplash.com/photo-1542810634-71277d95dcbb?q=80&w=2070&auto=format&fit=crop');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  pointer-events: none;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header & Navigation */
header {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--primary-color);
}

.logo img {
  height: 50px;
  width: auto;
  border-radius: 5px;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 30px;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-dark);
  font-weight: 600;
  transition: var(--transition);
  position: relative;
}

.nav-links a:after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--secondary-color);
  transition: var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--secondary-color);
}

.nav-links a:hover:after,
.nav-links a.active:after {
  width: 100%;
}

.menu-toggle {
  display: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--primary-color);
}

/* Hero Section */
.hero {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: var(--white);
  padding: 80px 0;
  text-align: center;
  clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%);
  margin-bottom: 50px;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 15px;
  font-weight: 700;
}

.hero p {
  font-size: 1.2rem;
  opacity: 0.9;
}

/* Form Styling */
.form-container {
  max-width: 800px;
  margin-bottom: 80px;
}

.attendance-form {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(5px);
  padding: 40px;
  border-radius: 20px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
  transform: translateY(0);
  transition: var(--transition);
}

.attendance-form:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.form-group {
  margin-bottom: 25px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--primary-color);
}

input,
select,
textarea {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #eee;
  border-radius: 10px;
  font-family: inherit;
  font-size: 1rem;
  transition: var(--transition);
  background: #f9f9f9;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--secondary-color);
  background: var(--white);
}

/* Custom File Input */
.file-input-wrapper {
  position: relative;
  height: 100px;
  border: 2px dashed #ddd;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f9f9f9;
  cursor: pointer;
  transition: var(--transition);
}

.file-input-wrapper:hover {
  border-color: var(--secondary-color);
  background: #f1f8f1;
}

.file-input-wrapper input[type="file"] {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.file-display {
  text-align: center;
  color: var(--text-muted);
}

.file-display i {
  display: block;
  font-size: 1.5rem;
  margin-bottom: 5px;
  color: var(--secondary-color);
}

.btn-submit {
  width: 100%;
  padding: 15px;
  background: var(--primary-color);
  color: var(--white);
  border: none;
  border-radius: 10px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-submit:hover {
  background: var(--secondary-color);
  transform: scale(1.02);
}

/* Footer Styling */
footer {
  background: var(--primary-color);
  color: var(--white);
  padding: 60px 0 20px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-info h3 {
  margin-bottom: 20px;
  font-size: 1.5rem;
  color: var(--accent-color);
}

.footer-info p {
  margin-bottom: 5px;
  opacity: 0.8;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 15px;
}

.contact-item i {
  color: var(--accent-color);
}

.footer-map iframe {
  border-radius: 15px;
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.9rem;
  opacity: 0.7;
}

/* Animations */
.fade-in {
  animation: fadeIn 0.8s ease-out forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
    z-index: 1001;
    position: relative;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #f5f5f5;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: 0;
    flex-direction: column;
    background: var(--white);
    width: 280px;
    height: 100vh;
    padding: 100px 30px 40px;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
    transform: translateX(105%); /* Use transform for better performance and reliability */
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    visibility: hidden; /* Hide from screen readers when closed */
    overflow-y: auto; /* Enable scrolling for long menus */
  }

  .nav-links.active {
    transform: translateX(0);
    visibility: visible;
  }

  /* Backdrop Overlay */
  .menu-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
  }

  .menu-backdrop.active {
    opacity: 1;
    visibility: visible;
  }

  .nav-links li {
    width: 100%;
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.3s ease;
  }

  .nav-links.active li {
    opacity: 1;
    transform: translateX(0);
  }

  /* Staggered animation for menu items */
  .nav-links.active li:nth-child(1) { transition-delay: 0.1s; }
  .nav-links.active li:nth-child(2) { transition-delay: 0.15s; }
  .nav-links.active li:nth-child(3) { transition-delay: 0.2s; }
  .nav-links.active li:nth-child(4) { transition-delay: 0.25s; }
  .nav-links.active li:nth-child(5) { transition-delay: 0.3s; }
  .nav-links.active li:nth-child(6) { transition-delay: 0.35s; }
  .nav-links.active li:nth-child(7) { transition-delay: 0.4s; }
  .nav-links.active li:nth-child(8) { transition-delay: 0.45s; }
  .nav-links.active li:nth-child(9) { transition-delay: 0.5s; }
  .nav-links.active li:nth-child(10) { transition-delay: 0.55s; }

  .nav-links a {
    display: block;
    padding: 15px 0;
    font-size: 1.1rem;
    border-bottom: 1px solid #f0f0f0;
    color: var(--primary-color);
  }

  .nav-links a:after {
    display: none;
  }

  .nav-links a.active {
    color: var(--secondary-color);
    border-bottom-color: var(--secondary-color);
    padding-left: 10px;
  }

  .logo img {
    height: 40px;
  }

  .logo span {
    font-size: 0.75rem;
    max-width: 150px;
    white-space: normal;
    text-wrap: balance; /* Modern browsers will wrap this nicely */
  }
}

@media (max-width: 480px) {
  .logo span {
    font-size: 0.65rem;
    max-width: 120px;
  }
}
/* Modal Styling */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}

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

.modal-content {
  background: var(--white);
  padding: 40px;
  border-radius: 30px;
  text-align: center;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  transform: scale(0.8);
  transition: var(--transition);
}

.modal.active .modal-content {
  transform: scale(1);
}

.modal-icon {
  font-size: 5rem;
  color: var(--secondary-color);
  margin-bottom: 20px;
  animation: scaleUp 0.5s ease-out;
}

.modal-content h2 {
  color: var(--primary-color);
  margin-bottom: 10px;
  font-size: 2rem;
}

.modal-content p {
  color: var(--text-muted);
  margin-bottom: 25px;
}

.btn-close-modal {
  background: var(--primary-color);
  color: var(--white);
  border: none;
  padding: 12px 30px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

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

@keyframes scaleUp {
  from { transform: scale(0); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
/* Admin Nav button */
.btn-login-nav {
  background: var(--primary-color);
  color: white !important;
  padding: 8px 15px !important;
  border-radius: 50px;
  font-size: 0.9rem;
  display: flex !important;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}

.btn-login-nav:hover {
  background: var(--secondary-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.btn-login-nav:after {
  display: none !important;
}

@media (max-width: 768px) {
  .admin-nav {
    margin-top: 10px;
    border-top: 1px solid #eee;
    padding-top: 20px;
  }
}
/* Page Loader - Premium Version */
.page-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--white);
  background: linear-gradient(-45deg, #ffffff, #f1f8f1, #e8f5e9, #ffffff);
  background-size: 400% 400%;
  animation: gradientBG 15s ease infinite;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes gradientBG {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.page-loader.hidden {
  opacity: 0;
  pointer-events: none;
}

.spinner-wrapper {
  position: relative;
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 40px;
  filter: drop-shadow(0 0 15px rgba(26, 35, 126, 0.2));
}

.spinner-outer {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 4px solid transparent;
  border-top-color: var(--primary-color);
  border-bottom-color: var(--primary-color);
  border-radius: 50%;
  animation: spin-cw 2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.spinner-inner {
  position: absolute;
  width: 75%;
  height: 75%;
  border: 4px solid transparent;
  border-left-color: var(--secondary-color);
  border-right-color: var(--secondary-color);
  border-radius: 50%;
  animation: spin-ccw 1.5s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.spinner-dot {
  width: 20px;
  height: 20px;
  background: var(--accent-color);
  border-radius: 50%;
  animation: pulse-dot 1.5s ease-in-out infinite;
  box-shadow: 0 0 20px var(--accent-color);
}

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

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

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 0.5; box-shadow: 0 0 10px var(--accent-color); }
  50% { transform: scale(1.4); opacity: 1; box-shadow: 0 0 30px var(--accent-color); }
}

.loading-text {
  color: var(--primary-color);
  font-weight: 800;
  letter-spacing: 6px;
  font-size: 1rem;
  text-transform: uppercase;
  position: relative;
}

.loading-text::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--secondary-color), transparent);
  animation: translateLine 2s linear infinite;
}

@keyframes translateLine {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Global Content Reveal Animation */
.reveal-content {
  opacity: 0;
  transform: translateY(10px);
  animation: revealContent 0.5s ease-out forwards;
  animation-delay: 1.1s;
}

@keyframes revealContent {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Staggered Animations for Grid Items/Cards */
.stagger-card {
  opacity: 0;
  transform: translateY(10px);
  animation: revealContent 0.5s ease-out forwards;
}

.stagger-card:nth-child(n) { animation-delay: 1.2s; }

/* Form Submission Loader - Ultra Immersive */
.submit-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  opacity: 0;
  pointer-events: none;
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.submit-loader.active {
  opacity: 1;
  pointer-events: auto;
}

.submit-message {
  margin-top: 40px;
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--primary-color);
  text-align: center;
  letter-spacing: 1px;
}

.submit-message small {
  display: block;
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 15px;
  letter-spacing: 2px;
  text-transform: uppercase;
}
