/* ==========================================================================
   ANDY STUDIO CMS - ADMIN DASHBOARD STYLES
   Editorial & Brutalist Dark UI
   ========================================================================== */

:root {
  --admin-bg: #070707;
  --admin-card-bg: #111111;
  --admin-card-border: rgba(255, 255, 255, 0.1);
  --admin-input-bg: #181818;
  --admin-input-border: rgba(255, 255, 255, 0.16);
  --admin-accent: #2500ad;
  --admin-accent-hover: #3b0ed8;
  --admin-text-main: #ffffff;
  --admin-text-dim: rgba(255, 255, 255, 0.65);
  --admin-text-muted: rgba(255, 255, 255, 0.4);
  --admin-danger: #e11d48;
  --admin-success: #10b981;
}

body.admin-body {
  background-color: var(--admin-bg);
  color: var(--admin-text-main);
  font-family: var(--font-mono), monospace;
  min-height: 100vh;
  display: flex;
  margin: 0;
  padding: 0;
}

body.admin-login-body {
  background-color: var(--admin-bg);
  color: var(--admin-text-main);
  font-family: var(--font-mono), monospace;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

/* ------------------------- Login Layout ------------------------- */
.login-container {
  width: 100%;
  max-width: 440px;
  background: var(--admin-card-bg);
  border: 1px solid var(--admin-card-border);
  border-radius: 20px;
  padding: 3rem 2.5rem;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
}

.login-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.login-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  margin: 1rem 0 0.3rem;
  letter-spacing: -0.02em;
}

.login-subtitle {
  font-size: 0.82rem;
  color: var(--admin-text-muted);
}

.login-error {
  background: rgba(225, 29, 72, 0.15);
  border: 1px solid var(--admin-danger);
  color: #fda4af;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

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

.back-link {
  color: var(--admin-text-muted);
  transition: color 0.2s ease;
}

.back-link:hover {
  color: #fff;
}

/* ------------------------- Dashboard Shell ------------------------- */
.admin-sidebar {
  width: 280px;
  background: #0d0d0d;
  border-right: 1px solid var(--admin-card-border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2rem 1.5rem;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 100;
}

.admin-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--admin-card-border);
  margin-bottom: 1.5rem;
}

.admin-brand-logo svg {
  height: 24px;
  width: auto;
  fill: #ffffff;
}

.admin-badge {
  font-size: 0.65rem;
  background: var(--admin-accent);
  color: #fff;
  padding: 3px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex-grow: 1;
}

.nav-tab-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  color: var(--admin-text-dim);
  font-size: 0.82rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: all 0.2s ease;
  width: 100%;
  text-align: left;
}

.nav-tab-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.nav-tab-btn.active {
  background: #ffffff;
  color: #000000;
  font-weight: 700;
}

.nav-tab-btn .tab-icon {
  font-size: 1.1rem;
}

.admin-sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--admin-card-border);
}

.btn-sidebar-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--admin-card-border);
  border-radius: 10px;
  color: var(--admin-text-dim);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: all 0.2s ease;
}

.btn-sidebar-action:hover {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
}

.btn-logout {
  color: var(--admin-danger);
  border-color: rgba(225, 29, 72, 0.2);
}

.btn-logout:hover {
  background: var(--admin-danger);
  color: #ffffff;
  border-color: var(--admin-danger);
}

/* ------------------------- Main Content Area ------------------------- */
.admin-main {
  flex-grow: 1;
  padding: 2.5rem 3.5rem 8rem;
  max-width: 1200px;
  overflow-y: auto;
}

.admin-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--admin-card-border);
}

.admin-section-heading {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
}

.admin-section-desc {
  font-size: 0.85rem;
  color: var(--admin-text-muted);
  margin-top: 4px;
}

/* ------------------------- Cards & Form Controls ------------------------- */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.admin-card {
  background: var(--admin-card-bg);
  border: 1px solid var(--admin-card-border);
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media screen and (max-width: 900px) {
  .form-grid-2 {
    grid-template-columns: 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 1.4rem;
}

.form-group label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--admin-text-dim);
  font-weight: 600;
}

.form-group input,
.form-group textarea,
.form-group select {
  background: var(--admin-input-bg);
  border: 1px solid var(--admin-input-border);
  border-radius: 8px;
  padding: 12px 14px;
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  transition: border-color 0.2s ease, background 0.2s ease;
  outline: none;
  width: 100%;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: #ffffff;
  background: #202020;
}

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

.input-with-upload {
  display: flex;
  gap: 10px;
}

.btn-upload {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  border-radius: 8px;
  padding: 0 16px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.btn-upload:hover {
  background: #fff;
  color: #000;
}

.media-preview-box {
  margin-top: 8px;
  border-radius: 8px;
  overflow: hidden;
  max-width: 220px;
  max-height: 140px;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-preview-box img,
.media-preview-box video {
  max-width: 100%;
  max-height: 140px;
  object-fit: cover;
}

/* ------------------------- CRUD Items (Projects, Services, Team) ------------------------- */
.crud-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.btn-create {
  background: #ffffff;
  color: #000000;
  padding: 10px 18px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-create:hover {
  background: var(--admin-accent);
  color: #ffffff;
  transform: translateY(-2px);
}

.projects-table-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.project-row-item {
  display: grid;
  grid-template-columns: 80px 1fr 160px 120px;
  align-items: center;
  gap: 1.5rem;
  background: #161616;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px 18px;
  transition: border-color 0.2s ease;
}

.project-row-item:hover {
  border-color: rgba(255, 255, 255, 0.25);
}

.project-row-thumb {
  width: 70px;
  height: 48px;
  border-radius: 6px;
  overflow: hidden;
  background: #000;
}

.project-row-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-row-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
}

.project-row-category {
  font-size: 0.75rem;
  color: var(--admin-text-muted);
}

.project-row-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.btn-icon-action {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-icon-action:hover {
  background: #fff;
  color: #000;
}

.btn-icon-action.delete:hover {
  background: var(--admin-danger);
  color: #fff;
  border-color: var(--admin-danger);
}

/* Dynamic Simple Lists (Services & Team) */
.dynamic-list-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dynamic-list-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.dynamic-list-row input {
  flex-grow: 1;
}

/* ------------------------- Floating Save Bar ------------------------- */
.floating-save-bar {
  position: fixed;
  bottom: 2rem;
  left: calc(280px + (100vw - 280px) / 2);
  transform: translateX(-50%);
  background: rgba(18, 18, 18, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 40px;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85);
  z-index: 1000;
}

.save-status-text {
  font-size: 0.8rem;
  color: var(--admin-text-dim);
}

.btn-save-master {
  background: #ffffff;
  color: #000000;
  border: none;
  padding: 10px 24px;
  border-radius: 30px;
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-save-master:hover {
  background: var(--admin-accent);
  color: #ffffff;
  transform: scale(1.03);
}

/* ------------------------- Toast Notifications ------------------------- */
.toast-notification {
  position: fixed;
  top: 2rem;
  right: 2rem;
  background: #181818;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 14px 20px;
  color: #fff;
  font-size: 0.85rem;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 10000;
  transform: translateY(-20px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-notification.active {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.toast-notification.success {
  border-color: var(--admin-success);
}

.toast-notification.error {
  border-color: var(--admin-danger);
}

/* ------------------------- Modal for Editor ------------------------- */
.admin-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(12px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.admin-modal-overlay.active {
  display: flex;
}

.admin-modal-window {
  background: #131313;
  border: 1px solid var(--admin-card-border);
  border-radius: 18px;
  width: 100%;
  max-width: 880px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 2.5rem;
  position: relative;
  box-shadow: 0 35px 80px rgba(0, 0, 0, 0.95);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--admin-card-border);
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
}

.modal-close-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
}

/* ------------------------- Admin Gallery Manager Grid ------------------------- */
.admin-gallery-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
  margin-top: 1rem;
}

.admin-gallery-card {
  position: relative;
  background: #1c1c1c;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
}

.admin-gallery-card:hover {
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.admin-gallery-card-thumb {
  width: 100%;
  aspect-ratio: 16/10;
  background: #0a0a0a;
  overflow: hidden;
  position: relative;
}

.admin-gallery-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-gallery-badge-cover {
  position: absolute;
  top: 6px;
  left: 6px;
  background: #ffffff;
  color: #000000;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.admin-gallery-card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  background: #181818;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-gallery-action {
  background: none;
  border: none;
  color: var(--admin-text-dim);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.btn-gallery-action:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.btn-gallery-action.delete {
  color: var(--admin-danger);
}

.btn-gallery-action.delete:hover {
  background: rgba(255, 77, 77, 0.2);
  color: #ff6b6b;
}
