/* ---------- Global ---------- */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  font-family: 'Poppins', sans-serif;
  color: #fff;
  overflow-x: hidden;
}

body {
  background: url('/images/bg.jpg') center center / cover no-repeat fixed;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  min-height: 100vh;
  animation: fadeIn 1.5s ease-in-out;
}

/* ---------- Header ---------- */
header {
  font-size: 2.2rem;
  font-weight: 600;
  margin-top: 1.5rem;
  text-shadow: 0 3px 10px rgba(0,0,0,0.5);
}

/* ---------- Categories ---------- */
#categories {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
  padding: 2rem;
  width: 100%;
  max-width: 1200px;
}

.category-btn {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: none;
  color: white;
  font-size: 1.1rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
  transition: all 0.3s ease;
}

.category-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.5);
}

.category-title {
  font-weight: 600;
  margin-bottom: 0.3rem;
}

/* ---------- Brave Button ---------- */
#brave-container {
  margin-bottom: 2rem;
}

#brave-btn {
  width: 360px;
  height: 90px;
  border-radius: 45px;
  border: none;
  background: linear-gradient(135deg, #ff0055, #ff6600);
  color: #fff;
  font-size: 1.4rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
  transition: all 0.3s ease;
  animation: pulse 2.5s infinite;
}

#brave-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.5);
}

/* ---------- Result Modal ---------- */
#result-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
}

#result-content {
  background: rgba(30,30,30,0.95);
  padding: 2rem 3rem;
  border-radius: 1rem;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
  text-align: center;
  animation: popIn 0.4s ease-out;
}

#result-close {
  margin-top: 1.5rem;
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 0.4rem;
  background: #444;
  color: #fff;
  cursor: pointer;
  transition: background 0.3s ease;
}

#result-close:hover {
  background: #666;
}

/* ---------- Spinner ---------- */
.spinner {
  margin: 1rem auto;
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255,255,255,0.3);
  border-top: 4px solid #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* ---------- Login Overlay ---------- */
.overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.login-box {
  background: rgba(30,30,30,0.95);
  padding: 2rem;
  border-radius: 1rem;
  text-align: center;
  box-shadow: 0 5px 25px rgba(0,0,0,0.5);
  animation: popIn 0.4s ease-out;
}

.login-box input {
  width: 80%;
  padding: 0.6rem;
  margin: 1rem 0;
  border: none;
  border-radius: 0.4rem;
  text-align: center;
  font-size: 1rem;
}

.login-box button {
  padding: 0.6rem 1.4rem;
  border: none;
  border-radius: 0.4rem;
  background: linear-gradient(135deg, #0077ff, #00ffaa);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.login-box button:hover {
  transform: scale(1.05);
}

.modal {
  transition: opacity 0.4s ease, visibility 0.4s ease;
  opacity: 0;
  visibility: hidden;
}

.modal:not(.hidden) {
  opacity: 1;
  visibility: visible;
}

.error {
  color: #ff5555;
  margin-top: 0.5rem;
}

/* ---------- Utilities ---------- */
.hidden { display: none; }

/* ---------- Animations ---------- */
@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

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

@keyframes pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 8px 25px rgba(0,0,0,0.4); }
  50% { transform: scale(1.05); box-shadow: 0 12px 35px rgba(0,0,0,0.5); }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  header { font-size: 1.6rem; }
  .category-btn {
    width: 120px;
    height: 120px;
    font-size: 1rem;
  }
  #brave-btn {
    width: 200px;
    height: 70px;
    font-size: 1.1rem;
  }
}
