/**
 * Modern Layout Styles
 * Inspired by Homup Dashboard Design
 */

/* =============================================================================
   LAYOUT STRUCTURE
   ============================================================================= */

.modern-layout-wrapper {
  position: relative;
  min-height: 100vh;
}

/* =============================================================================
   SIDEBAR STYLES
   ============================================================================= */

.modern-sidebar {
  width: 280px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.modern-sidebar.sidebar-collapsed {
  width: 80px;
}

.modern-sidebar.sidebar-collapsed .sidebar-text,
.modern-sidebar.sidebar-collapsed .sidebar-header .logo-wrapper span:not(:first-child),
.modern-sidebar.sidebar-collapsed .sidebar-footer > div > div:last-child {
  opacity: 0;
  visibility: hidden;
}

.modern-sidebar.sidebar-collapsed .nav-item {
  justify-content: center;
  padding-left: 1rem;
  padding-right: 1rem;
}

/* Sidebar Header */
.sidebar-header {
  background: linear-gradient(180deg, rgba(193, 255, 114, 0.05) 0%, transparent 100%);
}

.logo-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Navigation Items */
.nav-item {
  position: relative;
  font-size: 0.95rem;
}

.nav-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: #C1FF72;
  opacity: 0;
  transition: opacity 0.2s ease;
  border-radius: 0 4px 4px 0;
}

.nav-item.bg-\[#C1FF72\]::before {
  opacity: 1;
}

.nav-item:hover {
  transform: translateX(2px);
}

/* Scrollbar for sidebar navigation */
.sidebar-nav::-webkit-scrollbar {
  width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Sidebar Footer */
.sidebar-footer {
  backdrop-filter: blur(10px);
}

/* Search in Sidebar */
#sidebar-search:focus {
  background: rgba(255, 255, 255, 0.15);
}

/* =============================================================================
   HEADER STYLES
   ============================================================================= */

.modern-header {
  left: 280px;
  width: calc(100% - 280px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  height: 72px;
  backdrop-filter: blur(10px);
  background: linear-gradient(to right, rgba(193, 255, 114, 0.03), rgba(255, 255, 255, 1));
  box-shadow: 0 1px 3px rgba(10, 26, 22, 0.05);
}

.sidebar-collapsed ~ .modern-header {
  left: 80px;
  width: calc(100% - 80px);
}

/* Header button hover effects */
.modern-header button {
  transition: all 0.2s ease;
}

.modern-header button:hover {
  transform: scale(1.05);
}

.modern-header button:active {
  transform: scale(0.95);
}

/* =============================================================================
   MAIN CONTENT STYLES
   ============================================================================= */

.main-content {
  margin-left: 280px;
  margin-top: 72px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: calc(100vh - 72px);
}

.main-content.content-expanded {
  margin-left: 80px;
}

.content-wrapper {
  max-width: 1600px;
  margin: 0 auto;
}

/* =============================================================================
   DASHBOARD CARDS (KPI Metrics)
   ============================================================================= */

.metric-card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  border: 1px solid #f3f4f6;
}

.metric-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  border-color: #C1FF72;
}

.metric-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.metric-card-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  color: #0A1A16;
}

.metric-card-label {
  font-size: 0.875rem;
  color: #6b7280;
  margin-top: 0.25rem;
}

.metric-card-trend {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

.metric-card-trend.positive {
  color: #00FF87;
}

.metric-card-trend.negative {
  color: #ef4444;
}

/* Progress Bar in Cards */
.progress-bar {
  height: 8px;
  background: #f3f4f6;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 1rem;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #C1FF72 0%, #00FF87 100%);
  transition: width 0.6s ease;
  border-radius: 4px;
}

/* =============================================================================
   MODERN TABLE COMPONENT
   ============================================================================= */

.modern-table-wrapper {
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  border: 1px solid #f3f4f6;
}

.modern-table {
  width: 100%;
  border-collapse: collapse;
}

.modern-table thead {
  background: #f9fafb;
  border-bottom: 2px solid #e5e7eb;
}

.modern-table th {
  padding: 1rem 1.5rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
}

.modern-table tbody tr {
  border-bottom: 1px solid #f3f4f6;
  transition: background-color 0.2s ease;
}

.modern-table tbody tr:hover {
  background: #f9fafb;
}

.modern-table tbody tr:last-child {
  border-bottom: none;
}

.modern-table td {
  padding: 1rem 1.5rem;
  font-size: 0.875rem;
  color: #1f2937;
}

/* Table Actions */
.table-action-btn {
  padding: 0.5rem;
  border-radius: 6px;
  transition: all 0.2s ease;
  color: #6b7280;
}

.table-action-btn:hover {
  background: #f3f4f6;
  color: #0A1A16;
}

/* =============================================================================
   CHART CONTAINERS
   ============================================================================= */

.chart-card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border: 1px solid #f3f4f6;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.chart-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #0A1A16;
}

.chart-container {
  position: relative;
  height: 300px;
}

/* =============================================================================
   BUTTONS & ACTIONS
   ============================================================================= */

.btn-primary {
  background: linear-gradient(135deg, #C1FF72 0%, #00FF87 100%);
  color: #0A1A16;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(193, 255, 114, 0.4);
}

.btn-secondary {
  background: white;
  color: #0A1A16;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  border: 1px solid #e5e7eb;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: #f9fafb;
  border-color: #C1FF72;
}

/* =============================================================================
   BADGES & PILLS
   ============================================================================= */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-success {
  background: rgba(0, 255, 135, 0.1);
  color: #00FF87;
}

.badge-warning {
  background: rgba(251, 191, 36, 0.1);
  color: #f59e0b;
}

.badge-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.badge-info {
  background: rgba(193, 255, 114, 0.1);
  color: #0A1A16;
}

/* =============================================================================
   MOBILE RESPONSIVENESS
   ============================================================================= */

@media (max-width: 1024px) {
  .modern-sidebar {
    transform: translateX(-100%);
  }
  
  .modern-sidebar.sidebar-open {
    transform: translateX(0);
  }
  
  .modern-header {
    left: 0;
    width: 100%;
  }
  
  .main-content {
    margin-left: 0;
  }
  
  #sidebar-overlay.active {
    display: block !important;
    pointer-events: auto;
  }
}

@media (max-width: 768px) {
  .modern-header {
    height: 64px;
  }
  
  .main-content {
    margin-top: 64px;
  }
  
  .content-wrapper {
    padding: 1rem;
  }
  
  .metric-card {
    padding: 1rem;
  }
  
  .metric-card-value {
    font-size: 1.5rem;
  }
  
  .modern-table th,
  .modern-table td {
    padding: 0.75rem 1rem;
  }
}

/* =============================================================================
   ANIMATIONS
   ============================================================================= */

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.animate-slide-in {
  animation: slideInRight 0.4s ease-out;
}

.animate-fade-in {
  animation: fadeIn 0.3s ease-out;
}

/* =============================================================================
   DROPDOWN MENUS
   ============================================================================= */

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  border: 1px solid #e5e7eb;
  min-width: 200px;
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
}

.dropdown-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu-item {
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #374151;
  transition: background-color 0.2s ease;
  cursor: pointer;
}

.dropdown-menu-item:hover {
  background: #f9fafb;
}

.dropdown-menu-item i {
  width: 20px;
  text-align: center;
  color: #6b7280;
}

.dropdown-divider {
  height: 1px;
  background: #e5e7eb;
  margin: 0.5rem 0;
}
