/* ============================================
   YoelStore - Modern UI Styles
   ============================================ */

:root {
  --primary: #4361ee;
  --primary-dark: #3a56d4;
  --primary-shadow: rgba(67,97,238,0.4);
  --success: #2ec4b6;
  --danger: #e63946;
  --warning: #f4a261;
  --info: #457b9d;
  --sidebar-bg: #1a1a2e;
  --sidebar-hover: #16213e;
  --sidebar-active: #4361ee;
  --sidebar-text: rgba(255,255,255,0.75);
  --sidebar-text-active: #fff;
  --card-radius: 0.75rem;
  --card-shadow: 0 2px 12px rgba(0,0,0,0.08);
  --card-shadow-hover: 0 6px 24px rgba(0,0,0,0.13);
  --transition: all 0.2s ease;
  --font-main: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ============================================
   THEMES - 5 Tema Warna Kekinian
   ============================================ */

/* Tema 1: Ocean Blue (default) */
[data-theme="ocean"] {
  --primary: #4361ee;
  --primary-dark: #3a56d4;
  --primary-shadow: rgba(67,97,238,0.4);
  --sidebar-bg: #1a1a2e;
  --sidebar-hover: #16213e;
  --sidebar-active: #4361ee;
}

/* Tema 2: Emerald Forest */
[data-theme="emerald"] {
  --primary: #10b981;
  --primary-dark: #059669;
  --primary-shadow: rgba(16,185,129,0.4);
  --sidebar-bg: #064e3b;
  --sidebar-hover: #065f46;
  --sidebar-active: #10b981;
}

/* Tema 3: Cosmic Violet */
[data-theme="violet"] {
  --primary: #7c3aed;
  --primary-dark: #6d28d9;
  --primary-shadow: rgba(124,58,237,0.4);
  --sidebar-bg: #1e1b4b;
  --sidebar-hover: #312e81;
  --sidebar-active: #7c3aed;
}

/* Tema 4: Rose Blush */
[data-theme="rose"] {
  --primary: #f43f5e;
  --primary-dark: #e11d48;
  --primary-shadow: rgba(244,63,94,0.4);
  --sidebar-bg: #1f0b12;
  --sidebar-hover: #2d1021;
  --sidebar-active: #f43f5e;
}

/* Tema 5: Sunset Amber */
[data-theme="amber"] {
  --primary: #f59e0b;
  --primary-dark: #d97706;
  --primary-shadow: rgba(245,158,11,0.4);
  --sidebar-bg: #1c1407;
  --sidebar-hover: #2d2010;
  --sidebar-active: #f59e0b;
}

/* ---- Theme Switcher Modal ---- */
.theme-switcher-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
}
.theme-switcher-overlay.show {
  display: flex;
}
.theme-switcher-panel {
  background: #fff;
  border-radius: 20px;
  padding: 28px 32px 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  width: 340px;
  max-width: 94vw;
  animation: themePanelIn 0.25s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes themePanelIn {
  from { opacity: 0; transform: scale(0.88) translateY(16px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.theme-switcher-title {
  font-size: 1rem;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 6px;
}
.theme-switcher-subtitle {
  font-size: 0.8rem;
  color: #888;
  margin-bottom: 20px;
}
.theme-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.theme-swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  padding: 8px 4px;
  border-radius: 12px;
  transition: background 0.15s;
}
.theme-swatch:hover {
  background: #f5f5f5;
}
.theme-swatch.active {
  background: #f0f0ff;
}
.theme-swatch-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid transparent;
  box-shadow: 0 3px 10px rgba(0,0,0,0.15);
  transition: transform 0.15s, border-color 0.15s;
  position: relative;
  overflow: hidden;
}
.theme-swatch-circle::before {
  content: '';
  position: absolute;
  inset: 0;
  background: inherit;
}
.theme-swatch.active .theme-swatch-circle {
  border-color: #333;
  transform: scale(1.1);
}
.theme-swatch-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: #555;
  text-align: center;
  line-height: 1.2;
}
.theme-swatch.active .theme-swatch-label {
  color: #222;
}
/* Swatch colors per theme */
.swatch-ocean   { background: linear-gradient(135deg, #1a1a2e 50%, #4361ee 50%); }
.swatch-emerald { background: linear-gradient(135deg, #064e3b 50%, #10b981 50%); }
.swatch-violet  { background: linear-gradient(135deg, #1e1b4b 50%, #7c3aed 50%); }
.swatch-rose    { background: linear-gradient(135deg, #1f0b12 50%, #f43f5e 50%); }
.swatch-amber   { background: linear-gradient(135deg, #1c1407 50%, #f59e0b 50%); }

.theme-close-btn {
  width: 100%;
  padding: 10px;
  background: #f0f0f0;
  border: none;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #555;
  cursor: pointer;
  transition: background 0.15s;
}
.theme-close-btn:hover {
  background: #e5e5e5;
}

/* ---- Body & Wrapper ---- */
body {
  font-family: var(--font-main);
  background-color: #f0f2f5;
  color: #333;
}

/* ============================================
   SIDEBAR
   ============================================ */
.main-sidebar {
  background-color: var(--sidebar-bg) !important;
  box-shadow: 3px 0 10px rgba(0,0,0,0.15);
  transition: var(--transition);
}

.brand-link {
  background-color: rgba(0,0,0,0.15) !important;
  border-bottom: 1px solid rgba(255,255,255,0.07) !important;
  padding: 14px 16px !important;
  transition: var(--transition);
}

.brand-link:hover {
  background-color: rgba(0,0,0,0.25) !important;
}

.brand-text {
  font-size: 1rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.5px;
  color: #fff !important;
}

.brand-image {
  max-height: 34px !important;
  margin-right: 10px !important;
}

/* User panel */
.user-panel {
  border-bottom: 1px solid rgba(255,255,255,0.07) !important;
  padding: 12px 16px !important;
  margin: 0 !important;
}

.user-panel .info a {
  color: #fff !important;
  font-weight: 500;
  font-size: 0.9rem;
}

.user-panel .image img {
  width: 36px !important;
  height: 36px !important;
  border: 2px solid rgba(255,255,255,0.3);
}

/* Sidebar nav */
.sidebar > nav {
  padding: 8px 0;
}

.nav-sidebar > .nav-item > .nav-link {
  color: var(--sidebar-text) !important;
  padding: 10px 16px !important;
  margin: 2px 8px !important;
  border-radius: 8px !important;
  transition: var(--transition) !important;
  font-size: 0.875rem;
  font-weight: 500;
}

.nav-sidebar > .nav-item > .nav-link:hover {
  background-color: rgba(255,255,255,0.08) !important;
  color: #fff !important;
}

.nav-sidebar > .nav-item > .nav-link.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important;
  color: var(--sidebar-text-active) !important;
  box-shadow: 0 4px 12px var(--primary-shadow);
}

.nav-sidebar .nav-icon {
  width: 1.4rem !important;
  font-size: 0.95rem !important;
  margin-right: 8px;
  opacity: 0.9;
}

/* Treeview submenu */
.nav-treeview {
  background-color: rgba(0,0,0,0.15);
  border-radius: 0 0 8px 8px;
  padding: 4px 0 !important;
}

.nav-treeview .nav-item .nav-link {
  color: rgba(255,255,255,0.6) !important;
  padding: 8px 8px 8px 40px !important;
  margin: 1px 8px !important;
  border-radius: 6px !important;
  font-size: 0.84rem;
  transition: var(--transition) !important;
}

.nav-treeview .nav-item .nav-link:hover {
  background-color: rgba(255,255,255,0.07) !important;
  color: rgba(255,255,255,0.9) !important;
}

.nav-treeview .nav-item .nav-link.active {
  background-color: rgba(67,97,238,0.25) !important;
  color: #fff !important;
}

.nav-treeview .nav-item .nav-link .nav-icon {
  font-size: 0.6rem !important;
  opacity: 0.6;
}

/* Section headers */
.nav-header {
  color: rgba(255,255,255,0.35) !important;
  font-size: 0.7rem !important;
  font-weight: 700 !important;
  letter-spacing: 1.2px !important;
  text-transform: uppercase !important;
  padding: 12px 24px 4px !important;
  margin-top: 4px;
}

/* Sidebar scrollbar */
.sidebar {
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

/* ============================================
   NAVBAR
   ============================================ */
.main-header.navbar {
  background: #fff !important;
  border-bottom: 1px solid #e8ecf0 !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06) !important;
  min-height: 58px;
  padding: 0 16px;
}

.main-header .nav-link {
  color: #555 !important;
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
}

.main-header .nav-link:hover {
  color: var(--primary) !important;
}

/* Burger menu button */
.nav-link[data-widget="pushmenu"] {
  color: #555 !important;
  padding: 6px 12px !important;
  border-radius: 8px;
  transition: var(--transition);
}

.nav-link[data-widget="pushmenu"]:hover {
  background-color: #f0f2f5 !important;
  color: var(--primary) !important;
}

/* Navbar app title */
.navbar-brand-text {
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary) !important;
}

/* User dropdown in navbar */
.navbar-user-dropdown .nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px !important;
  border-radius: 8px;
  transition: var(--transition);
}

.navbar-user-dropdown .nav-link:hover {
  background-color: #f0f2f5;
}

.navbar-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #e0e0e0;
}

.navbar-user-name {
  font-weight: 600;
  color: #333;
  font-size: 0.875rem;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Bell badge */
.navbar-badge {
  font-size: 0.6rem !important;
  padding: 2px 5px !important;
}

/* ============================================
   CONTENT WRAPPER
   ============================================ */
.content-wrapper {
  background-color: #f0f2f5 !important;
}

.content-header h1 {
  font-size: 1.4rem !important;
  font-weight: 700 !important;
  color: #1a1a2e;
}

.breadcrumb {
  background: transparent !important;
  font-size: 0.82rem !important;
}

.breadcrumb-item a {
  color: var(--primary);
  text-decoration: none;
}

.breadcrumb-item.active {
  color: #888;
}

/* ============================================
   CARDS
   ============================================ */
.card {
  border: none !important;
  border-radius: var(--card-radius) !important;
  box-shadow: var(--card-shadow) !important;
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--card-shadow-hover) !important;
}

.card-header {
  border-bottom: 1px solid rgba(0,0,0,0.06) !important;
  border-radius: var(--card-radius) var(--card-radius) 0 0 !important;
  padding: 14px 20px !important;
  font-weight: 600;
}

.card-title {
  font-size: 0.95rem !important;
  font-weight: 600 !important;
  margin: 0 !important;
}

.card-body {
  padding: 20px !important;
}

/* Colored card headers */
.card-primary > .card-header { background: linear-gradient(135deg, #4361ee, #3a56d4) !important; }
.card-success > .card-header { background: linear-gradient(135deg, #2ec4b6, #1aa39a) !important; }
.card-danger  > .card-header { background: linear-gradient(135deg, #e63946, #c1121f) !important; }
.card-warning > .card-header { background: linear-gradient(135deg, #f4a261, #e07c3a) !important; }
.card-info    > .card-header { background: linear-gradient(135deg, #457b9d, #2c6183) !important; }

/* ============================================
   STAT CARDS (Dashboard KPI)
   ============================================ */
.stat-card {
  border-radius: var(--card-radius);
  padding: 20px 24px;
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0,0,0,0.12);
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.18);
}

.stat-card-primary   { background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%); }
.stat-card-success   { background: linear-gradient(135deg, #2ec4b6 0%, #1a7a73 100%); }
.stat-card-warning   { background: linear-gradient(135deg, #f4a261 0%, #e76f51 100%); }
.stat-card-danger    { background: linear-gradient(135deg, #e63946 0%, #a4161a 100%); }

.stat-card-icon {
  font-size: 2.5rem;
  opacity: 0.25;
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
}

.stat-card-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  opacity: 0.85;
  margin-bottom: 6px;
}

.stat-card-value {
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-card-sub {
  font-size: 0.78rem;
  opacity: 0.75;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  border-radius: 6px !important;
  font-size: 0.875rem !important;
  font-weight: 500 !important;
  transition: var(--transition) !important;
  padding: 6px 16px !important;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important;
  border-color: var(--primary-dark) !important;
  box-shadow: 0 2px 8px rgba(67,97,238,0.3) !important;
}

.btn-primary:hover {
  box-shadow: 0 4px 14px rgba(67,97,238,0.45) !important;
  transform: translateY(-1px);
}

.btn-success {
  background: linear-gradient(135deg, #2ec4b6, #1aa39a) !important;
  border-color: #1aa39a !important;
}

.btn-danger {
  background: linear-gradient(135deg, #e63946, #c1121f) !important;
  border-color: #c1121f !important;
}

.btn-warning {
  background: linear-gradient(135deg, #f4a261, #e07c3a) !important;
  border-color: #e07c3a !important;
  color: #fff !important;
}

.btn-sm {
  padding: 4px 10px !important;
  font-size: 0.8rem !important;
}

.btn-tool {
  color: rgba(255,255,255,0.8) !important;
}

.btn-tool:hover {
  color: #fff !important;
}

/* ============================================
   TABLES
   ============================================ */
.table {
  font-size: 0.875rem;
}

.table thead th {
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #666;
  border-top: none !important;
  border-bottom: 2px solid #e8ecf0 !important;
  padding: 12px 16px !important;
  background-color: #f8f9fa;
}

.table td {
  padding: 10px 16px !important;
  vertical-align: middle !important;
  border-top: 1px solid #f0f2f5 !important;
}

.table-hover tbody tr:hover {
  background-color: #f5f7ff !important;
}

/* ============================================
   FORMS
   ============================================ */
.form-control {
  border-radius: 6px !important;
  border-color: #d8dce3 !important;
  font-size: 0.875rem !important;
  transition: var(--transition) !important;
  padding: 8px 12px !important;
}

.form-control:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(67,97,238,0.12) !important;
}

.input-group-text {
  border-color: #d8dce3 !important;
  background-color: #f8f9fa !important;
  font-size: 0.875rem !important;
  border-radius: 6px 0 0 6px !important;
}

/* ============================================
   FOOTER
   ============================================ */
.main-footer {
  background: #fff !important;
  border-top: 1px solid #e8ecf0 !important;
  color: #888 !important;
  font-size: 0.82rem !important;
  padding: 12px 20px !important;
}

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-page {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%) !important;
}

.login-box {
  width: 380px !important;
}

.login-box .card {
  border-radius: 16px !important;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3) !important;
  overflow: hidden;
}

.login-box .card-header {
  background: #fff !important;
  padding: 30px 20px 20px !important;
  border-bottom: 1px solid #f0f2f5 !important;
}

.login-box .card-header img {
  max-height: 60px;
  width: auto;
}

.login-box-msg {
  color: #888 !important;
  font-size: 0.9rem !important;
  margin-bottom: 20px !important;
}

/* ============================================
   BADGE & PILLS
   ============================================ */
.badge {
  border-radius: 4px !important;
  font-size: 0.72rem !important;
  font-weight: 600 !important;
  padding: 3px 8px !important;
}

/* ============================================
   MOBILE FRIENDLY
   ============================================ */
@media (max-width: 767.98px) {
  /* Sidebar overlay on mobile */
  .sidebar-mini.sidebar-open .main-sidebar {
    z-index: 1050;
  }

  /* Content padding on mobile */
  .content {
    padding: 10px 12px !important;
  }

  .content-header {
    padding: 10px 12px !important;
  }

  .content-header h1 {
    font-size: 1.1rem !important;
  }

  /* Stat cards stack on mobile */
  .stat-card {
    margin-bottom: 12px;
    padding: 16px 18px;
  }

  .stat-card-value {
    font-size: 1.5rem;
  }

  /* Cards full width on mobile */
  .card {
    margin-bottom: 16px !important;
  }

  /* Table horizontal scroll */
  .table-responsive {
    border-radius: var(--card-radius);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Navbar */
  .main-header.navbar {
    padding: 0 8px;
  }

  .navbar-user-name {
    display: none;
  }

  /* Breadcrumb hide on small screens */
  .breadcrumb {
    display: none !important;
  }

  /* Footer */
  .main-footer {
    padding: 10px 12px !important;
    text-align: center;
  }

  .main-footer .float-right {
    float: none !important;
    display: block;
    margin-bottom: 4px;
  }

  /* Button groups */
  .btn-group-sm .btn,
  .btn-sm {
    padding: 5px 8px !important;
    font-size: 0.78rem !important;
  }

  /* Login box */
  .login-box {
    width: 92% !important;
    margin: 0 auto;
  }

  /* Form labels */
  .col-form-label {
    font-size: 0.875rem;
  }

  /* Chart height reduce on mobile */
  .chart canvas {
    max-height: 200px !important;
  }
}

@media (max-width: 575.98px) {
  .content-wrapper {
    min-height: calc(100vh - 58px - 42px);
  }

  /* Stack form inputs */
  .input-group {
    flex-wrap: wrap;
  }

  .input-group > .form-control {
    flex: 1 1 100%;
    border-radius: 6px !important;
  }

  .input-group-prepend {
    width: 100% !important;
  }

  .input-group-text {
    border-radius: 6px 6px 0 0 !important;
    width: 100%;
    justify-content: center;
  }
}

/* ============================================
   DARK SIDEBAR OVERRIDES (AdminLTE compat)
   ============================================ */
.sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link.active,
.sidebar-dark-success .nav-sidebar > .nav-item > .nav-link.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important;
  color: #fff !important;
}

/* ============================================
   MISC
   ============================================ */
/* Page section titles */
.section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #999;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 2px solid #f0f2f5;
}

/* Alert messages */
.alert {
  border-radius: 8px !important;
  border: none !important;
  font-size: 0.875rem;
}

/* Smooth page transitions */
.content-wrapper {
  animation: fadeIn 0.2s ease-in-out;
}

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