/* ============================================================
   style.css – Dexify SMP – Dark Red Dashboard
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@500;600;700&family=Inter:wght@300;400;500;600&display=swap');

/* ---- CSS Variables ---------------------------------------- */
:root {
  --red:        #e02020;
  --red-dark:   #b01010;
  --red-glow:   rgba(224,32,32,0.25);
  --red-subtle: rgba(224,32,32,0.08);

  --bg:         #0d0d0f;
  --bg-2:       #141416;
  --bg-3:       #1a1a1e;
  --bg-card:    #17171b;
  --bg-hover:   #1e1e24;

  --border:     rgba(255,255,255,0.07);
  --border-red: rgba(224,32,32,0.3);

  --text:       #e8e8ee;
  --text-sub:   #888899;
  --text-dim:   #555566;

  --font-head:  'Rajdhani', sans-serif;
  --font-body:  'Inter', sans-serif;

  --radius:     10px;
  --radius-sm:  6px;
  --shadow:     0 4px 24px rgba(0,0,0,0.6);
  --shadow-red: 0 0 20px var(--red-glow);

  --nav-h:      60px;
  --transition: 0.2s ease;
}

/* ---- Reset ------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; overflow: hidden; }

.login-bg {
  position: fixed; inset: 0; z-index: 0;
  background: radial-gradient(ellipse at 30% 40%, rgba(224,32,32,0.12) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 60%, rgba(224,32,32,0.06) 0%, transparent 60%),
              var(--bg);
}

.login-particles { position: absolute; inset: 0; }

.particle {
  position: absolute;
  background: var(--red);
  border-radius: 50%;
  animation: floatUp linear infinite;
}

@keyframes floatUp {
  0%   { transform: translateY(0) scale(1);   opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translateY(-100vh) scale(0.5); opacity: 0; }
}

.login-wrapper { position: relative; z-index: 1; width: 100%; max-width: 420px; padding: 20px; }

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border-red);
  border-radius: 16px;
  padding: 40px;
  box-shadow: var(--shadow), var(--shadow-red);
  animation: slideUp 0.5s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

.login-logo { text-align: center; margin-bottom: 16px; }
.login-logo img { width: 90px; height: 90px; object-fit: contain; filter: drop-shadow(0 0 12px var(--red-glow)); }

.login-title {
  font-family: var(--font-head);
  font-size: 2.2rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: 3px;
  color: var(--text);
}
.login-title span { color: var(--red); }

.login-subtitle { text-align: center; color: var(--text-sub); font-size: 13px; margin-bottom: 28px; }

.login-form { margin-top: 8px; }

.login-note { text-align: center; color: var(--text-dim); font-size: 12px; margin-top: 20px; }

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
  padding: 12px 16px; border-radius: var(--radius-sm);
  margin-bottom: 16px; font-size: 13px;
}
.alert-error   { background: rgba(224,32,32,0.12); border: 1px solid var(--red); color: #ff8888; }
.alert-warning { background: rgba(224,160,0,0.12); border: 1px solid #e0a000; color: #ffd080; }

/* ============================================================
   FORMS
   ============================================================ */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 12px; font-weight: 500; color: var(--text-sub); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }

input[type=text], input[type=email], input[type=password], input[type=date],
textarea, select {
  width: 100%; padding: 11px 14px;
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-family: var(--font-body); font-size: 14px;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-glow);
}
textarea { resize: vertical; min-height: 100px; }
select { cursor: pointer; }
select option { background: var(--bg-3); }

.checkbox-group { display: flex; gap: 20px; }
.checkbox-group label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; text-transform: none; letter-spacing: 0; color: var(--text); }
.checkbox-group input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--red); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: 13px; font-weight: 500;
  cursor: pointer; border: none; transition: all var(--transition);
  text-decoration: none; white-space: nowrap;
}
.btn-primary {
  background: var(--red); color: #fff;
  box-shadow: 0 2px 12px var(--red-glow);
}
.btn-primary:hover { background: var(--red-dark); box-shadow: 0 4px 20px var(--red-glow); transform: translateY(-1px); }
.btn-ghost   { background: var(--bg-3); color: var(--text-sub); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text); }
.btn-icon    { background: transparent; color: var(--text-sub); padding: 8px; border-radius: var(--radius-sm); }
.btn-icon:hover { background: var(--bg-3); color: var(--text); }
.btn-full    { width: 100%; justify-content: center; }
.btn-sm      { padding: 7px 14px; font-size: 12px; }
.btn-xs      { padding: 4px 10px; font-size: 11px; border: 1px solid var(--border); background: var(--bg-3); color: var(--text-sub); border-radius: 4px; }
.btn-xs:hover { color: var(--text); border-color: var(--red); }

.btn-vote-yes { background: rgba(0,180,80,0.1); color: #00b450; border: 1px solid rgba(0,180,80,0.3); }
.btn-vote-yes:hover, .btn-vote-yes.voted { background: rgba(0,180,80,0.25); border-color: #00b450; }
.btn-vote-no  { background: rgba(224,32,32,0.1); color: var(--red); border: 1px solid var(--border-red); }
.btn-vote-no:hover, .btn-vote-no.voted  { background: var(--red-subtle); }

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  background: rgba(13,13,15,0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
  display: flex; align-items: center;
  padding: 0 20px; gap: 16px;
}

.navbar-left  { display: flex; align-items: center; gap: 14px; }
.navbar-center{ flex: 1; overflow-x: auto; scrollbar-width: none; }
.navbar-center::-webkit-scrollbar { display: none; }
.navbar-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.nav-title { font-family: var(--font-head); font-size: 1.1rem; font-weight: 700; letter-spacing: 2px; white-space: nowrap; }
.nav-title-main { color: var(--text); }
.nav-title-sub  { color: var(--red); margin-left: 4px; }

.sidebar-toggle { background: none; border: none; cursor: pointer; padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.sidebar-toggle span { display: block; width: 20px; height: 2px; background: var(--text-sub); border-radius: 2px; transition: all var(--transition); }
.sidebar-toggle:hover span { background: var(--text); }

.nav-tabs { display: flex; gap: 4px; padding: 0 8px; }
.nav-tab {
  background: none; border: none; cursor: pointer;
  padding: 8px 14px; border-radius: var(--radius-sm);
  color: var(--text-sub); font-family: var(--font-body);
  font-size: 13px; white-space: nowrap;
  transition: all var(--transition);
}
.nav-tab:hover  { color: var(--text); background: var(--bg-3); }
.nav-tab.active { color: var(--red); background: var(--red-subtle); font-weight: 500; }

.user-badge { display: flex; align-items: center; gap: 10px; }
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--red); display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-weight: 700; font-size: 14px;
  flex-shrink: 0;
}
.user-info  { display: flex; flex-direction: column; }
.user-name  { font-size: 13px; font-weight: 500; line-height: 1.2; }
.user-role  { font-size: 11px; color: var(--text-dim); }
.role-admin { color: var(--red) !important; }

.nav-logo img { height: 38px; width: 38px; object-fit: contain; filter: drop-shadow(0 0 6px var(--red-glow)); }

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
  margin-top: var(--nav-h);
  padding: 28px 28px;
  max-width: 1400px;
  margin-left: auto; margin-right: auto;
}

.tab-section { display: none; }
.tab-section.active { display: block; animation: fadeIn 0.25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.section-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
  margin-bottom: 24px;
}
.section-header h2 {
  font-family: var(--font-head); font-size: 1.6rem; font-weight: 700;
  letter-spacing: 1px; color: var(--text);
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  transition: border-color var(--transition), box-shadow var(--transition);
  margin-bottom: 16px;
}
.card:hover { border-color: var(--border-red); box-shadow: var(--shadow-red); }

.card-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; margin-bottom: 14px;
}
.card-header h3 { font-family: var(--font-head); font-size: 1.1rem; color: var(--text); }
.card-footer { display: flex; align-items: center; gap: 16px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.card-meta   { font-size: 12px; color: var(--text-dim); margin-top: 12px; }

/* ============================================================
   CHANGELOG
   ============================================================ */
.search-bar { display: flex; gap: 8px; align-items: center; }
.search-bar input { width: auto; }

.changelog-editor {
  width: 100%; min-height: 160px; font-family: var(--font-body); font-size: 14px;
}

.save-status { font-size: 12px; color: var(--text-sub); }

.changelog-list { display: flex; flex-direction: column; gap: 12px; }

.changelog-entry { position: relative; }
.entry-date {
  font-family: var(--font-head); font-size: 1.1rem; font-weight: 600;
  color: var(--red); margin-bottom: 10px; letter-spacing: 0.5px;
}
.entry-content { color: var(--text); line-height: 1.7; }
.entry-meta    { font-size: 12px; color: var(--text-dim); margin-top: 12px; }
.muted { color: var(--text-dim); font-style: italic; }

/* ============================================================
   IDEAS
   ============================================================ */
.ideas-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }

.idea-card {}
.idea-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.idea-header h3 { font-family: var(--font-head); font-size: 1.05rem; flex: 1; }
.idea-desc { color: var(--text-sub); font-size: 13px; line-height: 1.6; margin-bottom: 14px; }

.idea-vote-bar { height: 6px; background: var(--bg-3); border-radius: 3px; overflow: hidden; margin-bottom: 8px; }
.vote-bar-fill { height: 100%; background: linear-gradient(90deg, var(--red), #ff6060); border-radius: 3px; transition: width 0.5s ease; }

.idea-stats { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 14px; }
.vote-yes   { color: #00b450; font-weight: 600; }
.vote-no    { color: var(--red); font-weight: 600; }
.vote-pct   { color: var(--text-sub); }

.idea-actions { display: flex; gap: 8px; }

/* ============================================================
   TODOS
   ============================================================ */
.todo-filters { display: flex; gap: 8px; }
.filter-btn {
  background: var(--bg-3); border: 1px solid var(--border);
  color: var(--text-sub); padding: 6px 14px; border-radius: 20px;
  cursor: pointer; font-size: 12px; transition: all var(--transition);
}
.filter-btn:hover  { color: var(--text); }
.filter-btn.active { background: var(--red-subtle); border-color: var(--border-red); color: var(--red); }

.todos-list { display: flex; flex-direction: column; gap: 10px; }

.todo-item { display: flex; align-items: flex-start; gap: 16px; padding: 16px 20px; }
.todo-done  { opacity: 0.55; }
.todo-left  { flex-shrink: 0; padding-top: 2px; }
.todo-main  { flex: 1; }
.todo-main h4 { font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.todo-main p  { font-size: 13px; color: var(--text-sub); }
.todo-main small { font-size: 11px; color: var(--text-dim); }
.todo-meta { font-size: 12px; color: var(--text-dim); flex-shrink: 0; }

.todo-status-select { background: var(--bg-3); border: 1px solid var(--border); color: var(--text); padding: 5px 10px; border-radius: var(--radius-sm); font-size: 12px; cursor: pointer; }

/* ============================================================
   CONTENT CARDS (Videos, Items)
   ============================================================ */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }

.content-card { position: relative; }
.card-icon { font-size: 2rem; margin-bottom: 12px; }
.content-card h3 { font-family: var(--font-head); font-size: 1.1rem; margin-bottom: 8px; }
.content-card p  { font-size: 13px; color: var(--text-sub); margin-bottom: 12px; }
details summary { font-size: 12px; color: var(--red); cursor: pointer; margin-bottom: 8px; }
.script-preview {
  font-family: monospace; font-size: 12px; background: var(--bg-3);
  padding: 12px; border-radius: var(--radius-sm); color: var(--text-sub);
  white-space: pre-wrap; word-break: break-word; margin-top: 8px;
  border: 1px solid var(--border);
}

/* ============================================================
   MISC
   ============================================================ */
.misc-list { display: flex; flex-direction: column; gap: 16px; }
.misc-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.misc-header h3 { font-family: var(--font-head); font-size: 1.1rem; }
.misc-content { color: var(--text-sub); font-size: 14px; line-height: 1.7; }

/* ============================================================
   NEWS
   ============================================================ */
.news-list { display: flex; flex-direction: column; gap: 16px; }
.news-card { }
.news-pinned    { border-color: rgba(80,140,255,0.3) !important; }
.news-important { border-color: var(--border-red) !important; box-shadow: var(--shadow-red) !important; }
.news-header { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.news-header h3 { font-family: var(--font-head); font-size: 1.2rem; flex: 1; }
.news-content { color: var(--text-sub); line-height: 1.7; }

/* ============================================================
   ADMIN TABLE
   ============================================================ */
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th { text-align: left; padding: 10px 12px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-dim); border-bottom: 1px solid var(--border); }
.admin-table td { padding: 12px 12px; border-bottom: 1px solid rgba(255,255,255,0.04); vertical-align: middle; }
.admin-table tr:hover td { background: var(--bg-hover); }
.row-inactive td { opacity: 0.5; }
.action-cell { display: flex; gap: 6px; flex-wrap: wrap; }

/* ============================================================
   BADGES
   ============================================================ */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 500; white-space: nowrap; }
.badge-red    { background: var(--red-subtle); color: #ff8888; border: 1px solid var(--border-red); }
.badge-green  { background: rgba(0,180,80,0.1); color: #00c060; border: 1px solid rgba(0,180,80,0.3); }
.badge-blue   { background: rgba(80,140,255,0.1); color: #6090ff; border: 1px solid rgba(80,140,255,0.3); }
.badge-gray   { background: var(--bg-3); color: var(--text-dim); border: 1px solid var(--border); }
.status-pending  { background: rgba(224,160,0,0.1); color: #e0a000; border: 1px solid rgba(224,160,0,0.3); padding: 3px 10px; border-radius: 20px; font-size: 11px; }
.status-progress { background: rgba(80,140,255,0.1); color: #6090ff; border: 1px solid rgba(80,140,255,0.3); padding: 3px 10px; border-radius: 20px; font-size: 11px; }
.status-done     { background: rgba(0,180,80,0.1); color: #00c060; border: 1px solid rgba(0,180,80,0.3); padding: 3px 10px; border-radius: 20px; font-size: 11px; }

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.75); backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay.active { display: flex; animation: fadeIn 0.2s ease; }

.modal {
  background: var(--bg-card); border: 1px solid var(--border-red);
  border-radius: 14px; width: 100%; max-width: 480px;
  box-shadow: var(--shadow), var(--shadow-red);
  animation: slideUp 0.25s ease;
}
.modal-lg { max-width: 680px; }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-family: var(--font-head); font-size: 1.1rem; }
.modal-close {
  background: none; border: none; color: var(--text-dim); cursor: pointer;
  font-size: 16px; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; transition: all var(--transition);
}
.modal-close:hover { background: var(--bg-3); color: var(--text); }

.modal-body   { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed; bottom: 28px; right: 28px; z-index: 300;
  background: var(--bg-card); border: 1px solid var(--border-red);
  border-radius: var(--radius); padding: 14px 20px;
  color: var(--text); font-size: 14px;
  box-shadow: var(--shadow), var(--shadow-red);
  transform: translateY(120%); opacity: 0;
  transition: all 0.3s cubic-bezier(.34,1.56,.64,1);
  max-width: 340px;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast-error { border-color: var(--red); color: #ff8888; }

/* ============================================================
   EMPTY / LOADING
   ============================================================ */
.empty-state {
  text-align: center; padding: 60px 20px;
  color: var(--text-dim); font-size: 14px;
}
.loading {
  text-align: center; padding: 40px; color: var(--text-dim);
  font-size: 13px; letter-spacing: 0.5px;
}
.loading::after {
  content: '';
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid var(--border); border-top-color: var(--red);
  border-radius: 50%; animation: spin 0.8s linear infinite;
  margin-left: 10px; vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   DATE PICKER
   ============================================================ */
.date-picker-group { display: flex; align-items: center; gap: 10px; }
.date-picker-group label { font-size: 13px; color: var(--text-sub); white-space: nowrap; }
.date-picker-group input { width: auto; }

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--red-dark); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .navbar { padding: 0 12px; gap: 10px; }
  .nav-title { font-size: 0.95rem; }
  .user-info { display: none; }
  .nav-logo img { height: 30px; width: 30px; }
  .main-content { padding: 20px 14px; }
  .section-header { flex-direction: column; align-items: flex-start; }
  .ideas-grid, .cards-grid { grid-template-columns: 1fr; }
  .todo-item { flex-direction: column; }
  .admin-table { font-size: 12px; }
  .action-cell { flex-direction: column; }
  .modal { margin: 10px; }
}

@media (max-width: 480px) {
  .nav-tabs { gap: 2px; }
  .nav-tab  { padding: 7px 10px; font-size: 12px; }
}
