/* ==========================================================================
   Base Styles - Core styles used across all pages
   ========================================================================== */

/* CSS Variables */
:root {
  --bg: #0b1220;
  --text: #e5e7eb;
  --brand: #0ea5e9;
  --brand-2: #38bdf8;
  --muted: #94a3b8;
  --card: #111827ee;
  --radius: 12px;
  --nav-h: 60px;
}


/* Reset & Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

body {
  font-family: Inter, system-ui, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, var(--bg), #0f172a 40%, var(--bg));
  padding-top: var(--nav-h);
  overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
}

p {
  line-height: 1.6;
}

/* Container */
.container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 20px;
}

/* Common Page Elements */
.page-title {
  font-size: clamp(28px, 5vw, 36px);
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.online-badge {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: white;
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

/* Button Components */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border-radius: var(--radius);
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: transform 0.2s, box-shadow 0.2s;
  min-height: 44px;
  cursor: pointer;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(14, 165, 233, 0.3);
}

.btn.primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: white;
  font-size: 18px;
  padding: 16px 32px;
  font-weight: 600;
  border: none;
}

.btn.primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(14, 165, 233, 0.4);
}

.btn.secondary {
  background: transparent;
  color: var(--text);
  border: 2px solid rgba(255, 255, 255, 0.2);
  font-size: 18px;
  padding: 14px 32px;
  font-weight: 600;
}

.btn.secondary:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: rgba(14, 165, 233, 0.1);
}


/* Navigation Styles */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(17, 24, 39, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 24px;
  height: var(--nav-h);
}

.nav-brand a {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 700;
  color: var(--brand);
  text-decoration: none;
  text-shadow: 0 0 8px rgba(14, 165, 233, 0.5);
}

.nav-logo {
  height: 40px;
  width: 40px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(14, 165, 233, 0.5));
}

.nav-status {
  display: flex;
  align-items: center;
}

.status-dot {
  width: 10px;
  height: 10px;
  background: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
  animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
  0%, 100% {
    opacity: 1;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
  }
  50% {
    opacity: 0.7;
    box-shadow: 0 0 4px rgba(34, 197, 94, 0.4);
  }
}

.status-dot.offline {
  background: #ef4444;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
  animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
  0%, 100% {
    opacity: 1;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
  }
  50% {
    opacity: 0.7;
    box-shadow: 0 0 4px rgba(239, 68, 68, 0.4);
  }
}

.nav-links {
  display: flex;
  gap: 24px;
  align-items: center;
  justify-self: end;
}

.nav-link {
  color: var(--text);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 6px;
  transition: all 0.2s;
  font-weight: 500;
}

.nav-link:hover {
  color: var(--brand);
  background: rgba(14, 165, 233, 0.1);
}

.nav-link.login {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.nav-link.login:hover {
  color: var(--brand);
  background: rgba(14, 165, 233, 0.1);
  border-color: var(--brand);
}

.nav-link.logout {
  color: var(--muted);
}

.nav-link.admin {
  background: linear-gradient(135deg, #dc2626, #ef4444);
  color: white;
  font-weight: 600;
}

.nav-link.admin:hover {
  background: linear-gradient(135deg, #ef4444, #f87171);
  color: white;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  width: 20px;
  height: 2px;
  background: var(--text);
  margin: 2px 0;
  transition: 0.3s;
}

/* Footer */
footer {
  margin-top: auto;
  padding: 40px 0;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  background: rgba(17, 24, 39, 0.3);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

footer a {
  color: var(--brand);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* Responsive - Mobile Navigation */
@media (max-width: 768px) {
  .nav-container {
    grid-template-columns: auto 1fr auto auto;
    gap: 12px;
  }

  .nav-links {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: rgba(17, 24, 39, 0.98);
    backdrop-filter: blur(10px);
    flex-direction: column;
    padding: 20px;
    gap: 16px;
    transform: translateY(-100vh);
    transition: transform 0.3s;
    grid-column: 1 / -1;
  }

  .nav-links.active {
    transform: translateY(0);
  }

  .nav-toggle {
    display: flex;
  }

  .nav-link {
    width: 100%;
    text-align: center;
    padding: 12px;
  }
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #475569;
  transition: 0.3s;
  border-radius: 24px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(26px);
}

/* Responsive - Mobile Base */
@media (max-width: 600px) {
  .container {
    padding: 0 16px;
  }

  .nav-container {
    padding: 0 16px;
  }

  .btn {
    width: 100%;
    max-width: 280px;
  }
}