/* Admin Dashboard Styles - Based on Adminator Template */

:root {
  --primary-color: #007bff;
  --secondary-color: #6c757d;
  --success-color: #28a745;
  --danger-color: #dc3545;
  --warning-color: #ffc107;
  --info-color: #17a2b8;
  --light-color: #f8f9fa;
  --dark-color: #343a40;
  --sidebar-width: 250px;
  --header-height: 70px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: #f5f5f5;
  color: #333;
  line-height: 1.6;
}

/* Loader */
.loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease;
}

.loader.fade-out {
  opacity: 0;
  pointer-events: none;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Layout */
.admin-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: #fff;
  box-shadow: 2px 0 5px rgba(0,0,0,0.1);
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  z-index: 1000;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid #eee;
  text-align: center;
}

.sidebar-header h2 {
  color: var(--primary-color);
  font-size: 1.5rem;
  font-weight: 600;
}

.sidebar-nav {
  padding: 20px 0;
}

.sidebar-nav ul {
  list-style: none;
}

.sidebar-nav li {
  margin-bottom: 5px;
}

.sidebar-nav a {
  display: block;
  padding: 12px 20px;
  color: #666;
  text-decoration: none;
  transition: all 0.3s ease;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: var(--primary-color);
  color: #fff;
}

.sidebar-nav i {
  margin-right: 10px;
  width: 20px;
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

/* Header */
.header {
  background: #fff;
  height: var(--header-height);
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  position: sticky;
  top: 0;
  z-index: 999;
}

.header-title {
  font-size: 1.5rem;
  color: var(--dark-color);
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 8px 15px;
  border-radius: 5px;
  transition: background 0.3s ease;
}

.user-menu:hover {
  background: var(--light-color);
}

.user-avatar {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
}

/* Content Area */
.content {
  padding: 30px;
}

/* Dashboard Cards */
.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.card {
  background: #fff;
  border-radius: 8px;
  padding: 25px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  border: 1px solid #eee;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: between;
  margin-bottom: 15px;
}

.card-title {
  font-size: 1.1rem;
  color: var(--dark-color);
  font-weight: 600;
}

.card-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 10px;
}

.card-description {
  color: var(--secondary-color);
  font-size: 0.9rem;
}

/* Stats Cards */
.stat-card {
  text-align: center;
}

.stat-card.success .card-value { color: var(--success-color); }
.stat-card.warning .card-value { color: var(--warning-color); }
.stat-card.danger .card-value { color: var(--danger-color); }
.stat-card.info .card-value { color: var(--info-color); }

/* Tables */
.table-container {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  overflow: hidden;
  margin-bottom: 30px;
}

.table-header {
  padding: 20px 25px;
  border-bottom: 1px solid #eee;
  background: var(--light-color);
}

.table-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--dark-color);
}

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

.table th,
.table td {
  padding: 15px 25px;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.table th {
  background: var(--light-color);
  font-weight: 600;
  color: var(--dark-color);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.table tbody tr:hover {
  background: #f8f9fa;
}

/* Subdomain Link Styles */
.subdomain-link {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  transition: all 0.2s ease;
}

.subdomain-link:hover {
  color: var(--primary-color);
  text-decoration: underline;
  opacity: 0.8;
}

.subdomain-link i {
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.subdomain-link:hover i {
  opacity: 1;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 20px;
  background: var(--primary-color);
  color: #fff;
  text-decoration: none;
  border-radius: 5px;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn:hover {
  background: #0056b3;
  transform: translateY(-1px);
}

.btn-secondary { background: var(--secondary-color); }
.btn-success { background: var(--success-color); }
.btn-danger { background: var(--danger-color); }
.btn-warning { background: var(--warning-color); }
.btn-info { background: var(--info-color); }

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

/* Status Badges */
.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-success { background: var(--success-color); color: #fff; }
.badge-warning { background: var(--warning-color); color: #000; }
.badge-danger { background: var(--danger-color); color: #fff; }
.badge-info { background: var(--info-color); color: #fff; }
.badge-secondary { background: var(--secondary-color); color: #fff; }

/* Forms */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--dark-color);
}

.form-control {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

/* Modals */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 10000;
}

.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: #fff;
  border-radius: 8px;
  padding: 30px;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  
  .sidebar.show {
    transform: translateX(0);
  }
  
  .main-content {
    margin-left: 0;
  }
  
  .dashboard-cards {
    grid-template-columns: 1fr;
  }
  
  .content {
    padding: 15px;
  }
}

/* Form Actions */
.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
}

@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: block !important;
  }
}

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }