/**
 * VEHYLY - Admin Panel Styles
 */

/* Overlay */
.admin-panel-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

/* Panel principal */
.admin-panel {
  background: linear-gradient(145deg, #ffffff, #f0f0f0);
  border-radius: 20px;
  width: 100%;
  max-width: 1200px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), inset 0 2px 4px rgba(255,255,255,1);
  animation: slideUp 0.3s ease;
}

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

/* Header */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 32px;
  border-bottom: 2px solid rgba(0,0,0,0.1);
  background: linear-gradient(145deg, #5ab0ff, #2979ff);
  color: white;
  box-shadow: 0 4px 12px rgba(41,121,255,0.3), inset 0 1px 0 rgba(255,255,255,0.5);
}

.admin-header h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 900;
}

.admin-close-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border-radius: 50%;
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
  transition: all 0.2s;
}

.admin-close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

/* Tabs */
.admin-tabs {
  display: flex;
  gap: 0;
  padding: 0 32px;
  background: linear-gradient(180deg, #f8f8f8, #e8e8e8);
  border-bottom: 2px solid rgba(0,0,0,0.1);
}

.admin-tab {
  padding: 16px 24px;
  border: none;
  background: transparent;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s;
  border-bottom: 3px solid transparent;
  color: #666;
}

.admin-tab:hover {
  background: rgba(41, 121, 255, 0.05);
  color: #2979FF;
}

.admin-tab.active {
  color: #2979FF;
  border-bottom-color: #2979FF;
  background: linear-gradient(145deg, #ffffff, #f0f0f0);
  box-shadow: 0 2px 6px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,1);
}

/* Content */
.admin-content {
  flex: 1;
  overflow-y: auto;
  padding: 32px;
}

.admin-loading {
  text-align: center;
  padding: 48px;
  color: #666;
  font-size: 16px;
}

.admin-error {
  text-align: center;
  padding: 48px;
  color: #ef4444;
  font-size: 16px;
}

/* Stats Grid */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.admin-stat-card {
  background: linear-gradient(145deg, #ffffff, #f0f0f0);
  border: 2px solid rgba(0,0,0,0.1);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1), inset 0 1px 0 rgba(255,255,255,1);
}

.admin-stat-card:hover {
  border-color: #2979FF;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(41, 121, 255, 0.2), inset 0 2px 4px rgba(255,255,255,1);
}

.admin-stat-card.pending {
  border-color: #f59e0b;
  background: linear-gradient(135deg, #fff7ed 0%, #fef3c7 100%);
}

.admin-stat-card.approved {
  border-color: #22c55e;
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.admin-stat-card.rejected {
  border-color: #ef4444;
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
}

.stat-number {
  font-size: 48px;
  font-weight: 900;
  color: #1a1a1a;
  line-height: 1;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 14px;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Sections */
.admin-section {
  margin-bottom: 40px;
}

.admin-section h3 {
  margin: 0 0 20px 0;
  font-size: 20px;
  font-weight: 800;
  color: #1a1a1a;
}

.empty-state {
  text-align: center;
  padding: 48px;
  color: #999;
  font-size: 15px;
}

/* Vendor Cards */
.vendors-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.vendor-card {
  background: linear-gradient(145deg, #ffffff, #f0f0f0);
  border: 2px solid rgba(0,0,0,0.1);
  border-radius: 16px;
  padding: 20px;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1), inset 0 1px 0 rgba(255,255,255,1);
}

.vendor-card:hover {
  border-color: #2979FF;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15), inset 0 2px 4px rgba(255,255,255,1);
}

.vendor-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.vendor-icon {
  font-size: 40px;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #f0f0f0, #e0e0e0);
  border-radius: 12px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,1);
}

.vendor-info {
  flex: 1;
}

.vendor-info h4 {
  margin: 0 0 8px 0;
  font-size: 18px;
  font-weight: 800;
  color: #1a1a1a;
}

.vendor-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.vendor-type {
  padding: 4px 12px;
  background: #f0f9ff;
  color: #2979FF;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
}

.vendor-date {
  font-size: 13px;
  color: #666;
}

.vendor-status {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.vendor-status.status-pending {
  background: #fff7ed;
  color: #f59e0b;
}

.vendor-status.status-approved {
  background: #f0fdf4;
  color: #22c55e;
}

.vendor-status.status-rejected {
  background: #fef2f2;
  color: #ef4444;
}

/* Vendor Details */
.vendor-details {
  padding: 16px;
  background: linear-gradient(145deg, #f8f8f8, #e8e8e8);
  border-radius: 12px;
  margin-bottom: 16px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}

.detail-row {
  padding: 8px 0;
  font-size: 14px;
  color: #444;
  line-height: 1.5;
}

.detail-row strong {
  color: #1a1a1a;
  font-weight: 700;
  margin-right: 8px;
}

/* Vendor Actions */
.vendor-actions {
  display: flex;
  gap: 12px;
}

.admin-btn {
  flex: 1;
  padding: 12px 20px;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.3);
}

.approve-btn {
  background: linear-gradient(145deg, #34d399, #22c55e);
  color: white;
}

.approve-btn:hover {
  background: linear-gradient(145deg, #22c55e, #16a34a);
  transform: scale(1.02);
  box-shadow: 0 6px 16px rgba(34,197,94,0.4), inset 0 1px 0 rgba(255,255,255,0.4);
}

.reject-btn {
  background: linear-gradient(145deg, #f87171, #ef4444);
  color: white;
}

.reject-btn:hover {
  background: linear-gradient(145deg, #ef4444, #dc2626);
  transform: scale(1.02);
  box-shadow: 0 6px 16px rgba(239,68,68,0.4), inset 0 1px 0 rgba(255,255,255,0.4);
}

/* Users Table */
.users-table {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: linear-gradient(145deg, #ffffff, #f0f0f0);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1), inset 0 1px 0 rgba(255,255,255,1);
}

.admin-table thead {
  background: linear-gradient(180deg, #f8f8f8, #e8e8e8);
}

.admin-table th {
  padding: 16px;
  text-align: left;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #666;
  border-bottom: 2px solid #e5e5e5;
}

.admin-table td {
  padding: 16px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 14px;
  color: #444;
}

.admin-table tr:hover {
  background: linear-gradient(145deg, #fafafa, #f0f0f0);
}

.type-badge {
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
}

.type-badge.client {
  background: #f0f9ff;
  color: #2979FF;
}

.type-badge.professional {
  background: #f0fdf4;
  color: #22c55e;
}

.type-badge.vendor {
  background: #fef3c7;
  color: #f59e0b;
}

.type-badge.admin {
  background: #fef2f2;
  color: #ef4444;
}

/* Admin Button in Settings */
.admin-option {
  border-left: 4px solid #ef4444 !important;
  background: linear-gradient(90deg, #fef2f2 0%, white 100%) !important;
}

.admin-option:hover {
  background: linear-gradient(90deg, #fee2e2 0%, #fef2f2 100%) !important;
}

/* Responsive */
@media (max-width: 768px) {
  .admin-panel {
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }
  
  .admin-header,
  .admin-content {
    padding: 20px;
  }
  
  .admin-tabs {
    padding: 0 20px;
    overflow-x: auto;
  }
  
  .admin-tab {
    padding: 12px 16px;
    font-size: 14px;
  }
  
  .admin-stats-grid {
    grid-template-columns: 1fr;
  }
  
  .vendor-header {
    flex-wrap: wrap;
  }
  
  .vendor-actions {
    flex-direction: column;
  }
  
  .admin-table {
    font-size: 13px;
  }
  
  .admin-table th,
  .admin-table td {
    padding: 12px 8px;
  }
}
