/* ==================== */
/* Color Variables */
/* ==================== */
:root {
  --primary: #4361ee;       /* Vibrant blue */
  --primary-light: #4895ef; /* Lighter blue */
  --secondary: #3a0ca3;     /* Deep purple */
  --accent: #f72585;        /* Energetic pink */
  --light: #f8f9fa;         /* Light background */
  --dark: #212529;          /* Dark text */
  --gray: #adb5bd;          /* Gray elements */
  --error: #ef233c;         /* Error red */
  --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  --input-focus: 0 0 0 3px rgba(67, 97, 238, 0.2);
}

/* ==================== */
/* Base Styles */
/* ==================== */
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  font-family: 'Segoe UI', 'Poppins', -apple-system, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
  background: #f5f7fa;
  color: var(--dark);
}

/* ==================== */
/* Top Bar */
/* ==================== */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--primary);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.top-bar h2 {
  margin: 0;
  font-size: clamp(1.25rem, 5cqi, 1.75rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-variation-settings: 'wght' 800, 'wdth' 100;
  text-wrap: balance;
  color: inherit;
  font-optical-sizing: auto;
}

/* Optional: Add smooth transitions for interactive states */
.top-bar h2 {
  transition: all 0.3s ease(var(--ease-out-5, ease));
}

/* Modern container query approach */
@container top-bar (max-width: 768px) {
  .top-bar h2 {
    font-size: clamp(1.1rem, 4cqi, 1.5rem);
    letter-spacing: -0.01em;
  }
}

/* Prefers reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .top-bar h2 {
    transition: none;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .top-bar h2 {
    color: var(--color-gray-100, #f1f5f9);
  }
}

.login-btn {
  background: white;
  color: var(--primary);
  border: none;
  padding: 0.5rem 1.2rem;
  font-size: 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
}

.login-btn:hover {
  background: var(--primary-light);
  color: white;
}

/* ==================== */
/* Ad Screen Full Viewport */
.ad-screen {
  position: relative;
  width: 100%;
  height: 100vh;        /* fallback */
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  background: linear-gradient(135deg, #f9f9f9, #e4e8f0);
  box-sizing: border-box;
  margin-top: 60px; /* top bar height */
}

.slideshow-container {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.slide {
  display: none;
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* fills container */
}

/* Slide text overlay */
.slide-text {
  position: absolute;
  bottom: 20px;
  left: 20px;
  background: rgba(0,0,0,0.5);
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  color: white;
  max-width: 90%;
}


.slide-text h3 {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
}

/* ==================== */
/* Responsive for tablets and mobile */
@media (max-width: 768px) {
  .ad-screen {
    height: calc(100dvh - 60px); /* full viewport minus top bar */
    margin-top: 60px;
  }

  .slide-text {
    bottom: 20px;
    left: 20px;
    padding: 0.6rem 0.8rem;
  }

  .slide-text h3 {
    font-size: 1.4rem;
  }
}

@media (max-width: 480px) {
  .ad-screen {
    height: calc(100dvh - 60px);
    margin-top: 60px;
  }

  .slide-text {
    bottom: 15px;
    left: 15px;
    padding: 0.5rem 0.6rem;
  }

  .slide-text h3 {
    font-size: 1.2rem;
  }
}



/* ==================== */
/* Login Overlay */
/* ==================== */
.login-screen {
  display: none; /* hidden until opened */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(0,0,0,0.6);
  justify-content: center;
  align-items: center;
  z-index: 2000;
  padding: 10px;
}

/* Login Box */
.login-box {
  position: relative;
  background: white;
  padding: 2.5rem;
  border-radius: 16px;
  width: 100%;
  max-width: 400px;
  max-height: 90vh;   /* never taller than window */
  overflow-y: auto;   /* scroll if too tall */
  box-shadow: 0 8px 20px rgba(0,0,0,0.25);
  animation: fadeIn 0.4s ease-out;
}

/* Close Button */
.close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--accent);
  cursor: pointer;
  transition: color 0.2s ease, transform 0.2s ease;
}

.close-btn:hover {
  color: var(--secondary);
  transform: scale(1.1);
}

/* ==================== */
/* Login Form Elements */
/* ==================== */
.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 0.5rem;
}

.login-subtitle {
  color: var(--gray);
  font-size: 0.9rem;
}

.input-group {
  margin-bottom: 1.2rem;
}

.input-label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 500;
  color: var(--dark);
}

.input-field {
  width: 100%;
  padding: 0.9rem;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.input-field:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--input-focus);
}

.submit-btn {
  width: 100%;
  padding: 1rem;
  background: linear-gradient(to right, var(--primary), var(--secondary));
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 1rem;
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(67, 97, 238, 0.3);
}

#error {
  color: var(--error);
  text-align: center;
  margin-top: 1rem;
  font-size: 0.9rem;
  min-height: 1.2rem;
}

/* Footer Links */
.login-footer {
  text-align: center;
  margin-top: 1.2rem;
  font-size: 0.9rem;
}

.login-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.login-link:hover {
  color: var(--secondary);
  text-decoration: underline;
}

/* ==================== */
/* Animations */
/* ==================== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==================== */
/* Responsive Design */
/* ==================== */
@media (max-width: 768px) {
  .ad-screen {
    height: 70vh; /* adjust height for mobile */
  }

  .slide-text {
    bottom: 20px;
    left: 20px;
    padding: 0.6rem 0.8rem;
  }

  .slide-text h3 {
    font-size: 1.4rem;
  }

  .login-box {
    padding: 1.5rem;
    max-height: 95vh;
  }

  .login-title {
    font-size: 1.3rem;
  }

  .input-field {
    padding: 0.7rem;
  }

  .submit-btn {
    padding: 0.8rem;
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .slide-text h3 {
    font-size: 1.2rem;
  }
  .slide-text {
    padding: 0.5rem 0.6rem;
    bottom: 15px;
    left: 15px;
  }
}
