/* ==========================
   DARK THEME GRID LAYOUT
   ========================== */

:root {
  --nav-height: 60px;
  --footer-height: 40px;
  --sidebar-width: 70px;
  --bg-dark: #0f0f0f;
  --bg-panel: #1c1c1c;
  --text-light: #f2f2f2;
  --text-muted: #aaaaaa;
  --accent: #47b8ff;
}

/* ===== BASE ===== */
* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg-dark);
  color: var(--text-light);
  font-family: system-ui, sans-serif;
}

body {
  display: grid;
  grid-template-rows: var(--nav-height) 1fr var(--footer-height);
  grid-template-columns: 100%;
  height: 100vh;
}

/* ===== TOP NAVBAR ===== */
.navbar {
  grid-row: 1;
  background: var(--bg-panel);
  color: var(--text-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid #222;
}

.nav-logo {
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 1rem;
}

.nav-links a {
  color: var(--text-light);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: var(--accent);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-light);
  cursor: pointer;
}

/* ===== LAYOUT GRID (SIDEBAR + CONTENT) ===== */
.layout-grid {
  grid-row: 2;
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100%;
}

/* ===== SIDE NAVBAR ===== */
.side-nav {
  background: #111;
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem 0;
  border-right: 1px solid #222;
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
}

.side-nav .icon-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 1.4rem;
  transition: color 0.2s ease, transform 0.2s ease;
  position: relative;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
}

.side-nav .icon-link:hover {
  color: var(--accent);
  transform: scale(1.15);
}

.side-nav .admin-link {
  margin-top: auto;
  color: #ff6b6b;
  position: relative;
}

.side-nav .admin-link::before {
  content: '';
  position: absolute;
  top: -0.75rem;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #444, transparent);
}

.side-nav .admin-link:hover {
  color: #ff8787;
}

/* Tooltip hover text */
.side-nav .icon-link::after {
  content: attr(title);
  position: absolute;
  left: 150%;
  top: 50%;
  transform: translateY(-50%);
  background: #222;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  opacity: 0;
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 0.2s ease;
  font-size: 0.85rem;
  z-index: 10;
}

.side-nav .icon-link:hover::after {
  opacity: 1;
}

/* Notification Badge */
.icon-link--with-badge {
  position: relative;
}

.notification-badge {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  background: #ff3b3b;
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  z-index: 10;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.9;
  }
}

/* ==========================
   LOGIN MODAL (overlay)
   ========================== */

/* Overlay covers entire viewport above everything */
.login-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(4px);
  z-index: 4000;
}

/* Shown state */
.login-modal.open {
  display: flex;
}

/* The floating panel (desktop) */
.login-modal__panel {
  background: var(--bg-panel, #1c1c1c);
  color: var(--text-light, #f2f2f2);
  border: 1px solid #2a2a2a;
  border-radius: 14px;
  width: min(92vw, 480px);
  max-height: 90vh;
  overflow: auto;
  padding: 1.75rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  position: relative;
}

/* Close button */
.login-modal__close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: transparent;
  border: 0;
  color: inherit;
  font-size: 1.25rem;
  cursor: pointer;
}

/* Title & form */
.login-modal__title {
  margin: 0 0 1rem 0;
  text-align: center;
}

.login-modal__form {
  display: grid;
  gap: 0.9rem;
}

.login-modal__form label {
  font-size: 0.95rem;
  color: var(--text-muted, #aaa);
}

.login-modal__form input {
  background: #101010;
  border: 1px solid #333;
  color: var(--text-light, #f2f2f2);
  padding: 0.6rem 0.7rem;
  border-radius: 8px;
}

.login-modal__submit {
  margin-top: 0.5rem;
  width: 100%;
  background: var(--accent, #47b8ff);
  border: 0;
  color: #fff;
  padding: 0.75rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}
.login-modal__submit:hover { filter: brightness(1.06); }

/* Prevent body scroll when modal is open */
body.has-modal { overflow: hidden; }

/* MOBILE: make the panel full-screen */
@media (max-width: 768px) {
  .login-modal__panel {
    width: 100vw;
    height: 100vh;
    max-height: none;
    border-radius: 0;
    padding: 2rem 1.25rem;
    border-left: 0;
    border-right: 0;
  }
}

/* ===== LOGIN MODAL SOCIAL SECTION ===== */

.login-modal__divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1.75rem 0;
  color: var(--text-muted, #aaa);
  font-size: 0.9rem;
  white-space: nowrap;
  gap: 0.75rem;
}

.login-modal__divider::before,
.login-modal__divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #333;
}


.social-login-group {
  display: grid;
  gap: 0.75rem;
}

.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: #2a2a2a;
  color: var(--text-light, #f2f2f2);
  border: 1px solid #333;
  border-radius: 8px;
  padding: 0.7rem 1rem;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: background 0.2s ease, transform 0.15s ease;
  width: 100%;
}

.social-btn:hover,
.social-btn:focus-visible {
  background: #333;
  transform: translateY(-1px);
  outline: 2px solid var(--accent, #47b8ff);
  outline-offset: 2px;
}

/* Provider colors (contrast-safe variants) */
.social-btn--google {
  background: #fff;
  color: #222;
  border: 1px solid #ccc;
}
.social-btn--google:hover { background: #f2f2f2; }

.social-btn--discord {
  background: #5865F2;
  color: #fff;
}
.social-btn--discord:hover { background: #4752c4; }

.social-btn--github {
  background: #24292f;
  color: #fff;
}
.social-btn--github:hover { background: #161b22; }

.social-btn--facebook {
  background: #1877f2;
  color: #fff;
}
.social-btn--facebook:hover { background: #145cc2; }

.social-btn--twitter {
  background: #000;
  color: #fff;
}
.social-btn--twitter:hover { background: #222; }

/* Icon scaling */
.social-icon {
  font-size: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Mobile full-width buttons */
@media (max-width: 768px) {
  .social-btn {
    font-size: 1.05rem;
    padding: 1rem;
  }
}



/* ===== MAIN GRID CONTENT ===== */
main {
  background: var(--bg-dark);
  padding: 2rem;
  overflow-y: auto;
}

.my-form {
  background: var(--bg-panel);
  border: 1px solid #222;
  border-radius: 10px;
  padding: 2rem;
  max-width: 600px;
  margin: auto;
  box-shadow: 0 0 10px rgba(0,0,0,0.4);
}

/* ===== FOOTER ===== */
footer {
  grid-row: 3;
  background: var(--bg-panel);
  color: var(--text-muted);
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  height: var(--footer-height);
  border-top: 1px solid #222;
}

/* ==========================
   FULLSCREEN MOBILE MENU
   ========================== */

.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(4px);
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.mobile-overlay.open {
  display: flex;
}

.mobile-menu {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
}

.mobile-menu a {
  color: var(--text-light);
  text-decoration: none;
  font-size: 1.4rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.mobile-menu a:hover {
  color: var(--accent);
}

.close-menu {
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 2rem;
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  cursor: pointer;
}

/* ==========================
   RESPONSIVE BEHAVIOR
   ========================== */

@media (max-width: 768px) {
  .nav-toggle {
    display: inline-block;
  }

  .nav-links {
    display: none;
  }

  .side-nav {
    display: none;
  }

  .layout-grid {
    grid-template-columns: 1fr;
  }
}