:root {
  --bg: #1c2535;
  --panel: #0b1220;
  --muted: #9aa7b2;
  --accent: #4f46e5;
  --radius: 12px;
  font-family: imAVariable, Inter, sans-serif;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
  margin: 0;
}

body {
  background: radial-gradient(
      circle at 20% 30%,
      rgba(79, 70, 229, 0.25),
      transparent 40%
    ),
    radial-gradient(circle at 80% 70%, rgba(6, 182, 212, 0.25), transparent 40%),
    #0a0f1a;
  background-attachment: fixed;
  background-size: cover;
  color: #e6eef6;
  display: flex;
  justify-content: center;
  align-items: stretch;
  padding: 28px;
  min-height: 100vh;
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: absolute;
  top: -100px;
  left: -100px;
  right: -100px;
  bottom: -100px;
  background: radial-gradient(
      circle at 25% 25%,
      rgba(79, 70, 229, 0.2),
      transparent 60%
    ),
    radial-gradient(circle at 75% 75%, rgba(6, 182, 212, 0.15), transparent 60%);
  filter: blur(100px);
  z-index: 0;
  animation: bgMove 15s ease-in-out infinite alternate;
}

@keyframes bgMove {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(-40px, 40px);
  }
}

.shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 260px 1fr;
  width: 100%;
  max-width: 1200px;
  background: var(--panel);
  border-radius: var(--radius);
  overflow: clip;
}

nav.left {
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  background: var(--panel);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.logo {
  width: 55px;
  margin: 0 auto 20px;
}

.logo img {
  width: 100%;
  height: auto;
}

.navigationTop,
.navigationBottom {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.navigationItem {
  color: var(--muted);
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 10px;
}

.navigationItem:hover {
  background: rgba(255, 255, 255, 0.05);
  color: white;
}

.spacer {
  flex: 1;
}

.main {
  display: flex;
  flex-direction: column;
  background: #0d1625;
  overflow-y: auto;
  overflow-x: hidden;
}

button {
  background: linear-gradient(90deg, #4f46e5, #06b6d4);
  color: white;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  cursor: pointer;
  transition: 0.2s ease-in-out;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

button:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.4);
}

header.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 25px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.pageTitle {
  display: flex;
  gap: 20px;
}

.navigationLinks a:hover {
  color: white;
}

.account {
  text-align: right;
}

.account #name {
  font-weight: 700;
  color: white;
}

.account #email {
  font-size: 13px;
  color: var(--muted);
}

/* ========== RESPONSIVE DESIGN ========== */

/* Tablets */
@media (max-width: 992px) {
  body {
    padding: 16px;
  }

  .shell {
    grid-template-columns: 220px 1fr;
    max-width: 100%;
  }

  .account {
    text-align: left;
  }

  section {
    padding: 20px !important;
  }
}

/* Phones */
@media (max-width: 768px) {
  .shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    border-radius: 0;
    height: auto;
  }

  nav.left {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 12px;
    overflow-x: auto;
    gap: 10px;
  }

  .logo {
    width: 40px;
    margin: 0;
  }

  .navigationTop,
  .navigationBottom {
    flex-direction: row;
    gap: 10px;
  }

  .navigationItem,
  button.button {
    font-size: 14px;
    padding: 8px 10px;
    white-space: nowrap;
  }

  header.top {
    padding: 16px;
    flex-direction: column;
    align-items: flex-start;
  }

  .account {
    width: 100%;
    text-align: left;
    margin-top: 10px;
  }

  section {
    padding: 16px !important;
  }
}

/* Very small screens */
@media (max-width: 480px) {
  h1 {
    font-size: 20px;
  }

  .pageTitle h3 {
    font-size: 16px;
  }

  .navigationItem,
  .button {
    font-size: 13px;
  }

  body {
    padding: 10px;
  }
}

/* ========== MESSAGE ========== */

.message {
  text-align: center;
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 10px;
  font-weight: 600;
  animation: fadeIn 0.3s ease;
}

.message.success {
  background: rgba(46, 204, 113, 0.12);
  color: #2ecc71;
  border: 1px solid rgba(46, 204, 113, 0.2);
}

.message.error {
  background: rgba(231, 76, 60, 0.12);
  color: #e74c3c;
  border: 1px solid rgba(231, 76, 60, 0.2);
}

/* ========== LOADING OVERLAY ========== */

#loadingOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 15, 26, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

#loadingOverlay.active {
  opacity: 1;
  pointer-events: all;
}

.loadingSpinner {
  width: 55px;
  height: 55px;
  border: 4px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spinnerRotate 0.8s linear infinite;
}

@keyframes spinnerRotate {
  from {
    transform: rotate(0);
  }
  to {
    transform: rotate(360deg);
  }
}
