/* === ShyamStudio Tracker - Base Design System === */
*, *::before, *::after { box-sizing: border-box; }

:root {
  --bg-primary: #08080d;
  --bg-card: rgba(255,255,255,0.03);
  --bg-card-hover: rgba(255,255,255,0.06);
  --glass-bg: linear-gradient(135deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.02) 100%);
  --glass-border: rgba(255,255,255,0.08);
  --glass-shadow: 0 8px 32px rgba(0,0,0,0.3);
  --glass-blur: blur(20px) saturate(180%);
  --text-primary: #f0f0f5;
  --text-secondary: #8b8fa3;
  --text-muted: #555770;
  --border-color: rgba(255,255,255,0.06);
  --border-hover: rgba(255,255,255,0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --transition: 0.25s ease;
  --transition-slow: 0.4s cubic-bezier(0.4,0,0.2,1);
}

html { scroll-behavior: smooth; }

body {
  margin: 0; padding: 0; min-height: 100vh;
  background: var(--bg-primary);
  color: var(--text-secondary);
  display: flex; flex-direction: column;
  overflow-x: hidden;
}

/* Ambient background glow */
body::before {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 10% 10%, rgba(var(--accent-color-rgb),0.1) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 90% 90%, rgba(var(--accent-color-rgb),0.06) 0%, transparent 60%);
  z-index: -1;
  pointer-events: none;
}

/* Dot grid overlay */
body::after {
  content: '';
  position: fixed; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 32px 32px;
  z-index: -1;
  pointer-events: none;
}

.main-content { flex: 1; }

/* === Scrollbar === */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-thumb { background: rgba(var(--accent-color-rgb),0.3); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: rgba(var(--accent-color-rgb),0.5); }
::-webkit-scrollbar-track { background: transparent; }

/* === Glass Card === */
.glass {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow), inset 0 1px 0 rgba(255,255,255,0.04);
  transition: all var(--transition);
}

.glass:hover {
  border-color: var(--border-hover);
  box-shadow: var(--glass-shadow), 0 0 20px rgba(var(--accent-color-rgb),0.06);
}

.glass-subtle {
  background: rgba(255,255,255,0.02);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
}

/* === Typography === */
h1, h2, h3, h4 { color: var(--text-primary); margin: 0; }

.page-title {
  font-size: 2rem; font-weight: 700;
  background: linear-gradient(135deg, var(--text-primary) 0%, rgba(var(--accent-color-rgb),0.8) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-subtitle { color: var(--text-secondary); font-size: 1rem; margin-top: 0.25rem; }

/* === Buttons === */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius-sm);
  font-weight: 500; font-size: 0.9rem;
  cursor: pointer; border: none;
  transition: all var(--transition);
  text-decoration: none;
  position: relative; overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-color), rgba(var(--accent-color-rgb),0.8));
  color: #fff;
  box-shadow: 0 4px 15px rgba(var(--accent-color-rgb),0.25);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(var(--accent-color-rgb),0.35);
  color: #fff;
}

.btn-outline {
  background: transparent;
  border: 1px solid rgba(var(--accent-color-rgb),0.3);
  color: var(--accent-color);
}
.btn-outline:hover {
  background: rgba(var(--accent-color-rgb),0.1);
  border-color: var(--accent-color);
  transform: translateY(-2px);
  color: var(--accent-color);
}

.btn-ghost {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
}
.btn-ghost:hover {
  background: rgba(255,255,255,0.08);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.btn-danger {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  color: #ef4444;
}
.btn-danger:hover {
  background: #ef4444; color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(239,68,68,0.3);
}

.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.8rem; }
.btn-lg { padding: 0.85rem 2rem; font-size: 1rem; }
.btn-block { width: 100%; justify-content: center; }

/* === Inputs === */
.form-input, .form-textarea, .form-select {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 0.7rem 1rem;
  font-size: 0.95rem;
  transition: all var(--transition);
  font-family: inherit;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(var(--accent-color-rgb),0.1);
}
.form-input::placeholder, .form-textarea::placeholder {
  color: var(--text-muted);
}
.form-textarea { resize: vertical; min-height: 120px; }
.form-select {
  appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238b8fa3' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}
.form-select option { background: #12121a; color: var(--text-primary); }
.form-label {
  display: block; color: var(--text-primary);
  font-weight: 500; font-size: 0.9rem; margin-bottom: 0.4rem;
}
.form-help { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.3rem; }
.form-group { margin-bottom: 1.5rem; }

/* === Status Tags === */
.tag {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  border-radius: 100px; font-size: 0.8rem; font-weight: 500;
  white-space: nowrap;
}
.tag-accent { background: rgba(var(--accent-color-rgb),0.12); color: var(--accent-color); }
.tag-pending { background: rgba(245,158,11,0.12); color: #f59e0b; }
.tag-approved { background: rgba(34,197,94,0.12); color: #22c55e; }
.tag-implemented { background: rgba(var(--accent-color-rgb),0.12); color: var(--accent-color); }
.tag-investigating { background: rgba(59,130,246,0.12); color: #3b82f6; }
.tag-resolved { background: rgba(34,197,94,0.12); color: #22c55e; }
.tag-rejected { background: rgba(239,68,68,0.12); color: #ef4444; }

/* === Stats Card === */
.stat-card {
  text-align: center; padding: 1.5rem;
}
.stat-card .stat-icon {
  width: 48px; height: 48px; margin: 0 auto 1rem;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md);
  background: rgba(var(--accent-color-rgb),0.1);
  color: var(--accent-color); font-size: 1.2rem;
}
.stat-card .stat-value {
  font-size: 2.2rem; font-weight: 700; color: var(--text-primary);
  line-height: 1;
}
.stat-card .stat-label {
  font-size: 0.85rem; color: var(--text-secondary); margin-top: 0.4rem;
}

/* === Submission/Activity Cards === */
.submission-card {
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem 1.25rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  transition: all var(--transition);
  margin-bottom: 0.5rem;
}
.submission-card:hover {
  background: rgba(255,255,255,0.04);
  border-color: rgba(var(--accent-color-rgb),0.2);
  transform: translateX(4px);
}
.submission-card .card-icon {
  width: 40px; height: 40px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  background: rgba(var(--accent-color-rgb),0.1);
  color: var(--accent-color); font-size: 1rem;
}
.submission-card .card-content { flex: 1; min-width: 0; }
.submission-card .card-title {
  color: var(--text-primary); font-weight: 500; font-size: 1rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-decoration: none; display: block;
  transition: color var(--transition);
}
.submission-card .card-title:hover { color: var(--accent-color); }
.submission-card .card-meta {
  display: flex; align-items: center; gap: 0.75rem;
  flex-wrap: wrap; margin-top: 0.35rem;
  font-size: 0.85rem; color: var(--text-muted);
}
.submission-card .card-actions {
  display: flex; align-items: center; gap: 0.75rem; flex-shrink: 0;
}

/* === Votes === */
.vote-box {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.4rem 0.75rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
}
.vote-item { display: flex; align-items: center; gap: 0.3rem; font-size: 0.9rem; }
.vote-item .fa-arrow-up { color: #22c55e; }
.vote-item .fa-arrow-down { color: #ef4444; }
.vote-item span { color: var(--text-primary); font-weight: 500; }

/* === Filters === */
.filter-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

/* === Pagination === */
.pagination-wrapper {
  display: flex; justify-content: center; align-items: center;
  gap: 0.35rem; margin-top: 2rem; flex-wrap: wrap;
}
.page-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 36px; padding: 0 0.5rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary); font-size: 0.85rem;
  cursor: pointer; transition: all var(--transition);
  text-decoration: none;
}
.page-btn:hover:not(.active):not([disabled]) {
  background: rgba(var(--accent-color-rgb),0.1);
  border-color: var(--accent-color);
  color: var(--accent-color);
}
.page-btn.active {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: #fff;
}
.page-btn[disabled] { opacity: 0.4; cursor: not-allowed; }

/* === Comments === */
.comment-card {
  padding: 1.25rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
  transition: all var(--transition);
}
.comment-card:hover { border-color: var(--border-hover); }
.comment-header {
  display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.6rem;
}
.comment-avatar { width: 32px; height: 32px; border-radius: 50%; border: 2px solid rgba(var(--accent-color-rgb),0.3); }
.comment-author { color: var(--accent-color); font-weight: 500; font-size: 0.95rem; }
.comment-time { color: var(--text-muted); font-size: 0.8rem; }
.comment-body { color: var(--text-primary); line-height: 1.6; font-size: 0.95rem; }

/* === Modal (dark glass) === */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center;
  padding: 1rem;
}
.modal-overlay.active { display: flex; }

/* === Announcements === */
.announcement {
  padding: 0.6rem 1.5rem;
  text-align: center; font-size: 0.9rem; font-weight: 500;
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  animation: slideDown 0.4s var(--transition-slow);
}
@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* === Responsive === */
@media (max-width: 768px) {
  .page-title { font-size: 1.5rem; }
  .submission-card { flex-direction: column; align-items: flex-start; }
  .submission-card .card-actions { width: 100%; justify-content: space-between; }
  .filter-bar { grid-template-columns: 1fr; }
  .stat-card .stat-value { font-size: 1.8rem; }
}

/* === BBCode + Markdown Styles === */
.bb-content { white-space: normal; word-wrap: break-word; overflow-wrap: break-word; }
.bb-content strong { color: var(--text-primary); }
.bb-content a.bb-link {
  color: var(--accent-color); text-decoration: none;
  border-bottom: 1px solid rgba(var(--accent-color-rgb),0.3);
  transition: border-color 0.2s;
}
.bb-content a.bb-link:hover { border-color: var(--accent-color); }
.bb-content .bb-img {
  max-width: 100%; max-height: 400px; border-radius: var(--radius-md);
  border: 1px solid var(--glass-border); margin: 0.5rem 0; cursor: pointer;
  transition: all 0.25s ease;
}
.bb-content .bb-img:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.3); }
.bb-content .bb-quote {
  margin: 0.75rem 0; padding: 1rem 1.25rem;
  border-left: 3px solid var(--accent-color);
  background: rgba(var(--accent-color-rgb),0.05);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary); font-style: italic;
}
.bb-content .bb-quote-author {
  font-weight: 600; color: var(--accent-color);
  font-size: 0.85rem; margin-bottom: 0.4rem; font-style: normal;
}
.bb-content .bb-spoiler {
  margin: 0.75rem 0; border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm); overflow: hidden;
}
.bb-content .bb-spoiler summary {
  padding: 0.7rem 1rem; cursor: pointer; font-weight: 500;
  color: var(--text-primary); background: rgba(255,255,255,0.03);
  user-select: none; transition: background 0.2s;
}
.bb-content .bb-spoiler summary:hover { background: rgba(255,255,255,0.05); }
.bb-content .bb-spoiler-content { padding: 1rem; color: var(--text-secondary); }
.bb-content .bb-ispoiler {
  background: var(--text-primary); color: transparent;
  border-radius: 3px; padding: 0 4px; cursor: pointer; transition: all 0.25s;
}
.bb-content .bb-ispoiler.revealed { background: rgba(var(--accent-color-rgb),0.1); color: var(--accent-color); }
.bb-content .bb-code-block {
  margin: 0.75rem 0; border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm); overflow: hidden; background: rgba(0,0,0,0.3);
}
.bb-content .bb-code-label {
  padding: 0.4rem 1rem; font-size: 0.75rem; font-weight: 600;
  color: var(--accent-color); background: rgba(var(--accent-color-rgb),0.08);
  border-bottom: 1px solid var(--glass-border);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.bb-content .bb-code-block pre {
  margin: 0; padding: 1rem; overflow-x: auto;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.85rem; line-height: 1.6; color: var(--text-primary);
}
.bb-content .bb-icode {
  background: rgba(var(--accent-color-rgb),0.1);
  color: var(--accent-color); padding: 0.15rem 0.45rem;
  border-radius: 4px; font-size: 0.88em;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
}
.bb-content .bb-list { margin: 0.5rem 0; padding-left: 1.75rem; color: var(--text-secondary); }
.bb-content .bb-list li { margin-bottom: 0.3rem; }
.bb-content .bb-table-wrap { overflow-x: auto; margin: 0.75rem 0; }
.bb-content .bb-table {
  width: 100%; border-collapse: collapse; border: 1px solid var(--glass-border);
}
.bb-content .bb-table th, .bb-content .bb-table td {
  padding: 0.6rem 0.85rem; border: 1px solid var(--glass-border); text-align: left; font-size: 0.9rem;
}
.bb-content .bb-table th {
  background: rgba(var(--accent-color-rgb),0.08); color: var(--accent-color); font-weight: 600;
}
.bb-content .bb-table td { color: var(--text-secondary); }
.bb-content .bb-table tr:nth-child(even) td { background: rgba(255,255,255,0.02); }
.bb-content h1.bb-heading { font-size: 1.5rem; margin: 1rem 0 0.5rem; color: var(--text-primary); }
.bb-content h2.bb-heading { font-size: 1.25rem; margin: 0.75rem 0 0.4rem; color: var(--text-primary); }
.bb-content h3.bb-heading { font-size: 1.1rem; margin: 0.5rem 0 0.3rem; color: var(--text-primary); }
.bb-content .bb-media {
  position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;
  margin: 0.75rem 0; border-radius: var(--radius-md); border: 1px solid var(--glass-border);
}
.bb-content .bb-media iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.bb-content .bb-hr {
  border: none; height: 1px; margin: 1rem 0;
  background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
}
