/* ===== CUSTOM STYLES ===== */

/* Sidebar */
.sidebar {
  width: 250px;
  min-height: 100vh;
  transition: width 0.3s ease;
}
.sidebar.collapsed {
  width: 64px;
}
.sidebar.collapsed .sidebar-text {
  display: none;
}
.sidebar.collapsed .sidebar-logo-text {
  display: none;
}

/* Sidebar link */
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: 8px;
  color: #a3a3a3;
  transition: all 0.2s ease;
  white-space: nowrap;
  overflow: hidden;
}
.sidebar-link:hover {
  background: rgba(249, 115, 22, 0.15);
  color: #f97316;
}
.sidebar-link.active {
  background: rgba(249, 115, 22, 0.2);
  color: #f97316;
  font-weight: 600;
}
.sidebar-link svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

/* Profile dropdown */
.profile-dropdown {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s ease;
}
.profile-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Stat cards */
.stat-card {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Modal */
.modal-overlay {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease;
}
.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}
.modal-overlay .modal-box {
  transform: scale(0.9);
  transition: transform 0.25s ease;
}
.modal-overlay.show .modal-box {
  transform: scale(1);
}

/* Slide down animation for conditional fields */
.slide-down {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.3s ease;
}
.slide-down.open {
  max-height: 600px;
  opacity: 1;
}

/* Smooth page-like fade */
.page-fade {
  animation: pageFadeIn 0.35s ease forwards;
}
@keyframes pageFadeIn {
  from { opacity: 0;  }
  to { opacity: 1;  }
}

/* Table row hover */
.table-row-hover {
  transition: background 0.15s ease;
}
.table-row-hover:hover {
  background: #f5f5f5;
}

/* Button base */
.btn-primary {
  background: #f97316;
  color: #fff;
  padding: 10px 24px;
  border-radius: 8px;
  font-weight: 600;
  transition: background 0.2s ease, transform 0.15s ease;
  border: none;
  cursor: pointer;
}
.btn-primary:hover {
  background: #ea580c;
  transform: translateY(-1px);
}
.btn-secondary {
  background: #1a1a1a;
  color: #fff;
  padding: 10px 24px;
  border-radius: 8px;
  font-weight: 600;
  transition: background 0.2s ease, transform 0.15s ease;
  border: none;
  cursor: pointer;
}
.btn-secondary:hover {
  background: #333;
  transform: translateY(-1px);
}
.btn-outline {
  background: transparent;
  color: #f97316;
  padding: 10px 24px;
  border-radius: 8px;
  font-weight: 600;
  border: 2px solid #f97316;
  transition: all 0.2s ease;
  cursor: pointer;
}
.btn-outline:hover {
  background: #f97316;
  color: #fff;
}
.btn-danger {
  background: #ef4444;
  color: #fff;
  padding: 10px 24px;
  border-radius: 8px;
  font-weight: 600;
  transition: background 0.2s ease;
  border: none;
  cursor: pointer;
}
.btn-danger:hover {
  background: #dc2626;
}
.btn-success {
  background: #22c55e;
  color: #fff;
  padding: 10px 24px;
  border-radius: 8px;
  font-weight: 600;
  transition: background 0.2s ease;
  border: none;
  cursor: pointer;
}
.btn-success:hover {
  background: #16a34a;
}

/* Auth page gradient */
.auth-gradient {
  background: linear-gradient(135deg, #1a1a1a 0%, #292524 50%, #f97316 100%);
  background-size: 200% 200%;
  animation: gradientShift 6s ease infinite;
}
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Input focus */
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #f97316;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: #f1f1f1;
}
::-webkit-scrollbar-thumb {
  background: #c4c4c4;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #a0a0a0;
}

/* Mobile sidebar overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 30;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.sidebar-overlay.show {
  display: block;
  opacity: 1;
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: -260px;
    z-index: 40;
    transition: left 0.3s ease;
  }
  .sidebar.mobile-open {
    left: 0;
  }
  .sidebar.collapsed {
    width: 250px;
    left: -260px;
  }
  .sidebar.collapsed.mobile-open {
    left: 0;
  }
  .sidebar.collapsed .sidebar-text {
    display: inline;
  }
}
