:root {
  --bg-main: #000000;
  --bg-surface: #0a0a0c;
  --bg-card: #121216;
  --border-color: #1f1f26;
  --text-main: #e2e8f0;
  --text-muted: #94a3b8;
  --accent-cyan: #00f2fe;
  --accent-purple: #7928ca;
  --accent-gold: #ffb703;
}

* { 
  box-sizing: border-box; 
  margin: 0; 
  padding: 0; 
}

html {
  margin: 0 !important;
  padding: 0 !important;
}

/* --- GLOBAL FORM INPUTS & FILE PICKERS --- */
input[type="file"] {
  display: block;
  width: 100%;
  padding: 10px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-main);
  font-size: 0.9rem;
  cursor: pointer;
  margin-top: 5px;
  margin-bottom: 10px;
}

input[type="file"]::file-selector-button {
  background-color: var(--accent-cyan);
  color: #000;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  margin-right: 10px;
  transition: opacity 0.2s;
}

input[type="file"]::file-selector-button:hover {
  opacity: 0.85;
}

/* --- MEMBERS PAGE STYLING --- */
.members-title {
  margin-bottom: 1.5rem;
  color: var(--text-main);
}

.members-loading-text,
.members-empty-text {
  color: var(--text-muted);
}

.member-card-inner {
  cursor: pointer;
  text-align: center;
}

.member-discord-text {
  font-size: 0.8rem;
  color: #5865F2;
  margin-top: 5px;
}

.member-collection-wrapper {
  margin-top: 12px;
}

.member-collection-btn {
  background: #2b6cb0;
  color: white;
  text-decoration: none;
  padding: 5px 10px;
  display: inline-block;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: bold;
}

.member-collection-btn:hover {
  background: #3182ce;
}

/* --- PROFILE PAGE STYLING --- */
.profile-card {
  text-align: center;
  margin-bottom: 25px;
  padding: 25px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.profile-avatar-lg {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent-cyan);
  margin-bottom: 15px;
}

.profile-section-box {
  background-color: var(--bg-surface);
  padding: 15px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  text-align: left;
  margin-top: 15px;
}

.profile-label {
  display: block;
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: bold;
  margin-bottom: 8px;
}

.profile-input-group {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.profile-file-input {
  font-size: 0.85rem;
  color: var(--text-muted);
  flex: 1;
  min-width: 200px;
}

.profile-btn-primary {
  background-color: var(--accent-cyan);
  color: #000;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  transition: opacity 0.2s;
}

.profile-btn-primary:hover {
  opacity: 0.9;
}

.profile-btn-secondary {
  background-color: #2b6cb0;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  transition: opacity 0.2s;
}

.profile-btn-secondary:hover {
  opacity: 0.9;
}

.profile-status-text {
  margin-top: 15px;
  font-size: 0.9rem;
}

body {
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  font-size: 16px;
  background-color: #0b0b0b;
  color: #e0e0e0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Header Title Bar Structure */
.title-bar {
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  padding: 0 2rem 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 65px;
  position: relative;
  margin: 0 !important;
  top: 0 !important;
}

.brand-logo-container {
  position: absolute;
  left: 1rem;
  display: flex;
  align-items: center;
  height: 100%;
  min-width: 200px;
}

.brand-logo-img {
  height: 100%;
  width: auto;
  object-fit: contain;
  display: block;
}

.nav-title-container {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
}

.nav-title-img {
  max-height: 48px;
  width: auto;
  object-fit: contain;
}

/* Main Layout Structure */
.layout-container {
  display: flex;
  flex: 1;
}

/* Left Sidebar Navigation */
.sidebar {
  width: 240px;
  background-color: var(--bg-surface);
  border-right: 1px solid var(--border-color);
  padding: 1.5rem 1rem;
}

.sidebar-menu { list-style: none; }
.sidebar-menu li { margin-bottom: 0.5rem; }

.sidebar-menu a {
  display: block;
  padding: 0.6rem 1rem;
  color: var(--text-main);
  text-decoration: none;
  border-radius: 6px;
  transition: background 0.2s;
}

.sidebar-menu a:hover, .sidebar-menu a.active {
  background-color: var(--bg-card);
  border-left: 3px solid var(--accent-cyan);
}

/* Unified Page Containers */
.page-container {
  width: 100%;
  max-width: 1400px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 auto;
}

.profile-container { width: 100%; max-width: 700px; }
.admin-container { width: 100%; max-width: 900px; }
.members-container { width: 100%; max-width: 1100px; }
.news-wrapper { width: 100%; max-width: 800px; }

/* Content Area */
.content-area {
  flex: 1;
  padding: 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Cards Grid */
.cards-grid {
  width: 100%;
  max-width: 1100px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  transition: transform 0.2s, border-color 0.2s;
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-cyan);
}

.card-clickable {
  cursor: pointer;
  text-align: center;
}

.card-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
  color: white;
  font-size: 0.75rem;
  font-weight: bold;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  margin-bottom: 0.75rem;
}

/* Avatars */
.avatar-lg {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent-cyan);
  margin-bottom: 15px;
}

.avatar-xl {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent-cyan);
  margin-bottom: 15px;
}

.avatar-md {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent-cyan);
  margin-bottom: 10px;
}

/* Home Hero Section */
.home-hero {
  display: flex;
  align-items: flex-start;
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto;
}

.warren-img {
  max-width: 400px;
  height: auto;
  border-radius: 8px;
}

.welcome-text { flex: 1; }
.welcome-text h1 { margin-top: 0; }

@media (max-width: 768px) {
  .home-hero { flex-direction: column; align-items: center; }
  .warren-img { max-width: 100%; }
}

/* News Components */
.admin-action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  background: #222;
  padding: 12px 20px;
  border-radius: 6px;
  border: 1px solid #444;
}

.admin-action-text { color: #4CAF50; font-weight: bold; }
.btn-success { background: #28a745; color: white; border: none; padding: 8px 16px; border-radius: 4px; cursor: pointer; font-weight: bold; }

.news-categories {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 30px;
}

.cat-btn {
  background: #333;
  color: #fff;
  border: none;
  padding: 8px 16px;
  cursor: pointer;
  border-radius: 4px;
  font-weight: bold;
}

.cat-btn.active { background: #007bff; color: #fff; }

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

.modal-content-box {
  background: #1e1e1e;
  padding: 30px;
  border-radius: 8px;
  width: 100%;
  max-width: 600px;
  border: 1px solid #444;
  color: #fff;
}

.modal-header { margin-top: 0; }
.form-group { margin-bottom: 15px; }
.form-label { display: block; margin-bottom: 5px; font-weight: bold; }
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 8px;
  background: #2a2a2a;
  border: 1px solid #444;
  color: #fff;
  border-radius: 4px;
}
.form-textarea { font-family: inherit; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }
.btn-cancel { background: #444; color: #fff; border: none; padding: 8px 16px; border-radius: 4px; cursor: pointer; }
.btn-save { background: #007bff; color: #fff; border: none; padding: 8px 16px; border-radius: 4px; cursor: pointer; font-weight: bold; }

/* Right-Hand Side Discord Drawer */
.discord-sidebar-right {
  position: fixed;
  top: 65px;
  bottom: 0;
  right: -300px;
  width: 300px;
  transition: right 0.3s ease;
  z-index: 9998;
  background: #050505;
  border-left: 1px solid var(--border-color);
}

.discord-sidebar-right:hover { right: 0; }

.discord-sidebar-tab {
  position: absolute;
  left: -40px;
  top: 80px;
  width: 40px;
  height: 60px;
  background: #050505;
  border: 1px solid var(--border-color);
  border-right: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 5px 0 0 5px;
}

.discord-sidebar-tab img { width: 24px; height: 24px; }

/* --- AUTHENTICATION MODAL STYLING --- */
.auth-modal {
  display: none !important;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  align-items: center;
  justify-content: center;
}

.auth-modal-content {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 2.5rem;
  width: 100%;
  max-width: 380px;
  position: relative;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.9);
}

.auth-close {
  position: absolute;
  top: 15px;
  right: 20px;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 0.2s;
}

.auth-close:hover { color: var(--accent-cyan); }

.auth-modal-content h2 {
  font-size: 1.3rem;
  color: var(--text-main);
  margin-bottom: 1.5rem;
  text-align: center;
  letter-spacing: 1px;
}

.auth-field { margin-bottom: 1.25rem; text-align: left; }
.auth-field label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.auth-field input {
  width: 100%;
  padding: 0.75rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-main);
  font-size: 0.9rem;
}

.auth-field input:focus { outline: none; border-color: var(--accent-cyan); }

.auth-submit-btn {
  width: 100%;
  padding: 0.75rem;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
  border: none;
  border-radius: 4px;
  color: white;
  font-weight: bold;
  font-size: 0.9rem;
  cursor: pointer;
  margin-top: 0.5rem;
  transition: opacity 0.2s;
}

.auth-submit-btn:hover { opacity: 0.9; }

.auth-toggle-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 1.25rem;
  text-align: center;
}

.auth-toggle-text a { color: var(--accent-cyan); text-decoration: none; margin-left: 0.25rem; }

.btn-logout {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.btn-logout:hover { color: white; border-color: var(--accent-cyan); }

.auth-discord-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem;
  background-color: #5865F2;
  color: #ffffff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 4px;
  transition: background-color 0.2s, transform 0.1s;
  margin-bottom: 1.25rem;
  box-sizing: border-box;
}

.auth-discord-btn:hover { background-color: #4752C4; transform: translateY(-1px); }
.auth-discord-btn img { width: 20px; height: 20px; object-fit: contain; }

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin-bottom: 1.25rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  letter-spacing: 1px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-color);
}

.auth-divider span { padding: 0 0.75rem; }

/* --- MTG COLLECTION PAGE STYLING --- */
.top-nav {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  width: 100%;
}

.nav-btn {
  background-color: #2b2b2b;
  color: var(--text-main);
  text-decoration: none;
  padding: 10px 18px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  font-weight: bold;
  font-size: 0.95rem;
  transition: all 0.2s ease-in-out;
}

.nav-btn:hover {
  background-color: #3a3a3a;
  color: #ffffff;
}

.nav-btn.active {
  background-color: var(--accent-cyan);
  color: #000;
  border-color: var(--accent-cyan);
}

.deck-selector {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  background-color: var(--bg-card);
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  width: 100%;
}

.deck-btn {
  background-color: #252525;
  color: var(--accent-cyan);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  font-size: 0.9rem;
}

.deck-btn:hover {
  background-color: #333333;
}

.deck-btn.active {
  background-color: var(--accent-cyan);
  color: #000;
}

.deck-header {
  background-color: var(--bg-card);
  padding: 15px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  margin-bottom: 20px;
  width: 100%;
}

.deck-header h2 {
  margin: 0 0 8px 0;
  color: #ffffff;
}

.deck-meta {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.commander-badge {
  color: var(--accent-gold);
  font-weight: bold;
}

.filter-form {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  background-color: var(--bg-card);
  padding: 15px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  margin-bottom: 20px;
  align-items: center;
  width: 100%;
}

.filter-form input[type="text"],
.filter-form select {
  background-color: #2b2b2b;
  color: #ffffff;
  border: 1px solid var(--border-color);
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 0.95rem;
  outline: none;
}

.filter-form input[type="text"]:focus,
.filter-form select:focus {
  border-color: var(--accent-cyan);
}

.search-input {
  flex: 2;
  min-width: 200px;
}

.type-input {
  flex: 1;
  min-width: 150px;
}

.color-select {
  flex: 1;
  min-width: 160px;
}

.btn-submit {
  background-color: var(--accent-cyan);
  color: #000;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  transition: opacity 0.2s;
}

.btn-submit:hover {
  opacity: 0.9;
}

.btn-reset {
  color: var(--text-muted);
  text-decoration: none;
  padding: 10px 10px;
  font-size: 0.9rem;
}

.btn-reset:hover {
  color: #ffffff;
}

.group-header {
  margin: 25px 0 10px 0;
  color: var(--accent-cyan);
  font-size: 1.2rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 5px;
  width: 100%;
}

.table-container {
  width: 100%;
  background-color: var(--bg-card);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  margin-bottom: 20px;
  overflow: visible;
}

.table-container table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
}

.table-container th {
  background-color: #252525;
  color: var(--text-muted);
  padding: 12px 16px;
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.table-container td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.table-container tr:hover {
  background-color: #1a1a24;
}

.card-name-link {
  color: var(--accent-cyan);
  text-decoration: none;
  font-weight: bold;
  position: relative;
  display: inline-block;
  cursor: pointer;
}

.card-name-link:hover {
  text-decoration: underline;
}

.card-preview {
  display: none;
  position: absolute;
  left: 105%;
  bottom: 0;
  z-index: 9999;
  pointer-events: none;
  box-shadow: 0px 8px 20px rgba(0, 0, 0, 0.95);
  border-radius: 6px;
  overflow: hidden;
  width: 160px;
  background-color: #000;
  border: 1px solid var(--border-color);
}

.card-preview img {
  width: 100%;
  height: auto;
  display: block;
}

.card-name-link:hover .card-preview {
  display: block;
}

.rules-text {
  font-size: 0.88rem;
  color: var(--text-main);
  line-height: 1.4;
  max-width: 500px;
}

.price-text {
  color: #28a745;
  font-weight: bold;
}

.no-results {
  padding: 40px;
  text-align: center;
  color: var(--text-muted);
}

/* --- RESPONSIVE MOBILE STYLING (Max-width: 768px) --- */
@media (max-width: 768px) {
  .layout-container {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem;
  }

  .sidebar-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
  }

  .sidebar-menu li {
    margin-bottom: 0;
  }

  .sidebar-menu a {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
  }

  .content-area {
    padding: 1rem;
    width: 100%;
  }

  .page-container {
    padding: 10px;
    width: 100%;
  }

  .discord-sidebar-right {
    display: none; 
  }

  .title-bar {
    padding: 0 1rem;
  }

  .nav-title-img {
    max-height: 36px;
  }

  .cards-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .home-hero {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .warren-img {
    max-width: 100%;
  }
}

/* Force Dark Theme Background Overrides */
body, .content-area, main, .layout-container {
    background-color: #111 !important;
    color: #ffffff !important;
}

/* Ensure cards and tables look dark in the forum / UI */
.card, .modal-content {
    background-color: #1a1a1a !important;
    color: #ffffff !important;
    border-color: #333 !important;
}

/* --- Test News Aggregator Custom Styles --- */
.article-snippet {
    line-height: 1.6;
    color: #ffffff;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.test-news-container {
    padding: 40px 20px;
    max-width: 1100px;
    margin: 0 auto;
}