/* Admin Dashboard Styles - Studio Suite */

body {
  background: var(--bg-primary);
  display: flex;
  min-height: 100vh;
  margin: 0;
  font-family: 'Inter', sans-serif;
}

/* Login State - Covers whole screen */
#login-view {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

/* Dashboard Layout */
#dashboard-view {
  display: flex;
  width: 100%;
}

/* Sidebar */
.admin-sidebar {
  width: 280px;
  background: var(--bg-secondary);
  border-right: 1px solid rgba(188, 163, 127, 0.1);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 10px 0 30px rgba(0,0,0,0.02);
}
.mobile-header { 
  display: none; 
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
  align-items: center;
  justify-content: space-between;
  z-index: 1000;
}

@media (max-width: 900px) {
  .mobile-header { display: flex; }
}

.sidebar-brand {
  padding: 40px 32px;
  font-family: var(--serif-font);
  font-weight: 400;
  font-size: 26px;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.theme-toggle-mini {
  background: var(--bg-card);
  border: 1px solid var(--border);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  border-radius: 50%;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  flex-shrink: 0;
}

.theme-toggle-mini:hover {
  background: var(--bg-secondary);
  border-color: var(--accent);
  transform: scale(1.1) rotate(12deg);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

body.dark-theme .theme-toggle-mini {
  background: #1a1a1a;
  border-color: rgba(255,255,255,0.15);
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.sidebar-nav {
  list-style: none;
  padding: 0 16px;
  margin: 0;
  flex: 1;
}

.nav-item {
  padding: 14px 20px;
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--accent);
  color: white;
  border-radius: var(--radius-sm);
  padding: 10px 24px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-size: 11px;
  border: none;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  background: var(--text-primary);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.nav-item:hover {
  background: white;
  color: var(--text-primary);
  transform: translateX(4px);
}

.nav-item.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: 0 4px 15px var(--accent-glow);
  border-color: var(--accent);
}

.nav-icon {
  font-size: 18px;
}

  .sidebar-footer {
    padding: 12px;
    border-top: none;
    border-left: 1px solid var(--border);
    margin-top: 0;
    display: flex;
    gap: 8px;
    align-items: center;
  }

  .sidebar-footer .btn {
    margin-bottom: 0 !important;
    white-space: nowrap;
    font-size: 11px;
    padding: 8px 12px;
  }

/* Main Content Area */
.admin-main {
  flex: 1;
  background: var(--bg-primary);
  overflow-y: auto;
}

.tab-content {
  display: none;
}

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

.main-content {
  padding: 48px;
  max-width: 1100px;
  margin: 0 auto;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
}

.section-header h1 {
  font-size: 32px;
  font-family: 'Outfit', sans-serif;
  margin: 0;
}

/* Common Components */
.admin-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.02);
}

.form-group {
  margin-bottom: 24px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

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

.admin-table th {
  text-align: left;
  padding: 16px 24px;
  background: var(--bg-glass);
  font-size: 13px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}

.admin-table td {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
}

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

.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.status-badge.neu { background: #e3f2fd; color: #1976d2; }
.status-badge.bestätigt { background: #e8f5e9; color: #2e7d32; }
.status-badge.abgelehnt { background: #ffebee; color: #c62828; }

/* Existing Gallery Grid - Adapted */
.galleries-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.gallery-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.gallery-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.gallery-cover {
  height: 160px;
  background: var(--bg-glass);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

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

.gallery-info {
  padding: 20px;
}

/* Modals */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 550px;
  padding: 32px;
  box-shadow: var(--shadow-xl);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

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

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 32px;
}

/* Image Grid in Details */
.images-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
}

.image-card {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
  border: 1px solid var(--border);
}

.image-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-overlay {
  position: absolute;
  inset: 0;
  background: var(--bg-glass-strong);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.image-card:hover .image-overlay {
  opacity: 1;
}

/* Detail UI Components */
.detail-header {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 40px;
  color: var(--text-primary);
}

.btn-back {
  background: transparent;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  padding: 0;
  margin-bottom: 24px;
  transition: color 0.2s;
  display: block;
}

.btn-back:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

.share-link-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-top: 24px;
}

.share-link-input {
  flex: 1;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 13px;
  color: var(--text-secondary);
  outline: none;
}

.section-upload-zone {
  border: 2px dashed var(--border);
  padding: 40px;
  border-radius: 12px;
  text-align: center;
  transition: all 0.3s ease;
  background: rgba(255,255,255,0.02);
  margin-bottom: 24px;
  cursor: pointer;
}
.section-upload-zone:hover, .section-upload-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-glow);
  transform: translateY(-2px);
}

.upload-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

/* Selection / Toast */
.toast-container {
  position: fixed;
  bottom: 32px;
  right: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 2000;
}

.toast {
  background: #333;
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ==================== ADMIN MOBILE RESPONSIVE ==================== */

@media (max-width: 900px) {
  #dashboard-view {
    flex-direction: column;
  }

  /* Sidebar becomes a drawer */
  .admin-sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    z-index: 3000;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 20px 0 50px rgba(0,0,0,0.15);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 0;
  }

  .admin-sidebar.active {
    transform: translateX(280px);
  }

  .sidebar-content-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
  }

  .mobile-header {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 0 16px;
    align-items: center;
    justify-content: space-between;
    z-index: 2000;
  }

  .hamburger-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 8px;
    font-size: 20px;
  }

  .mobile-brand {
    font-family: var(--serif-font);
    font-size: 16px;
    letter-spacing: 2px;
    color: var(--text-primary);
    flex: 1;
    text-align: center;
  }

  .drawer-header {
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    font-family: var(--serif-font);
    color: var(--accent);
    letter-spacing: 2px;
    font-size: 14px;
  }

  .close-drawer {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 32px;
    cursor: pointer;
    line-height: 1;
  }

  .sidebar-brand { display: none; }

  .sidebar-nav {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 20px 16px;
    margin: 0;
    gap: 8px;
    flex: 1;
    overflow-y: auto;
  }

  .nav-item {
    padding: 16px 20px;
    margin: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    font-size: 15px;
    border-radius: var(--radius-md);
    background: transparent;
  }

  .nav-item.active {
    background: var(--bg-glass) !important;
    color: var(--accent);
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
  }

  .sidebar-footer {
    display: block;
    padding: 24px;
    border-top: 1px solid var(--border);
  }

  .admin-main {
    padding: 0;
    margin-top: 60px;
    width: 100%;
    overflow-x: hidden;
  }

  .main-content {
    padding: 20px 12px 60px;
    width: 100%;
    box-sizing: border-box;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
  }

  .section-header h1 { 
    font-size: 22px; 
    line-height: 1.2;
  }

  .section-header .btn { 
    width: 100%; 
    padding: 12px; 
    font-size: 13px; 
    text-align: center;
    justify-content: center;
  }

  .detail-header { 
    padding: 20px 12px; 
    border-radius: var(--radius-md); 
    margin-bottom: 24px;
  }

  .detail-title-row { 
    flex-direction: column; 
    gap: 16px; 
  }

  .detail-title-row > div:last-child {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    width: 100%;
  }

  .detail-title-row .btn {
    width: 100%;
    margin: 0 !important;
    padding: 10px 4px;
    font-size: 10px;
    white-space: nowrap;
    text-align: center;
  }

  .share-link-box { 
    flex-direction: column; 
    align-items: stretch; 
    padding: 12px; 
    gap: 12px;
  }
  
  .share-link-box > div {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .share-link-input { 
    font-size: 11px; 
    padding: 10px;
    background: var(--bg-primary);
    border-radius: 4px;
  }

  .galleries-grid { 
    grid-template-columns: 1fr; 
    gap: 16px; 
  }

  .images-grid { 
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); 
    gap: 8px; 
  }

  .modal-content { 
    padding: 24px 16px; 
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
  }

  .modal-actions { 
    flex-direction: column-reverse; 
    gap: 10px; 
  }

  .modal-actions .btn { 
    width: 100%; 
    padding: 12px; 
  }

  /* Section Accordion Mobile Overhaul */
  .section-accordion-header {
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    gap: 12px;
  }

  .section-header-main {
    width: 100%;
  }

  .section-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 12px 0 0;
    border-top: 1px solid var(--border);
  }

  .control-group-secondary {
    border-right: none;
    padding-right: 0;
    justify-content: space-between;
    width: 100%;
  }
  
  .control-group-secondary .btn-icon-small {
    flex: 1;
    height: 36px;
    font-size: 14px;
  }
  
  .control-group-secondary .btn-text-small {
    flex: 2;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
  }

  .control-group-main {
    display: grid;
    grid-template-columns: auto 1fr 1fr;
    gap: 8px;
    align-items: center;
    width: 100%;
  }
  
  .control-group-main .btn {
    padding: 10px 4px;
    font-size: 11px;
  }
  
  .admin-card {
    padding: 20px 16px;
  }
  
  .admin-table-wrapper {
    overflow-x: auto;
    width: 100%;
  }
}

/* Gallery Sections Accordion */
.admin-gallery-section {
  margin-bottom: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all 0.3s ease;
}

.section-accordion-header {
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  gap: 16px;
}

.section-header-main {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.section-controls {
  display: flex;
  align-items: center;
  gap: 20px;
}

.control-group-secondary {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-right: 12px;
  border-right: 1px solid var(--border);
}

.control-group-main {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-icon-small {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 24px;
  height: 24px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  cursor: pointer;
}

.btn-icon-small:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-text-small {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 9px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
}

.btn-text-small:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.section-drag-handle {
  color: var(--text-muted);
  cursor: grab;
  padding: 4px;
}

.section-title-input {
  flex: 1;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-primary);
  font-family: var(--serif-font);
  font-size: 18px;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s;
}

.section-title-input:focus {
  background: var(--bg-primary);
  border-color: var(--accent);
  outline: none;
}

.section-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-body {
  padding: 24px;
  display: block;
}

.admin-gallery-section.collapsed .section-body {
  display: none;
}

.admin-gallery-section.collapsed .section-body {
  display: none;
}

.admin-gallery-section.inactive {
  opacity: 0.6;
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border);
  transition: .4s;
  border-radius: 20px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--accent);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

.accordion-chevron {
  transition: transform 0.3s;
  color: var(--text-muted);
}

.admin-gallery-section.collapsed .accordion-chevron {
  transform: rotate(-90deg);
}

/* Section-Specific Upload Zones */
.section-upload-zone {
  border: 2px dashed var(--border);
  background: var(--bg-glass);
  padding: 30px;
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.section-upload-zone:hover, .section-upload-zone.dragover {
  border-color: var(--accent);
  background: rgba(212, 175, 55, 0.05);
  transform: translateY(-2px);
}

.upload-zone-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
}

.section-upload-zone:hover .upload-zone-inner,
.section-upload-zone.dragover .upload-zone-inner {
  color: var(--accent);
}

.upload-zone-inner svg {
  margin-bottom: 5px;
}

/* Empty placeholder */
#sections-container .empty-state {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  padding: 40px;
  border-radius: var(--radius-lg);
  color: var(--text-muted);
}
/* ==================== ACCORDION ==================== */
.admin-gallery-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.admin-gallery-section.inactive {
  opacity: 0.6;
}

.section-accordion-header {
  padding: 16px 24px;
  display: flex;
  align-items: center;
  cursor: pointer;
  background: var(--bg-card);
  user-select: none;
}

.section-accordion-header:hover {
  background: var(--bg-card-hover);
}

.accordion-chevron {
  margin-right: 16px;
  transition: transform 0.3s ease;
  color: var(--text-muted);
}

.admin-gallery-section.collapsed .accordion-chevron {
  transform: rotate(-90deg);
}

.admin-gallery-section.collapsed .section-body {
  display: none;
}

.section-title-input {
  background: transparent;
  border: none;
  border-bottom: 1px solid transparent;
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 600;
  padding: 4px 8px;
  margin-right: 16px;
  flex: 1;
  transition: border-color 0.2s;
}

.section-title-input:focus {
  border-bottom-color: var(--accent);
  outline: none;
}

.section-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-body {
  padding: 24px;
  border-top: 1px solid var(--border);
  background: var(--bg-primary);
}

/* Fix for buttons in headers */
.section-controls .btn {
  position: relative;
  z-index: 2;
}
