/* ============================================
   MARKETMATE - ADMIN UI WITH DARK THEME
   ============================================

   Professional admin dashboard with:
   - Dark left sidebar navigation
   - Dark theme throughout
   - Clean, modern styling

   Load order: Bootstrap CSS → This file → Page-specific CSS
   ============================================ */

/* Import Rubik font for logo */
@import url("https://fonts.googleapis.com/css2?family=Rubik:wght@700;800&display=swap");

/* ============================================
   1. CSS VARIABLES - DARK THEME
   ============================================ */
:root {
  /* Sidebar Colors */
  --sidebar-bg: #1a252f;
  --sidebar-text: #b8c1cc;
  --sidebar-text-hover: #ffffff;
  --sidebar-active-bg: #2c3e50;
  --sidebar-width: 250px;

  /* Primary Brand Colors */
  --primary: #667eea;
  --primary-dark: #5568d3;
  --primary-light: #7e8ff5;

  /* Content Background */
  --content-bg: #1e2a35;
  --body-bg: #1e2a35;

  /* Card & Surface Colors */
  --card-bg: #2a3642;
  --card-border: #3d4f5f;
  --card-shadow: rgba(0, 0, 0, 0.3);

  /* Text Colors */
  --text-primary: #e9ecef;
  --text-secondary: #adb5bd;
  --text-muted: #6c757d;

  /* Border Colors */
  --border-color: #3d4f5f;

  /* Navbar Colors */
  --navbar-bg: #2a3642;
  --navbar-border: #3d4f5f;
  --navbar-text: #e9ecef;

  /* Secondary Colors */
  --success: #28a745;
  --danger: #dc3545;
  --warning: #ffc107;
  --info: #17a2b8;

  /* Form Colors */
  --input-bg: #2a3642;
  --input-border: #3d4f5f;
  --input-text: #e9ecef;

  /* Shadows */
  --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.2);
  --shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.4);
}

/* ============================================
   2. GLOBAL STYLES
   ============================================ */
* {
  transition: background-color 0.3s ease, color 0.3s ease,
    border-color 0.3s ease;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--body-bg);
  color: var(--text-primary);
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

/* ============================================
   4. SIDEBAR NAVIGATION
   ============================================ */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background-color: var(--sidebar-bg);
  color: var(--sidebar-text);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
  padding: 1.5rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand {
  font-family: "Rubik", sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-decoration: none;
  display: block;
}

.sidebar-brand .market {
  color: #4ade80;
  filter: drop-shadow(0 2px 6px rgba(74, 222, 128, 0.4));
}

.sidebar-brand .mate {
  color: #5eb3f6;
  filter: drop-shadow(0 2px 6px rgba(94, 179, 246, 0.4));
}

.sidebar-brand:hover {
  opacity: 0.9;
}

.sidebar-menu {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0;
  list-style: none;
  margin: 0;
}

.sidebar-menu-item {
  margin: 0.25rem 0;
}

.sidebar-menu-link {
  display: flex;
  align-items: center;
  padding: 0.75rem 1.25rem;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.sidebar-menu-link:hover {
  background-color: var(--sidebar-active-bg);
  color: var(--sidebar-text-hover);
}

.sidebar-menu-link.active {
  background-color: var(--sidebar-active-bg);
  color: var(--sidebar-text-hover);
  border-left: 3px solid var(--primary);
}

.sidebar-menu-icon {
  width: 20px;
  margin-right: 0.75rem;
  font-size: 1.125rem;
}

/* ============================================
   4. TOP NAVBAR (with sidebar)
   ============================================ */
.navbar-admin {
  background-color: var(--navbar-bg) !important;
  border-bottom: 1px solid var(--navbar-border);
  box-shadow: var(--shadow-sm);
  padding: 0.75rem 1.5rem;
  position: fixed;
  top: 0;
  right: 0;
  left: var(--sidebar-width);
  z-index: 999;
}

.navbar-admin .page-title-nav {
  color: var(--navbar-text);
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
}

.navbar-admin .navbar-user {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--navbar-text);
}

.navbar-admin .user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.navbar-admin .btn-logout {
  background-color: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.375rem 0.875rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.navbar-admin .btn-logout:hover {
  background-color: var(--danger);
  border-color: var(--danger);
  color: white;
}

/* ============================================
   6. MAIN CONTENT AREA
   ============================================ */
.main-content {
  margin-left: var(--sidebar-width);
  padding-top: 140px; /* Account for fixed navbar + info banner */
  min-height: 100vh;
  background-color: var(--content-bg);
}

.content-wrapper {
  padding: 2rem;
}

/* ============================================
   7. CARDS
   ============================================ */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 0.5rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  transition: all 0.2s ease;
}

.card-header {
  background-color: transparent;
  border-bottom: 1px solid var(--card-border);
  padding: 1rem 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.card-body {
  padding: 1.25rem;
  color: var(--text-primary);
}

.card-title {
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

/* Stat Cards (Colorful cards like Sufee) */
.stat-card {
  background: linear-gradient(
    135deg,
    var(--primary) 0%,
    var(--primary-dark) 100%
  );
  border: none;
  color: white;
  padding: 1.5rem;
  border-radius: 0.5rem;
}

.stat-card.blue {
  background: linear-gradient(135deg, #17a2b8 0%, #117a8b 100%);
}

.stat-card.yellow {
  background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
}

.stat-card.red {
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.stat-card.green {
  background: linear-gradient(135deg, #28a745 0%, #218838 100%);
}

/* ============================================
   8. BUTTONS
   ============================================ */
.btn {
  border-radius: 0.375rem;
  font-weight: 500;
  padding: 0.5rem 1.25rem;
  transition: all 0.2s ease;
}

.btn-primary {
  background-color: var(--primary);
  border-color: var(--primary);
  color: white;
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
  color: white;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-secondary {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.btn-secondary:hover {
  background-color: var(--content-bg);
  color: var(--text-primary);
}

.btn-danger {
  background-color: var(--danger);
  border-color: var(--danger);
  color: white;
}

.btn-danger:hover {
  background-color: #c82333;
  border-color: #bd2130;
}

.btn-success {
  background-color: var(--success);
  border-color: var(--success);
  color: white;
}

.btn-success:hover {
  background-color: #218838;
  border-color: #1e7e34;
}

/* ============================================
   9. FORMS
   ============================================ */
.form-control,
.form-select,
textarea {
  background-color: var(--input-bg);
  border: 1px solid var(--input-border);
  color: var(--input-text);
  border-radius: 0.375rem;
  padding: 0.625rem 0.75rem;
  font-size: 0.9375rem;
}

.form-control:focus,
.form-select:focus,
textarea:focus {
  background-color: var(--input-bg);
  border-color: var(--primary);
  color: var(--input-text);
  box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.form-label {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.form-text {
  color: var(--text-muted);
}

/* ============================================
   10. ALERTS
   ============================================ */
.alert {
  border-radius: 0.375rem;
  padding: 0.75rem 1.25rem;
  margin-bottom: 1rem;
  font-size: 0.9375rem;
}

.alert-success {
  background-color: #d4edda;
  border-color: #c3e6cb;
  color: #155724;
}

.alert-info {
  background-color: #d1ecf1;
  border-color: #bee5eb;
  color: #0c5460;
}

.alert-warning {
  background-color: #fff3cd;
  border-color: #ffeaa7;
  color: #856404;
}

.alert-danger {
  background-color: #f8d7da;
  border-color: #f5c6cb;
  color: #721c24;
}

/* ============================================
   11. BADGES
   ============================================ */
.badge {
  padding: 0.375rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.badge-admin {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--primary);
  color: white;
}

.badge-admin .remove-btn {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: none;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  padding: 0;
  transition: background 0.2s ease;
}

.badge-admin .remove-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* ============================================
   12. MODAL
   ============================================ */
.modal-content {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 0.5rem;
  box-shadow: var(--shadow-lg);
  color: var(--text-primary);
}

.modal-header {
  border-bottom: 1px solid var(--border-color);
  background-color: transparent;
}

.modal-title {
  font-weight: 600;
  color: var(--text-primary);
}

.modal-footer {
  border-top: 1px solid var(--border-color);
  background-color: transparent;
}

.modal-body {
  color: var(--text-primary);
}

/* ============================================
   13. DRAG AND DROP
   ============================================ */
.priority-handle {
  cursor: grab;
  color: var(--text-muted);
  font-size: 1rem;
  margin-right: 0.5rem;
  user-select: none;
}

.priority-handle:active {
  cursor: grabbing;
}

.dragging {
  opacity: 0.5;
  background-color: var(--content-bg);
}

.priority-arrow-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.875rem;
  padding: 0.25rem;
  cursor: pointer;
  transition: color 0.2s ease;
}

.priority-arrow-btn:hover:not(:disabled) {
  color: var(--primary);
}

.priority-arrow-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ============================================
   14. EMPTY STATES
   ============================================ */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.empty-state-text {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* ============================================
   15. RESPONSIVE - MOBILE
   ============================================ */
@media (max-width: 992px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .sidebar.show {
    transform: translateX(0);
  }

  .navbar-admin {
    margin-left: 0;
    left: 0;
  }

  .info-banner {
    left: 0;
  }

  .main-content {
    margin-left: 0;
  }

  .mobile-menu-toggle {
    display: block;
  }
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 1001;
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: 0.375rem;
  padding: 0.5rem 0.75rem;
  font-size: 1.25rem;
  cursor: pointer;
}

/* ============================================
   16. INFO BANNER
   ============================================ */
.info-banner {
  position: fixed;
  padding-top: 24px;
  padding-bottom: 20px;
  top: 53px; /* Below navbar */
  left: var(--sidebar-width);
  right: 0;
  z-index: 998;
  background: linear-gradient(135deg, #5865f2 0%, #7289da 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.info-banner-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.info-banner-text {
  color: white;
  font-size: 0.875rem;
  font-weight: 500;
}

.btn-discord {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: white;
  color: #5865f2;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s ease;
  line-height: 1.2;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), 0 0 0 2px rgba(255, 255, 255, 0.1);
}

.btn-discord:hover {
  background-color: #fff;
  color: #4752c4;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25), 0 0 0 2px rgba(255, 255, 255, 0.2);
}

.btn-discord .discord-icon {
  flex-shrink: 0;
  display: block;
  width: 18px;
  height: 18px;
  filter: invert(29%) sepia(93%) saturate(1684%) hue-rotate(222deg) brightness(95%) contrast(95%);
}

/* ============================================
   17. UTILITY CLASSES
   ============================================ */
.text-muted {
  color: var(--text-muted) !important;
}

.text-primary {
  color: var(--primary) !important;
}

.border-custom {
  border-color: var(--border-color) !important;
}

.bg-content {
  background-color: var(--content-bg) !important;
}

/* ============================================
   END OF STYLES
   ============================================ */
