/* XenieBooks Admin Panel Styles */
:root {
  --primary-color: #453C89;
  --primary-dark: #3a2f73;
  --primary-light: #6b5fb5;
  --accent-color: #FACC15;
  --success-color: #3c8957;
  --danger-color: #dc3545;
  --warning-color: #ffc107;
  --bg-light: #f8f9fa;
  --bg-dark: #1a1a2e;
  --text-dark: #333;
  --text-light: #666;
  --border-color: #dee2e6;
  --sidebar-width: 260px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-light);
  color: var(--text-dark);
  line-height: 1.6;
}

/* Sidebar */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: linear-gradient(180deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 20px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.sidebar-logo {
  text-align: center;
  padding: 20px 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 30px;
}

.sidebar-logo h2 {
  font-size: 24px;
  font-weight: bold;
  color: var(--accent-color);
}

.sidebar-logo p {
  font-size: 12px;
  color: rgba(255,255,255,0.7);
  margin-top: 5px;
}

.sidebar-menu {
  list-style: none;
}

.sidebar-menu li {
  margin-bottom: 10px;
}

.sidebar-menu a {
  display: flex;
  align-items: center;
  padding: 12px 15px;
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  border-radius: 10px;
  transition: all 0.3s ease;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
  background-color: rgba(255,255,255,0.1);
  color: white;
  transform: translateX(5px);
}

.sidebar-menu a i {
  margin-right: 12px;
  font-size: 18px;
}

/* Main Content */
.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  background-color: var(--bg-light);
}

.topbar {
  background: white;
  padding: 15px 30px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 999;
}

.topbar-left h1 {
  font-size: 24px;
  color: var(--text-dark);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 18px;
}

.content-wrapper {
  padding: 30px;
}

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

.stat-card {
  background: white;
  padding: 25px;
  border-radius: 15px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 20px rgba(69, 60, 137, 0.2);
}

.stat-card h3 {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-card .stat-value {
  font-size: 36px;
  font-weight: bold;
  color: var(--primary-color);
  margin-bottom: 5px;
}

.stat-card .stat-label {
  font-size: 14px;
  color: var(--text-light);
}

/* Tables */
.data-table {
  background: white;
  border-radius: 15px;
  padding: 25px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.data-table h2 {
  margin-bottom: 20px;
  color: var(--text-dark);
}

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

thead {
  background-color: var(--bg-light);
}

th {
  padding: 15px;
  text-align: left;
  font-weight: 600;
  color: var(--text-dark);
  border-bottom: 2px solid var(--border-color);
}

td {
  padding: 15px;
  border-bottom: 1px solid var(--border-color);
}

tr:hover {
  background-color: rgba(69, 60, 137, 0.02);
}

/* Buttons */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(69, 60, 137, 0.3);
}

.btn-success {
  background-color: var(--success-color);
  color: white;
}

.btn-danger {
  background-color: var(--danger-color);
  color: white;
}

.btn-warning {
  background-color: var(--warning-color);
  color: var(--text-dark);
}

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

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

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

.form-control {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.3s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(69, 60, 137, 0.1);
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

select.form-control {
  cursor: pointer;
}

/* File input styling */
input[type="file"].form-control {
  padding: 8px 12px;
  border: 2px dashed var(--border-color);
  background-color: #f8f9fa;
  cursor: pointer;
  transition: all 0.3s ease;
}

input[type="file"].form-control:hover {
  border-color: var(--primary-color);
  background-color: rgba(69, 60, 137, 0.05);
}

input[type="file"].form-control:focus {
  border-color: var(--primary-color);
  background-color: rgba(69, 60, 137, 0.05);
  box-shadow: 0 0 0 3px rgba(69, 60, 137, 0.1);
}

/* Blog thumbnail styling */
.blog-thumbnail {
  width: 60px;
  height: 40px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  transition: transform 0.3s ease;
}

.blog-thumbnail:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Status badges */
.badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.badge-success {
  background-color: #d4edda;
  color: #155724;
}

.badge-warning {
  background-color: #fff3cd;
  color: #856404;
}

.badge-danger {
  background-color: #f8d7da;
  color: #721c24;
}

.badge-primary {
  background-color: #e7e3f8;
  color: var(--primary-color);
}

/* Login Page */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
}

.login-card {
  background: white;
  padding: 40px;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  width: 100%;
  max-width: 400px;
}

.login-card h2 {
  text-align: center;
  margin-bottom: 10px;
  color: var(--primary-color);
  font-size: 28px;
}

.login-card p {
  text-align: center;
  color: var(--text-light);
  margin-bottom: 30px;
}

.alert {
  padding: 12px 15px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.alert-danger {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  
  .main-content {
    margin-left: 0;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

/* Content Area */
.content-area {
  padding: 30px;
  max-width: 1400px;
  margin: 0 auto;
}

/* Page Header */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.page-header h1 {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 5px;
}

.page-header .text-muted {
  color: var(--text-light);
  font-size: 14px;
}

/* Card */
.card {
  background: white;
  border-radius: 15px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  margin-bottom: 30px;
  overflow: hidden;
}

.card-header {
  padding: 20px 25px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #fafbfc;
}

.card-header h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-dark);
  margin: 0;
}

.card-body {
  padding: 25px;
}

.card-actions {
  display: flex;
  gap: 15px;
  align-items: center;
}

/* Search Input */
.search-input {
  padding: 10px 15px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  width: 300px;
  transition: all 0.3s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(69, 60, 137, 0.1);
}

/* Table Responsive */
.table-responsive {
  overflow-x: auto;
}

.data-table table {
  min-width: 800px;
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: 8px;
}

.action-buttons .btn {
  padding: 8px 12px;
}

.action-buttons .btn i {
  font-size: 14px;
}

/* Stat Card Improvements */
.stat-card .stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: white;
  margin-bottom: 15px;
}

.stat-card .stat-details h3 {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 5px;
}

.stat-card .stat-details p {
  font-size: 14px;
  color: var(--text-light);
  margin: 0;
}

/* Badge Enhancements */
.badge-secondary {
  background-color: #e9ecef;
  color: #495057;
}

.badge-info {
  background-color: #d1ecf1;
  color: #0c5460;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}

.empty-state i {
  font-size: 64px;
  color: var(--border-color);
  margin-bottom: 20px;
}

.empty-state h3 {
  font-size: 20px;
  color: var(--text-dark);
  margin-bottom: 10px;
}

.empty-state p {
  font-size: 14px;
  margin-bottom: 20px;
}

/* Form Grid */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.form-actions {
  display: flex;
  gap: 15px;
  align-items: center;
}

/* Checkbox */
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* Button Secondary */
.btn-secondary {
  background-color: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background-color: #5a6268;
}

/* Text Utilities */
.text-muted {
  color: var(--text-light);
  font-size: 13px;
}

/* Logout Modal */
.logout-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 9999;
  animation: fadeIn 0.3s ease;
}

.logout-modal-overlay.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.logout-modal {
  background: white;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
  width: 90%;
  max-width: 450px;
  overflow: hidden;
  animation: slideUp 0.3s ease;
}

.logout-modal-header {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 25px 30px;
  text-align: center;
}

.logout-modal-header i {
  font-size: 48px;
  margin-bottom: 10px;
  display: block;
}

.logout-modal-header h3 {
  font-size: 24px;
  margin: 0;
  font-weight: 600;
}

.logout-modal-body {
  padding: 30px;
  text-align: center;
}

.logout-modal-body p {
  font-size: 16px;
  color: var(--text-dark);
  margin: 0;
  line-height: 1.6;
}

.logout-modal-footer {
  padding: 20px 30px 30px;
  display: flex;
  gap: 15px;
  justify-content: center;
}

.logout-modal-footer .btn {
  padding: 12px 30px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 10px;
  min-width: 120px;
  transition: all 0.3s ease;
}

.logout-modal-footer .btn-cancel {
  background-color: #6c757d;
  color: white;
}

.logout-modal-footer .btn-cancel:hover {
  background-color: #5a6268;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.logout-modal-footer .btn-confirm {
  background-color: var(--danger-color);
  color: white;
}

.logout-modal-footer .btn-confirm:hover {
  background-color: #c82333;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

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

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

/* Utilities */
.text-center { text-align: center; }
.mb-20 { margin-bottom: 20px; }
.mt-20 { margin-top: 20px; }
.flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-10 { gap: 10px; }

/* Responsive for Content Area */
@media (max-width: 768px) {
  .content-area {
    padding: 15px;
  }
  
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }
  
  .search-input {
    width: 100%;
  }
  
  .form-grid {
    grid-template-columns: 1fr;
  }
  
  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }
  
  .card-actions {
    width: 100%;
  }
  
  .logout-modal {
    width: 95%;
  }
  
  .logout-modal-footer {
    flex-direction: column;
  }
  
  .logout-modal-footer .btn {
    width: 100%;
  }
}
