/* Admin Panel Styles */
:root {
  --admin-bg: #f5f5f5;
  --admin-panel: #ffffff;
  --admin-text: #333333;
  --admin-muted: #666666;
  --admin-accent: #007bff;
  --admin-danger: #dc3545;
  --admin-success: #28a745;
  --admin-shadow: 0 2px 10px rgba(0,0,0,0.1);
  --sidebar-width: 250px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', Segoe UI, Arial, sans-serif;
  background: var(--admin-bg);
  color: var(--admin-text);
}

.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
  width: var(--sidebar-width);
  background: var(--admin-panel);
  border-right: 1px solid #e0e0e0;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 2rem 1.5rem;
  border-bottom: 1px solid #e0e0e0;
  text-align: center;
}

.sidebar-header h2 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.sidebar-header p {
  color: var(--admin-muted);
  font-size: 0.9rem;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0;
}

.nav-link {
  display: block;
  padding: 0.75rem 1.5rem;
  color: var(--admin-text);
  text-decoration: none;
  transition: background 0.3s;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-link:hover,
.nav-link.active {
  background: var(--admin-accent);
  color: white;
}

.nav-link i {
  width: 20px;
}

.sidebar-footer {
  padding: 1.5rem;
  border-top: 1px solid #e0e0e0;
}

.logout-link {
  display: block;
  color: var(--admin-danger);
  text-decoration: none;
  text-align: center;
  font-weight: 500;
}

/* Main Content */
.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.admin-header {
  background: var(--admin-panel);
  padding: 1.5rem 2rem;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-header h1 {
  font-size: 1.8rem;
}

.user-info {
  color: var(--admin-muted);
}

.dashboard-content {
  padding: 2rem;
  flex: 1;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.stat-card {
  background: var(--admin-panel);
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: var(--admin-shadow);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-icon {
  width: 60px;
  height: 60px;
  background: var(--admin-accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
}

.stat-content h3 {
  font-size: 0.9rem;
  color: var(--admin-muted);
  margin-bottom: 0.5rem;
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--admin-text);
}

/* Activity */
.recent-activity h2 {
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
}

.activity-list {
  background: var(--admin-panel);
  border-radius: 8px;
  box-shadow: var(--admin-shadow);
  overflow: hidden;
}

.activity-item {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-icon {
  width: 40px;
  height: 40px;
  background: var(--admin-success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.activity-content p {
  margin-bottom: 0.25rem;
  font-weight: 500;
}

.activity-time {
  font-size: 0.8rem;
  color: var(--admin-muted);
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
}

.form-group textarea {
  min-height: 120px;
  resize: vertical;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 4px;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
}

.btn-primary {
  background: var(--admin-accent);
  color: white;
}

.btn-primary:hover {
  background: #0056b3;
}

.btn-danger {
  background: var(--admin-danger);
  color: white;
}

.btn-danger:hover {
  background: #c82333;
}

.btn-block {
  width: 100%;
}

/* Alerts */
.alert {
  padding: 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.alert-error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.alert-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

/* Login Page */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--admin-bg);
}

.login-container {
  width: 100%;
  max-width: 400px;
  padding: 2rem;
}

.login-box {
  background: var(--admin-panel);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: var(--admin-shadow);
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-header h1 {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

.login-header p {
  color: var(--admin-muted);
}

.login-form {
  margin-top: 2rem;
}

/* Content area */
.content-area {
  padding: 2rem;
  flex: 1;
}

.page-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.page-actions h2 {
  margin: 0;
  font-size: 1.2rem;
}

/* Buttons extra */
.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.82rem;
}

.btn-secondary {
  background: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background: #545b62;
  color: white;
}

.btn-success {
  background: var(--admin-success);
  color: white;
}

/* Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--admin-panel);
}

.data-table th,
.data-table td {
  padding: 0.8rem 1rem;
  text-align: left;
  border-bottom: 1px solid #e0e0e0;
  font-size: 0.9rem;
}

.data-table th {
  background: #f8f9fa;
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--admin-muted);
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: #f8f9fa;
}

/* Cards */
.content-section {
  background: var(--admin-panel);
  padding: 1.5rem;
  box-shadow: var(--admin-shadow);
  margin-bottom: 1.5rem;
}

.content-section > h2:first-child {
  font-size: 1.15rem;
  margin-bottom: 1.2rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid var(--admin-accent);
}

.content-block {
  background: #f8f9fa;
  padding: 1.2rem;
  margin-bottom: 1rem;
  border-left: 3px solid var(--admin-accent);
}

.content-block h3 {
  font-size: 0.95rem;
  margin-bottom: 1rem;
  color: var(--admin-muted);
}

/* Form rows */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 2px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-success { background: #d4edda; color: #155724; }
.badge-warning  { background: #fff3cd; color: #856404; }
.badge-danger   { background: #f8d7da; color: #721c24; }

/* Media grid */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
}

.media-item {
  background: var(--admin-panel);
  border: 1px solid #e0e0e0;
  padding: 0.5rem;
  text-align: center;
}

.media-item img {
  width: 100%;
  height: 90px;
  object-fit: cover;
  display: block;
  margin-bottom: 0.4rem;
}

.media-item .file-name {
  font-size: 0.72rem;
  color: var(--admin-muted);
  word-break: break-all;
  line-height: 1.3;
}

/* Responsive */
@media (max-width: 768px) {
  .admin-layout {
    flex-direction: column;
  }

  .admin-sidebar {
    width: 100%;
    order: 2;
  }

  .admin-header {
    order: 1;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .media-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
}