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

body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100vh;
  zoom: 0.8;
}

body, html {
  height: 100%;
  font-family: Arial, sans-serif;
}

/* Dark mode baseline */
html[data-theme="dark"] body::before { filter: blur(8px) brightness(0.6); }
html[data-theme="dark"] .top-header { background: rgba(22, 44, 64, 0.96); box-shadow: 0 3px 10px rgba(0,0,0,0.6); }
html[data-theme="dark"] .top-site-title, html[data-theme="dark"] .header-btn { color: #FFD700; }
html[data-theme="dark"] .header-btn:hover { background: rgba(255,215,0,0.15); color: #fff; }
html[data-theme="dark"] .about-card { background: rgba(22,44,64,0.96); border-color: rgba(255,215,0,0.22); color: #e8e8e8; }
html[data-theme="dark"] .about-card p { color: #cfd5df; }
html[data-theme="dark"] .feature-item { background: rgba(255,215,0,0.09); border-left-color: #FFD700; }
html[data-theme="dark"] .audience-item { background: rgba(255,215,0,0.08); border-top-color: #FFD700; }
html[data-theme="dark"] .cta-section { background: linear-gradient(135deg, rgba(255,215,0,0.15), rgba(255,165,0,0.08)); border-color: rgba(255,215,0,0.25); }
html[data-theme="dark"] .cta-section p { color: #e8e8e8; }
html[data-theme="dark"] .login-box, html[data-theme="dark"] .signup-box { background-color: rgba(22, 44, 64, 0.96); box-shadow: 0 15px 30px rgba(0,0,0,0.6); }
html[data-theme="dark"] .login-box h2, html[data-theme="dark"] .signup-box h2 { color: #FFD700; }
html[data-theme="dark"] .title-bar { background: rgba(22,44,64,0.96); border-bottom-color: rgba(255,215,0,0.22); }
html[data-theme="dark"] .settings-container .settings-content .settings-section { background: rgba(22,44,64,0.96); border: 1px solid rgba(255,215,0,0.18); }
html[data-theme="dark"] .settings-sidebar { background: rgba(22,44,64,0.96); border: 1px solid rgba(255,215,0,0.18); }
html[data-theme="dark"] .setting-description { color: #cfd5df; }

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url("pics/books.jpg") no-repeat center center;
  background-size: cover;
  filter: blur(8px);
  z-index: -1; 
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
}

/*login*/
.login-section {
  display: flex;
  flex-direction: column;
  justify-content: flex-start; 
  align-items: center;
  min-height: 100vh;
  padding-top: 120px;
  padding-bottom: 40px;
}

/* Default login box (for login.php) */
.login-box {
  background-color: rgba(30, 61, 88, 0.95);
  border-radius: 15px;
  padding: 40px 30px; 
  width: 500px;
  max-height: 65vh; 
  overflow-y: auto; 
  text-align: center;
  box-shadow: 0 15px 30px rgba(0,0,0,0.5);
  color: #fff;
  padding-right: 20px; 
}

/* Signup-specific styling - no scrolling, wider, fits content */
.signup-box {
  background-color: rgba(30, 61, 88, 0.95);
  border-radius: 15px;
  padding: 30px 35px; 
  width: 600px;
  max-width: 90vw;
  text-align: center;
  box-shadow: 0 15px 30px rgba(0,0,0,0.5);
  color: #fff;
  /* Remove max-height and overflow for signup */
  max-height: none;
  overflow-y: visible;
}

.login-box h2, .signup-box h2 {
  margin-bottom: 20px;
  font-size: 26px;
  font-weight: 600;
  color: #FFD700;
  text-shadow: 1px 1px 4px rgba(0,0,0,0.4);
}

.login-box input[type="text"],
.login-box input[type="email"],
.login-box input[type="password"],
.signup-box input[type="text"],
.signup-box input[type="email"],
.signup-box input[type="password"] {
  width: 100%;
  padding: 10px 14px;
  margin: 6px 0;    
  border-radius: 10px;
  border: none;
  font-size: 15px;
  outline: none;
  background: rgba(255,255,255,0.9);
  color: #333;
  transition: 0.3s;
}

.login-box input[type="text"]:focus,
.login-box input[type="email"]:focus,
.login-box input[type="password"]:focus,
.signup-box input[type="text"]:focus,
.signup-box input[type="email"]:focus,
.signup-box input[type="password"]:focus {
  background: #fff;
  box-shadow: 0 0 10px #FFD700;
}

.login-box button,
.signup-box button {
  background: linear-gradient(135deg, #FFD700, #FFB700);
  color: #1E3D58;
  font-weight: bold;
  padding: 10px;
  width: 100%;
  font-size: 16px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  margin-top: 10px;
  transition: 0.4s;
}

.login-box button:hover,
.signup-box button:hover {
  background: linear-gradient(135deg, #FFB700, #FFD700);
  box-shadow: 0 0 15px #FFD700;
}

/*message*/
.message {
  display: block; 
  width: 100%;
  margin: 10px 0 0 0;  
  text-align: center; 
  color: #FFD700;
  font-size: 14px;
}

/*password*/
.password-wrapper,
.password-container {
  position: relative;
  width: 100%;
}

.password-wrapper input,
.password-container input {
  width: 100%;
  padding-right: 40px;
}

.toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  font-size: 18px;
  color: #1E3D58;
  background: transparent;
  border: none;
}

/*text*/
.redirect-text {
  margin-top: 15px; 
  font-size: 14px;
  color: #fff;
}

.redirect-text a {
  color: #FFD700; 
  text-decoration: none;
  font-weight: bold;
}

.redirect-text a:hover {
  text-decoration: underline;
}

/*header*/
.top-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 90px;
  background: rgba(30, 61, 88, 0.95);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  z-index: 1000;
  box-shadow: 0 3px 10px rgba(0,0,0,0.3);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 15px;
}

.top-logo {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
}

.top-site-title {
  font-family: 'Poppins', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: #FFD700;
  text-shadow: 1px 1px 4px rgba(0,0,0,0.4);
  margin: 0;
  padding-left: 5px;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-btn {
  text-decoration: none;
  color: #FFD700;
  font-weight: 600;
  font-size: 16px;
  padding: 8px 15px;
  border-radius: 8px;
  transition: all 0.3s ease;
  background: transparent;
}

.header-btn:hover {
  background: rgba(255, 215, 0, 0.2);
  color: #fff;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

/*title*/
.title-bar {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
}

.title-bar .logo {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  animation: none;
}

.title-bar .site-title {
  font-family: 'Poppins', sans-serif;
  font-size: 24px;
  font-weight: 600;
  color: #FFD700;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.4);
  animation: fadeIn 1.5s ease-in-out;
}

/*logout*/
.home-content {
  margin: 40px auto;
  width: 80%;
  text-align: center;
  color: #1E3D58;
}

.logout-btn {
  display: inline-block;
  margin-top: 20px;
  padding: 10px 20px;
  background-color: #3C91E6;
  color: white;
  text-decoration: none;
  border-radius: 6px;
  transition: 0.3s;
}

.logout-btn:hover {
  background-color: #2B6CA3;
}

.login-box input[type="text"],
.login-box input[type="email"],
.login-box input[type="password"],
.login-box input[type="date"],
.login-box select,
.signup-box input[type="text"],
.signup-box input[type="email"],
.signup-box input[type="password"],
.signup-box input[type="date"],
.signup-box select {
  width: 100%;
  padding: 12px 16px;
  margin: 6px 0;
  border-radius: 10px;
  border: none;
  font-size: 15px;
  outline: none;
  background: rgba(255,255,255,0.9);
  color: #333;
  transition: 0.3s;
}

.login-box input[type="date"]:focus,
.login-box select:focus,
.signup-box input[type="date"]:focus,
.signup-box select:focus {
  background: #fff;
  box-shadow: 0 0 10px #FFD700;
}

.login-box.animate-pop,
.signup-box.animate-pop {
  animation: popUp 0.8s ease-out;
}

@keyframes popUp {
  0% {
    opacity: 0;
    transform: scale(0.9);
  }
  60% {
    opacity: 1;
    transform: scale(1.05);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Clickable link-style button in label */
.terms-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  margin: 8px 0;
}

.linklike {
  background: none;
  border: none;
  color: #FFD700;
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
  padding: 0;
}

.linklike:hover { 
  text-decoration: none;
  color: #FFF3A0;
}

/* ==== IMPROVED TERMS MODAL ==== */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  inset: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(3px);
}

.modal-content {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  color: #e8e8e8;
  margin: 3% auto;
  padding: 0;
  border-radius: 16px;
  width: 90%;
  max-width: 700px;
  max-height: 90%;
  overflow: hidden;
  position: relative;
  box-shadow: 0 25px 50px rgba(0,0,0,0.5);
  border: 1px solid rgba(255, 215, 0, 0.2);
}

/* Modal Header */
.modal-header {
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  color: #1a1a2e;
  padding: 20px 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid rgba(255, 215, 0, 0.3);
}

.modal-header h1 {
  font-size: 24px;
  font-weight: 700;
  margin: 0;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

/* Close Button */
.modal-content .close-btn {
  all: unset;              
  font-size: 24px;        
  color: #1a1a2e;        
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  line-height: 1;
  font-weight: bold;
  text-align: center;
  display: inline-block;
  width: 40px;
  height: 40px;
  transition: all 0.3s ease;
}

.modal-content .close-btn:hover {
  color: #fff;
  background: rgba(0,0,0,0.2);
  transform: rotate(90deg);
}

/* Scrollable Terms Body */
.modal-body {
  max-height: 60vh;
  overflow-y: auto;
  padding: 25px;
  background: transparent;
  border: none;
  line-height: 1.6;
}

.modal-body::-webkit-scrollbar {
  width: 8px;
}

.modal-body::-webkit-scrollbar-track {
  background: rgba(255, 215, 0, 0.1);
  border-radius: 10px;
}

.modal-body::-webkit-scrollbar-thumb {
  background: rgba(255, 215, 0, 0.4);
  border-radius: 10px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 215, 0, 0.6);
}

.modal-body h2 {
  color: #FFD700;
  font-size: 20px;
  margin: 25px 0 15px 0;
  font-weight: 600;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.modal-body h3 {
  color: #FFF3A0;
  font-size: 16px;
  margin: 20px 0 10px 0;
  font-weight: 500;
}

.modal-body p {
  margin: 12px 0;
  color: #d0d0d0;
}

.modal-body ul {
  margin: 15px 0;
  padding-left: 25px;
}

.modal-body li {
  margin: 8px 0;
  color: #d0d0d0;
}

.modal-body li strong {
  color: #FFD700;
}

.modal-body a {
  color: #87CEEB;
  text-decoration: none;
}

.modal-body a:hover {
  color: #FFD700;
  text-decoration: underline;
}

/* Modal Footer */
.modal-footer {
  background: rgba(26, 26, 46, 0.8);
  padding: 20px 25px;
  border-top: 1px solid rgba(255, 215, 0, 0.2);
  display: flex;
  justify-content: center;
}

/* Agree Button */
#agreeBtn {
  background: linear-gradient(135deg, #4a6fa5 0%, #2c5282 100%);
  color: white;
  border: none;
  padding: 12px 30px;
  border-radius: 10px;
  cursor: not-allowed;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.3s ease;
  opacity: 0.5;
}

#agreeBtn.enabled {
  cursor: pointer;
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  color: #1a1a2e;
  opacity: 1;
  box-shadow: 0 5px 15px rgba(255, 215, 0, 0.4);
}

#agreeBtn.enabled:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255, 215, 0, 0.6);
}

/* Form Layout Improvements for Signup */
.signup-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 10px 0;
}

.signup-form-grid .full-width {
  grid-column: 1 / -1;
}

@media (max-width: 768px) {
  .signup-form-grid {
    grid-template-columns: 1fr;
  }
  
  .signup-box {
    width: 95%;
    padding: 25px 20px;
  }
  
  .modal-content {
    width: 95%;
    margin: 5% auto;
  }
}



/* About Page Specific Styles */
.about-section {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  min-height: 100vh;
  padding-top: 120px;
  padding-bottom: 50px;
}

.subtitle {
  color: #FFD700;
  font-size: 16px;
  font-weight: 300;
  margin-top: 5px;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.about-content {
  max-width: 1000px;
  width: 90%;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.about-card {
  background: rgba(30, 61, 88, 0.95);
  border-radius: 15px;
  padding: 30px;
  color: #fff;
  box-shadow: 0 15px 30px rgba(0,0,0,0.3);
  border: 1px solid rgba(255, 215, 0, 0.2);
  opacity: 0;
  transform: translateY(30px);
  animation-fill-mode: forwards;
}

.card-icon {
  font-size: 48px;
  text-align: center;
  margin-bottom: 15px;
}

.about-card h2 {
  color: #FFD700;
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 15px;
  text-align: center;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
}

.about-card p {
  line-height: 1.7;
  font-size: 16px;
  text-align: center;
  margin-bottom: 15px;
  color: #e8e8e8;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  padding: 15px;
  background: rgba(255, 215, 0, 0.1);
  border-radius: 10px;
  border-left: 4px solid #FFD700;
}

.feature-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.feature-item strong {
  color: #FFD700;
  display: block;
  margin-bottom: 5px;
}

.feature-item p {
  margin: 0;
  font-size: 14px;
  text-align: left;
  color: #d0d0d0;
}

.audience-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.audience-item {
  background: rgba(255, 215, 0, 0.1);
  padding: 20px;
  border-radius: 10px;
  border-top: 3px solid #FFD700;
}

.audience-item h3 {
  color: #FFD700;
  margin-bottom: 10px;
  font-size: 18px;
}

.audience-item p {
  text-align: left;
  margin: 0;
  font-size: 15px;
  color: #e0e0e0;
}

.tech-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 20px;
}

.tech-badge {
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #1E3D58;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  text-shadow: none;
}

.cta-section {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 165, 0, 0.1));
  border: 2px solid rgba(255, 215, 0, 0.3);
  border-radius: 15px;
  padding: 40px;
  text-align: center;
  margin-top: 20px;
}

.cta-section h2 {
  color: #FFD700;
  font-size: 28px;
  margin-bottom: 15px;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
}

.cta-section p {
  font-size: 18px;
  margin-bottom: 25px;
  color: #fff;
}

.cta-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

.cta-btn {
  padding: 12px 30px;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  transition: all 0.3s ease;
  display: inline-block;
}

.cta-btn.primary {
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #1E3D58;
  box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
}

.cta-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255, 215, 0, 0.5);
}

.cta-btn.secondary {
  background: transparent;
  color: #FFD700;
  border: 2px solid #FFD700;
}

.cta-btn.secondary:hover {
  background: rgba(255, 215, 0, 0.1);
  transform: translateY(-2px);
}

/* Animations */
@keyframes fadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeIn 0.8s ease-out forwards;
}

/* Responsive Design */
@media (max-width: 768px) {
  .about-content {
    width: 95%;
  }
  
  .about-card {
    padding: 20px;
  }
  
  .feature-grid {
    grid-template-columns: 1fr;
  }
  
  .audience-grid {
    grid-template-columns: 1fr;
  }
  
  .cta-buttons {
    flex-direction: column;
    align-items: center;
  }
  
  .cta-btn {
    width: 100%;
    max-width: 300px;
  }
}