/* dashboard.css - Admin Dashboard & Authentication Styling */

:root {
  --admin-bg: #0f1322;
  --admin-card-bg: #1a1f33;
  --admin-sidebar-bg: #141829;
  --admin-accent: #c4a77d;
  --admin-accent-hover: #b39467;
  --admin-text-main: #e2e8f0;
  --admin-text-muted: #8a94a6;
  --admin-border: rgba(255, 255, 255, 0.08);
  --admin-danger: #ef4444;
  --admin-success: #10b981;
}

body.dashboard-body {
  background-color: var(--admin-bg);
  color: var(--admin-text-main);
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

/* Login Wrapper */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: radial-gradient(circle at top right, #1e2538 0%, #0f1322 70%);
}

.login-card {
  background: var(--admin-card-bg);
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  padding: 40px;
  width: 100%;
  max-width: 440px;
}

.login-brand {
  text-align: center;
  margin-bottom: 30px;
}

.login-brand img {
  max-height: 45px;
  margin-bottom: 10px;
}

.login-brand h3 {
  font-size: 20px;
  color: var(--admin-accent);
  margin: 10px 0 5px 0;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.login-brand p {
  color: var(--admin-text-muted);
  font-size: 13px;
  margin: 0;
}

.form-group-custom {
  margin-bottom: 20px;
}

.form-group-custom label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--admin-text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-control-custom {
  width: 100%;
  background: rgba(15, 19, 34, 0.8);
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  padding: 12px 16px;
  color: #fff;
  font-size: 14px;
  transition: all 0.25s ease;
  box-sizing: border-box;
}

.form-control-custom:focus {
  outline: none;
  border-color: var(--admin-accent);
  box-shadow: 0 0 0 3px rgba(196, 167, 125, 0.2);
}

.btn-admin-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--admin-accent) 0%, var(--admin-accent-hover) 100%);
  color: #0f1322;
  font-weight: 700;
  border: none;
  padding: 13px;
  border-radius: 6px;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(196, 167, 125, 0.3);
}

.btn-admin-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(196, 167, 125, 0.4);
}

.login-alert {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 20px;
  display: none;
}

/* Dashboard Layout */
.dashboard-wrapper {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
  width: 260px;
  background: var(--admin-sidebar-bg);
  border-right: 1px solid var(--admin-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-header img {
  height: 32px;
}

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

.nav-item-custom {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 24px;
  color: var(--admin-text-muted);
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  transition: all 0.2s ease;
  cursor: pointer;
  border-left: 3px solid transparent;
}

.nav-item-custom:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.03);
}

.nav-item-custom.active {
  color: var(--admin-accent);
  background: rgba(196, 167, 125, 0.08);
  border-left-color: var(--admin-accent);
}

.sidebar-footer {
  padding: 20px;
  border-top: 1px solid var(--admin-border);
}

/* Main Content Area */
.admin-main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.admin-header {
  height: 70px;
  background: var(--admin-card-bg);
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
}

.admin-header-title h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}

.admin-user-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.05);
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--admin-border);
  font-size: 13px;
}

.admin-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--admin-accent);
  color: #0f1322;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
}

.admin-content {
  padding: 30px;
  flex-grow: 1;
}

/* Stat Counter Boxes */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-bottom: 35px;
}

.stat-box {
  background: var(--admin-card-bg);
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-box:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.stat-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--admin-accent);
}

.stat-info h4 {
  margin: 0 0 6px 0;
  font-size: 13px;
  color: var(--admin-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-number {
  font-size: 32px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  background: rgba(196, 167, 125, 0.1);
  color: var(--admin-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

/* Posts Table Section */
.card-table-wrap {
  background: var(--admin-card-bg);
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  overflow: hidden;
}

.table-header-action {
  padding: 20px 24px;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.table-header-action h3 {
  margin: 0;
  font-size: 18px;
  color: #fff;
  font-weight: 700;
}

.btn-add-post {
  background: var(--admin-accent);
  color: #0f1322;
  border: none;
  padding: 10px 18px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-add-post:hover {
  background: var(--admin-accent-hover);
}

.custom-table-responsive {
  overflow-x: auto;
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}

.custom-table th {
  background: rgba(0, 0, 0, 0.2);
  padding: 16px 24px;
  color: var(--admin-text-muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--admin-border);
}

.custom-table td {
  padding: 16px 24px;
  border-bottom: 1px solid var(--admin-border);
  vertical-align: middle;
  color: var(--admin-text-main);
}

.custom-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.post-thumb-sm {
  width: 60px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
}

.action-btns {
  display: flex;
  gap: 8px;
}

.btn-action-edit {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-action-edit:hover {
  background: rgba(59, 130, 246, 0.3);
}

.btn-action-delete {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-action-delete:hover {
  background: rgba(239, 68, 68, 0.3);
}

/* Modal Popup */
.custom-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.custom-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.custom-modal-dialog {
  background: var(--admin-card-bg);
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  width: 100%;
  max-width: 580px;
  box-shadow: 0 25px 50px rgba(0,0,0,0.5);
  overflow: hidden;
}

.modal-header-custom {
  padding: 20px 24px;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header-custom h4 {
  margin: 0;
  font-size: 18px;
  color: #fff;
  font-weight: 700;
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--admin-text-muted);
  font-size: 20px;
  cursor: pointer;
}

.modal-body-custom {
  padding: 24px;
  max-height: 75vh;
  overflow-y: auto;
}

.modal-footer-custom {
  padding: 16px 24px;
  border-top: 1px solid var(--admin-border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: rgba(0, 0, 0, 0.15);
}

.btn-modal-cancel {
  background: transparent;
  color: var(--admin-text-muted);
  border: 1px solid var(--admin-border);
  padding: 10px 18px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}

.btn-modal-cancel:hover {
  color: #fff;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .dashboard-wrapper {
    flex-direction: column;
  }
  .admin-sidebar {
    width: 100%;
  }
  .admin-header {
    padding: 0 15px;
  }
  .admin-content {
    padding: 15px;
  }
}
