:root {
  --bg: #0a0a0a;
  --text: #e0e0e0;
  --accent: #c41e3a;
  --accent-dark: #8b1428;
  --card: #111;
  --border: #222;
  --input-bg: #1a1a1a;
  --muted: #999;
}

[data-theme="dark"] {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, sans-serif;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

header {
  background: #000;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--accent-dark);
}

.logo h1 {
  margin: 0;
  font-size: 2.2rem;
  color: var(--accent);
  letter-spacing: 2px;
}

.logo h2 {
  margin: 0;
  font-size: 1.1rem;
  color: #777;
}

.user-panel {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.display-name {
  font-weight: bold;
  color: var(--accent);
}

.btn, .admin-btn, .logout-btn, .login-btn {
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: white;
  text-decoration: none;
  border-radius: 4px;
  font-weight: 600;
  border: none;
  cursor: pointer;
}

.btn:hover, .admin-btn:hover {
  background: var(--accent-dark);
}

main {
  padding: 2rem;
  max-width: 1100px;
  margin: 0 auto;
}

.apps {
  background: var(--card);
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid #222;
}

.apps h3 {
  color: var(--accent);
  margin-top: 0;
}

.app-list {
  list-style: none;
  padding: 0;
}

.app-list a {
  color: #ff9999;
  text-decoration: none;
}

.app-list a:hover {
  color: #ffcccc;
  text-decoration: underline;
}

/* ────────────────────────────────────────────────
   Improved DROPDOWN / SELECT styling
───────────────────────────────────────────────── */
select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background: var(--input-bg) url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3e%3cpolygon points='0,0 12,0 6,12' fill='%23c41e3a'/%3e%3c/svg%3e") no-repeat right 1rem center;
  background-size: 12px;
  padding: 0.9rem 2.5rem 0.9rem 1rem;
  border: 1px solid #444;
  border-radius: 6px;
  color: var(--text);
  font-size: 1rem;
  width: 100%;
  box-sizing: border-box;
  cursor: pointer;
}

select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.25);
}

select option {
  background: #000;
  color: var(--text);
}

/* Hide default arrow in some browsers and rely on custom one */
select::-ms-expand {
  display: none;
}

/* ────────────────────────────────────────────────
   General form inputs
───────────────────────────────────────────────── */
input[type="text"],
input[type="url"],
input[type="password"],
textarea {
  display: block;
  width: 100%;
  padding: 0.9rem 1rem;
  margin: 0.6rem 0 1.2rem 0;
  border: 1px solid #444;
  border-radius: 6px;
  background: var(--input-bg);
  color: white;
  font-size: 1rem;
  box-sizing: border-box;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.25);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

button {
  background: var(--accent);
  border: none;
  color: white;
  padding: 0.8rem 1.5rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
}

button:hover {
  background: var(--accent-dark);
}

/* ────────────────────────────────────────────────
   Admin specific
───────────────────────────────────────────────── */
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.8rem;
  padding: 1rem;
}

.admin-buttons-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1.2rem 0;
}

.admin-buttons-row .btn {
  flex: 1 1 200px;
  text-align: center;
}

.form-box .buttons-row {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.form-box .btn-danger {
  background: #8b1428;
  border: 1px solid #6b0f1e;
}

.form-box .btn-danger:hover {
  background: #a51a32;
}

.muted {
  color: var(--muted);
  font-size: 0.92rem;
}

/* Carousel */
.forge-carousel {
  margin: 3rem 0;
  background: var(--card);
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid #222;
}

.carousel-container {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  overflow: hidden;
}

.carousel-inner {
  display: flex;
  transition: transform 0.5s ease;
}

.carousel-slide {
  flex: 0 0 100%;
  display: none;
  text-align: center;
}

.carousel-slide.active {
  display: block;
}

.carousel-slide img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.6);
  margin-bottom: 1rem;
}

.carousel-caption h4 {
  color: var(--accent);
  margin: 0.5rem 0;
}

.carousel-prev, .carousel-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.6);
  color: white;
  border: none;
  padding: 1rem;
  cursor: pointer;
  font-size: 2rem;
  border-radius: 50%;
  width: 50px;
  height: 50px;
}

.carousel-prev { left: 10px; }
.carousel-next { right: 10px; }

.carousel-dots {
  text-align: center;
  margin-top: 1rem;
}

.dot {
  height: 12px;
  width: 12px;
  margin: 0 6px;
  background: #555;
  border-radius: 50%;
  display: inline-block;
  cursor: pointer;
}

.dot.active {
  background: var(--accent);
}

/* Responsive */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  .form-box .buttons-row {
    flex-direction: column;
  }
  .form-box .btn,
  .form-box .btn-danger {
    width: 100%;
  }
}

#musicControls {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: rgba(0,0,0,0.78);
  backdrop-filter: blur(8px);
  padding: 12px 24px;
  border-radius: 50px;
  color: white;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.65);
  max-width: 90vw;
  min-width: 320px;
  flex-wrap: nowrap;
}

.player-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

#playPauseBtn,
#prevBtn,
#nextBtn {
  background: var(--accent);
  border: none;
  color: white;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.18s ease;
  flex-shrink: 0;
}

#playPauseBtn:hover,
#prevBtn:hover,
#nextBtn:hover {
  background: var(--accent-dark);
  transform: scale(1.1);
}

.track-info {
  flex: 1;
  text-align: center;
  min-width: 0; /* allows ellipsis */
}

#currentTrackTitle {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  max-width: 100%;
}

.volume-container {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.volume-label {
  font-size: 0.9rem;
  color: #ccc;
  min-width: 28px;
}

#volumeSlider {
  width: 100px;
  height: 8px;
  background: #333;
  border-radius: 4px;
  outline: none;
  appearance: none;
  cursor: pointer;
}

#volumeSlider:hover {
  background: #444;
}

#volumeSlider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 0 8px rgba(196,30,58,0.6);
}

#volumeSlider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 0 8px rgba(196,30,58,0.6);
}

/* Mobile adjustments */
@media (max-width: 600px) {
  #musicControls {
    padding: 10px 16px;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .player-main {
    order: 1;
    width: 100%;
    justify-content: center;
  }

  .track-info {
    order: 3;
    width: 100%;
    text-align: center;
    margin-top: 4px;
  }

  .volume-container {
    order: 2;
  }

  #volumeSlider {
    width: 90px;
  }
}
/* ====================== APP BUTTONS = SAME SIZE AS LOGIN BUTTON ====================== */
.app-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.9rem;
  margin-top: 1.4rem;
}

.app-btn {
  padding: 0.5rem 1rem;           /* EXACT same as .login-btn / .admin-btn */
  background: var(--accent);
  color: white;
  text-align: center;
  text-decoration: none;
  border-radius: 4px;             /* exact same radius */
  font-weight: 600;
  font-size: 1rem;                /* exact same font size */
  border: none;
  box-shadow: 0 4px 10px rgba(0,0,0,0.35);
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: auto;               /* no forced height */
  line-height: 1.4;
}

.app-btn:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(196, 30, 58, 0.45);
}

.app-btn.admin-only-btn {
  background: #8b1428;
  border: 2px dashed var(--accent);
}

.app-btn.admin-only-btn:hover {
  background: #a51a32;
}

/* Responsive grid */
@media (max-width: 1300px) { .app-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 980px)  { .app-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px)  { .app-grid { grid-template-columns: repeat(2, 1fr); } }

/* Hidden apps title */
.section-title {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  font-size: 1.05rem;
  margin: 1.6rem 0 1rem;
  padding-top: 1rem;
  border-top: 1px dashed #333;
}


/* ====================== UNIFIED BUTTONS - Logout = same as Login/Admin/App ====================== */
.btn, 
.login-btn, 
.admin-btn, 
.logout-btn, 
.app-btn {
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: white;
  text-decoration: none;
  border-radius: 4px;
  font-weight: 600;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(0,0,0,0.35);
}

.btn:hover, 
.login-btn:hover, 
.admin-btn:hover, 
.logout-btn:hover, 
.app-btn:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(196, 30, 58, 0.45);
}

/* Hidden apps get slightly different look */
.app-btn.admin-only-btn {
  background: #8b1428;
  border: 2px dashed var(--accent);
}

.app-btn.admin-only-btn:hover {
  background: #a51a32;
}