/* =====================================================
   REGAL Admin Panel - CSS Styles
   Matching the main site aesthetic (green-toned, modern)
   ===================================================== */

:root {
  --green-900: #0f3d2e;
  --green-800: #155c3c;
  --green-400: #49a078;
  --green-200: #c7e8d1;
  --sand-50: #f8f5ef;
  --sand-100: #f0ebe1;
  --ink-900: #0a1f1a;
  --gray-600: #4b5c5a;
  --gray-200: #e2e8e5;
  --white: #ffffff;
  --danger: #dc3545;
  --danger-dark: #c82333;
  --shadow-soft: 0 20px 40px rgba(15, 61, 46, 0.08);
  --shadow-md: 0 4px 12px rgba(15, 61, 46, 0.12);
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1.25rem;
  --radius-full: 999px;
  --transition: 200ms ease;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--sand-50);
  color: var(--ink-900);
  font-size: 1rem;
  line-height: 1.6;
}

/* =====================================================
   LOGIN PAGE
   ===================================================== */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top right, rgba(73, 160, 120, 0.35), transparent 45%),
    var(--sand-100);
  padding: 1.5rem;
}

.login-container {
  width: 100%;
  max-width: 420px;
}

.login-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 2.5rem;
}

.login-header {
  margin-bottom: 2rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-logo {
  width: 56px;
  height: auto;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.08em;
  color: var(--green-900);
}

.brand-subtitle {
  font-size: 0.85rem;
  color: var(--gray-600);
}

.login-form h1 {
  margin: 0 0 0.25rem;
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--green-900);
}

.login-subtitle {
  margin: 0 0 1.5rem;
  color: var(--gray-600);
}

.error-message {
  background: rgba(220, 53, 69, 0.1);
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--ink-900);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--green-400);
  box-shadow: 0 0 0 3px rgba(73, 160, 120, 0.15);
}

.form-group textarea {
  min-height: 100px;
  resize: vertical;
}

.form-group input[type="file"] {
  padding: 0.5rem;
  background: var(--sand-50);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.form-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--green-400);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius-full);
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}

.btn svg {
  width: 18px;
  height: 18px;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-loader {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-loader[hidden] {
  display: none;
}

.btn-text[hidden] {
  display: none;
}

.spinner {
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.btn-primary {
  background: var(--green-900);
  color: var(--white);
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  background: var(--green-800);
}

.btn-secondary {
  background: var(--sand-100);
  color: var(--green-900);
  border: 1px solid var(--gray-200);
}

.btn-secondary:hover {
  background: var(--gray-200);
}

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

.btn-danger:hover {
  background: var(--danger-dark);
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn-full {
  width: 100%;
}

.btn-icon {
  padding: 0.5rem;
  border-radius: var(--radius-md);
}

.btn-loader {
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinner {
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
}

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

.login-footer {
  margin-top: 2rem;
  text-align: center;
}

.back-link {
  color: var(--green-400);
  text-decoration: none;
  font-weight: 500;
}

.back-link:hover {
  text-decoration: underline;
}

/* =====================================================
   DASHBOARD PAGE
   ===================================================== */

.dashboard-page {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: var(--green-900);
  color: var(--white);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
}

.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header .brand-title {
  color: var(--white);
}

.sidebar-header .brand-subtitle {
  color: rgba(255, 255, 255, 0.7);
}

.sidebar-header .brand-logo-badge {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--green-400), var(--green-200));
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--green-900);
  flex-shrink: 0;
}

.sidebar-header .brand-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  background: rgba(255, 255, 255, 0.1);
  border-radius: 0.5rem;
  padding: 0.25rem;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
  width: 100%;
  text-align: left;
}

.nav-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
}

.nav-item.active {
  background: var(--green-400);
  color: var(--white);
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.logout-btn:hover {
  background: rgba(220, 53, 69, 0.2);
  color: #ff6b6b;
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: 260px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 50;
}

.content-header h1 {
  margin: 0 0 0.25rem;
  font-size: 1.5rem;
  color: var(--green-900);
}

.content-header p {
  margin: 0;
  color: var(--gray-600);
}

.content-body {
  flex: 1;
  padding: 2rem;
}

/* Sections */
.section {
  display: none;
}

.section.active {
  display: block;
}

.section-filters {
  margin-bottom: 1.5rem;
}

.filter-select {
  padding: 0.5rem 2rem 0.5rem 1rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-full);
  background: var(--white) url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23155c3c' stroke-width='2' fill='none'/%3E%3C/svg%3E") no-repeat right 0.75rem center;
  appearance: none;
  font-size: 0.9rem;
  cursor: pointer;
}

/* Data Tables */
.data-table-container {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

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

.data-table th,
.data-table td {
  padding: 1rem 1.25rem;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
}

.data-table th {
  background: var(--sand-50);
  font-weight: 600;
  color: var(--green-900);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.data-table tbody tr:hover {
  background: var(--sand-50);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.table-img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: var(--radius-md);
  background: var(--sand-100);
}

.table-actions {
  display: flex;
  gap: 0.5rem;
}

.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 500;
}

.status-badge.current {
  background: var(--green-200);
  color: var(--green-900);
}

.status-badge.alumni {
  background: var(--sand-100);
  color: var(--gray-600);
}

/* Gallery Grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.gallery-item {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 1;
  background: var(--white);
  box-shadow: var(--shadow-soft);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-item-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1rem;
  opacity: 0;
  transition: opacity var(--transition);
}

.gallery-item:hover .gallery-item-overlay {
  opacity: 1;
}

.gallery-item-caption {
  color: var(--white);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.gallery-item-album {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.gallery-item-actions {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  display: flex;
  gap: 0.25rem;
  opacity: 0;
  transition: opacity var(--transition);
}

.gallery-item:hover .gallery-item-actions {
  opacity: 1;
}

.gallery-item-actions .btn {
  padding: 0.4rem;
  background: var(--white);
  color: var(--ink-900);
}

.gallery-item-actions .btn:hover {
  background: var(--gray-200);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.empty-state p {
  color: var(--gray-600);
  margin: 0;
}

/* =====================================================
   MODAL
   ===================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 31, 26, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
  overflow-y: auto;
}

.modal-overlay[hidden] {
  display: none !important;
}

#delete-modal-overlay {
  z-index: 210;
}

.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-soft);
}

.modal-small {
  max-width: 400px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--gray-200);
}

.modal-header h2 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--green-900);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.75rem;
  color: var(--gray-600);
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.modal-close:hover {
  color: var(--ink-900);
}

.modal-body {
  padding: 1.5rem;
}

.modal-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

/* File Upload Preview */
.file-preview {
  margin-top: 0.75rem;
}

.file-preview img {
  max-width: 150px;
  max-height: 150px;
  border-radius: var(--radius-md);
  object-fit: cover;
}

.file-preview-name {
  font-size: 0.85rem;
  color: var(--gray-600);
  margin-top: 0.5rem;
}

/* =====================================================
   TOAST NOTIFICATION
   ===================================================== */

.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--green-900);
  color: var(--white);
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  z-index: 300;
  animation: slideIn 0.3s ease;
}

.toast.error {
  background: var(--danger);
}

@keyframes slideIn {
  from {
    transform: translateY(100%);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 900px) {
  .sidebar {
    width: 220px;
  }

  .main-content {
    margin-left: 220px;
  }
}

@media (max-width: 768px) {
  .dashboard-page {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    position: relative;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 1rem;
  }

  .sidebar-header {
    flex: 1;
    border-bottom: none;
    padding: 0;
  }

  .sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
    order: 1;
    padding: 1rem 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 1rem;
  }

  .nav-item span {
    display: none;
  }

  .nav-item {
    padding: 0.75rem;
    justify-content: center;
  }

  .sidebar-footer {
    flex-direction: row;
    border-top: none;
    padding: 0;
  }

  .main-content {
    margin-left: 0;
  }

  .content-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .content-header .btn {
    width: 100%;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .data-table {
    font-size: 0.875rem;
  }

  .data-table th,
  .data-table td {
    padding: 0.75rem;
  }
}