/* Admin Dashboard */
.admin-dashboard {
  padding: 4rem 0;
}

.dashboard-header {
  text-align: center;
  margin-bottom: 3rem;
}

.dashboard-title {
  font-size: 2.5rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 0.5rem;
}

.dashboard-subtitle {
  font-size: 1.125rem;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.stat-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.3s;
}

.stat-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-3px);
}

.stat-icon {
  font-size: 2.5rem;
}

.stat-content {
  flex: 1;
}

.stat-value {
  font-size: 1.875rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 0.25rem;
}

.stat-label {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.6);
}

/* Control Panel */
.control-panel,
.create-panel,
.articles-panel {
  margin-bottom: 3rem;
}

.panel-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 1.5rem;
}

.control-card,
.form-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  padding: 2rem;
}

.control-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.control-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.control-row:first-child {
  padding-top: 0;
}

.control-info h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #ffffff;
  margin: 0 0 0.25rem;
}

.control-info p {
  font-size: 0.9375rem;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 32px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  transition: 0.4s;
  border-radius: 32px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 24px;
  width: 24px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
}

input:checked + .toggle-slider:before {
  transform: translateX(28px);
}

/* Action Button */
.btn-action {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  color: #ffffff;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
  padding: 0.625rem 1.25rem;
  border-radius: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
  display: inline-block;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Form Styles */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 0.5rem;
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.9375rem;
  font-family: 'Inter', sans-serif;
  transition: all 0.3s;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.08);
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-textarea {
  resize: vertical;
}

.form-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1rem;
}

.btn-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  color: #ffffff;
  border: none;
  padding: 1rem;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  margin-top: 0.5rem;
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(59, 130, 246, 0.4);
}

/* Articles Table */
.articles-table {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  overflow: hidden;
}

.article-row {
  display: grid;
  grid-template-columns: 60px 2fr 1fr 1fr 120px 100px;
  gap: 1rem;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.3s;
}

.article-row:hover {
  background: rgba(255, 255, 255, 0.05);
}

.article-row:last-child {
  border-bottom: none;
}

.article-row-header {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.875rem;
  background: rgba(255, 255, 255, 0.05);
}

.article-row-header:hover {
  background: rgba(255, 255, 255, 0.05);
}

.article-icon-cell {
  font-size: 1.5rem;
  text-align: center;
}

.article-title-cell {
  font-weight: 600;
  color: #ffffff;
}

.article-category-cell {
  display: inline-block;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  width: fit-content;
}

.article-date-cell {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.875rem;
}

.article-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-delete {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #ef4444;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-delete:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.3);
}

/* Light Theme */
body.light-theme .dashboard-title {
  color: #1e293b;
}

body.light-theme .dashboard-subtitle {
  color: #64748b;
}

body.light-theme .panel-title {
  color: #1e293b;
}

body.light-theme .stat-card,
body.light-theme .control-card,
body.light-theme .form-card,
body.light-theme .articles-table {
  background: #ffffff;
  border-color: #e2e8f0;
}

body.light-theme .stat-value {
  color: #1e293b;
}

body.light-theme .stat-label {
  color: #64748b;
}

body.light-theme .control-info h3 {
  color: #1e293b;
}

body.light-theme .control-info p {
  color: #64748b;
}

body.light-theme .control-row {
  border-bottom-color: #e2e8f0;
}

body.light-theme .form-group label {
  color: #1e293b;
}

body.light-theme .form-input,
body.light-theme .form-textarea,
body.light-theme .form-select {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #1e293b;
}

body.light-theme .form-input:focus,
body.light-theme .form-textarea:focus,
body.light-theme .form-select:focus {
  background: #ffffff;
  border-color: #3b82f6;
}

body.light-theme .article-row {
  border-bottom-color: #e2e8f0;
}

body.light-theme .article-row:hover {
  background: #f8fafc;
}

body.light-theme .article-row-header {
  color: #64748b;
  background: #f8fafc;
}

body.light-theme .article-title-cell {
  color: #1e293b;
}

body.light-theme .article-date-cell {
  color: #64748b;
}

/* Responsive */
@media (max-width: 968px) {
  .article-row {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  .article-row > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  .article-row > div::before {
    content: attr(data-label);
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
  }
  
  .article-row-header {
    display: none;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .dashboard-title {
    font-size: 2rem;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .control-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
}
