/* ============================================
   RESPONSIVE ADMIN STYLES - Auto Service Koppejan
   ============================================ */

:root{
  --primary:#1e3c72;
  --accent:#d4af37;
  --muted:#666;
  --bg:#ffffff;
  --card-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

/* Base resets for admin pages */
body.admin {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: linear-gradient(180deg,#f5f7fb,#eef3ff);
  margin:0;
  padding:20px;
  -webkit-font-smoothing:antialiased;
}

/* Standard header styling */
.header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px 40px;
  margin: -20px -20px 30px -20px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header h1 {
  font-size: 24px;
  margin: 0;
  color: white;
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
}

/* ============================================
   HAMBURGER MENU & NAVIGATION
   ============================================ */

.hamburger-menu {
  display: none;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  padding: 10px;
  background: rgba(255,255,255,0.2);
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.4);
  transition: all 0.3s;
  z-index: 1001;
  position: relative;
}

.hamburger-menu:hover {
  background: rgba(255,255,255,0.3);
}

.hamburger-menu span {
  display: block;
  width: 24px;
  height: 3px;
  background: white;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.hamburger-menu.active span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.hamburger-menu.active span:nth-child(2) {
  opacity: 0;
  transform: translateX(-10px);
}

.hamburger-menu.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* Header navigation */
.header-content {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Admin header (for content pages) */
.admin-header {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.header-actions,
.nav-links,
.user-info {
  display: flex;
  gap: 15px;
  align-items: center;
  flex-wrap: wrap;
}

/* Ensure buttons show on desktop */
@media (min-width: 769px) {
  .hamburger-menu {
    display: none !important;
  }
  
  .header-actions,
  .nav-links,
  .user-info {
    position: static !important;
    width: auto !important;
    height: auto !important;
    background: transparent !important;
    flex-direction: row !important;
    padding: 0 !important;
    box-shadow: none !important;
  }
  
  .admin-header .user-info {
    position: static !important;
    width: auto !important;
    height: auto !important;
    background: transparent !important;
    flex-direction: row !important;
    padding: 0 !important;
  }
  
  .admin-header .back-btn,
  .admin-header .logout-btn {
    position: static !important;
    width: auto !important;
  }
}

/* Mobile responsive menu */
@media (max-width: 768px) {
  .hamburger-menu {
    display: flex !important;
  }
  
  /* Mobile slide-in menu for ALL navigation types */
  .header-actions,
  .nav-links,
  .user-info.header-actions,
  .admin-header .user-info {
    position: fixed !important;
    top: 0 !important;
    left: -100% !important;
    width: 280px !important;
    height: 100vh !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    flex-direction: column !important;
    align-items: stretch !important;
    padding: 80px 20px 20px 20px !important;
    gap: 12px !important;
    z-index: 1000 !important;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 2px 0 30px rgba(0,0,0,0.4) !important;
    overflow-y: auto !important;
    margin: 0 !important;
  }
  
  /* Close button in menu */
  .header-actions::before,
  .nav-links::before,
  .user-info.header-actions::before,
  .admin-header .user-info::before {
    content: '\00d7';
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 40px;
    font-weight: 300;
    line-height: 40px;
    color: white;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    transition: all 0.3s;
  }
  
  .header-actions::before:hover,
  .nav-links::before:hover,
  .user-info.header-actions::before:hover,
  .admin-header .user-info::before:hover {
    background: rgba(255,255,255,0.2);
    transform: rotate(90deg);
  }
  
  /* Show menu when active */
  .header-actions.active,
  .nav-links.active,
  .user-info.header-actions.active,
  .admin-header .user-info.active {
    left: 0 !important;
  }
  
  /* All links and buttons in mobile menu */
  .header-actions a,
  .header-actions .btn,
  .header-actions button:not(.hamburger-menu),
  .nav-links a,
  .user-info a:not(.user-name),
  .user-info .btn,
  .user-info .back-btn,
  .user-info .logout-btn,
  .admin-header .user-info a,
  .admin-header .user-info .btn {
    width: 100% !important;
    justify-content: flex-start !important;
    padding: 16px 20px !important;
    font-size: 15px !important;
    border-radius: 8px !important;
    transition: all 0.2s !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    text-decoration: none !important;
    border: none !important;
    background: rgba(255,255,255,0.1) !important;
    color: white !important;
    margin: 0 !important;
  }
  
  .header-actions a:hover,
  .nav-links a:hover,
  .user-info a:hover,
  .admin-header .user-info a:hover {
    background: rgba(255,255,255,0.2) !important;
    transform: translateX(5px);
  }
  
  /* User name in menu */
  .user-info span.user-name,
  .user-info span:not(.hamburger-menu span),
  .admin-header .user-info span {
    width: 100%;
    padding: 12px 20px;
    background: rgba(255,255,255,0.15) !important;
    border-radius: 8px;
    margin-bottom: 10px;
    color: white;
  }
  
  /* Hide hamburger icon children spans in menu */
  .hamburger-menu span {
    background: white !important;
  }
  
  /* Overlay when menu is open */
  body.admin.menu-open::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 999;
    animation: fadeIn 0.3s;
  }
  
  @keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
  }
  
  /* Make sure header content doesn't break */
  .header-content,
  .admin-header {
    flex-wrap: nowrap !important;
  }
  
  .header h1,
  .admin-header h1 {
    font-size: 18px !important;
    flex: 1;
  }
}
/* ============================================
   DASHBOARD COMPONENTS
   ============================================ */

.container-admin{
  max-width:1200px;
  margin:0 auto;
}

.card-admin{
  background:var(--bg);
  border-radius:12px;
  padding:20px;
  box-shadow:var(--card-shadow);
  margin-bottom:20px;
}

.header-admin{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.header-admin h1{ color:var(--primary); font-size:20px; }
.header-admin .user-info{ display:flex; gap:12px; align-items:center; }

/* ============================================
   SNELLE ACTIES - Responsive Action Buttons
   ============================================ */

.actions, .section .actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

@media (max-width: 768px) {
  .actions, .section .actions {
    flex-direction: column;
    gap: 8px;
  }
  
  .actions .btn,
  .section .actions .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ============================================
   STATS GRID - Dashboard Cards
   ============================================ */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

@media (max-width: 768px) {
  .stats {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .stat-card {
    padding: 20px;
  }
  
  .stat-card .number {
    font-size: 28px !important;
  }
}

/* ============================================
   TABLES - Responsive Gebruikers & Data Tables
   ============================================ */

/* Make tables responsive */
.table-responsive{
  width:100%;
  overflow:auto;
}

.users-table, .occasions-table, .media-table{
  width:100%;
  border-collapse:collapse;
}

.users-table th, .users-table td{
  padding:10px 12px;
  border-bottom:1px solid #eee;
  text-align:left;
  vertical-align:middle;
}

/* Responsive table wrapper */
.section table {
  width: 100%;
  min-width: 600px; /* Prevent too much squishing */
}

@media (max-width: 768px) {
  /* Wrap tables in scrollable container */
  .section {
    overflow-x: auto;
  }
  
  .users-table th, 
  .users-table td,
  table th,
  table td {
    padding: 8px 6px;
    font-size: 13px;
    white-space: nowrap;
  }
  
  /* Hide less important columns on mobile */
  .users-table th:nth-child(6),
  .users-table td:nth-child(6),
  table th.hide-mobile,
  table td.hide-mobile {
    display: none;
  }
  
  /* Make action buttons stack in table cells */
  td .btn,
  td button {
    padding: 6px 10px;
    font-size: 12px;
  }
}

.actions-row{ display:flex; gap:10px; flex-wrap:wrap; }

.btn-admin{
  background:var(--primary);
  color:white; padding:10px 14px; border-radius:8px; border:none; cursor:pointer; display:inline-flex; gap:8px; align-items:center;
}
.btn-admin.secondary{ background:#6c757d; }

/* Mobile adjustments */
@media (max-width: 768px){
  body.admin{ padding:12px; }
  .header-admin{ flex-direction:column; align-items:flex-start; gap:8px; }
  .header-admin h1{ font-size:18px; }
  .container-admin{ padding:0 6px; }
  .card-admin{ padding:12px; }
  .users-table th, .users-table td{ padding:10px 8px; font-size:14px; }
  .actions-row{ width:100%; }
  .btn-admin{ width:100%; justify-content:center; }
  
  /* Stack content grid in content editor */
  .content-grid{ display:block; }
  .content-item{ margin-bottom:14px; }
  .content-textarea{ min-height:100px; }
  
  /* Media library grid: make tiles responsive */
  .media-grid{ display:grid; grid-template-columns: repeat(auto-fill, minmax(120px,1fr)); gap:10px; }
  .media-item{ border-radius:8px; overflow:hidden; }
  .media-thumbnail img{ width:100%; height:120px; object-fit:cover; display:block; }
  .media-info{ padding:8px; }

  /* Small modals full width */
  .modal{ padding:12px; }
  .modal .modal-inner{ width:100%; }
}

/* ============================================
   MODALS - Responsive Dialogs
   ============================================ */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.6);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.modal.active {
  display: flex;
}

.modal-content,
.modal-inner {
  background: white;
  border-radius: 15px;
  max-width: 700px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  padding: 25px 30px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f9fafb;
  border-radius: 15px 15px 0 0;
}

.modal-header h2,
.modal-header h3 {
  margin: 0;
  font-size: 20px;
  color: #333;
}

.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: #999;
  padding: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
  line-height: 1;
}

.modal-close:hover {
  background: #e5e7eb;
  color: #333;
  transform: rotate(90deg);
}

.modal-body {
  padding: 30px;
}

.modal-footer {
  padding: 20px 30px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  background: #f9fafb;
  border-radius: 0 0 15px 15px;
}

/* Form elements in modals */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #374151;
  font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.2s;
  font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}

/* Mobile responsive modals */
@media (max-width: 768px) {
  .modal {
    padding: 10px;
    align-items: flex-start;
  }
  
  .modal-content,
  .modal-inner {
    max-width: 100%;
    max-height: 95vh;
    margin: 10px 0;
    border-radius: 12px;
  }
  
  .modal-header {
    padding: 20px 16px;
    border-radius: 12px 12px 0 0;
  }
  
  .modal-header h2,
  .modal-header h3 {
    font-size: 18px;
  }
  
  .modal-body {
    padding: 20px 16px;
  }
  
  .modal-footer {
    padding: 16px;
    flex-direction: column-reverse;
    gap: 8px;
    border-radius: 0 0 12px 12px;
  }
  
  .modal-footer .btn,
  .modal-footer button {
    width: 100%;
    justify-content: center;
  }
  
  .form-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .form-group input,
  .form-group select,
  .form-group textarea {
    font-size: 16px; /* Prevents zoom on iOS */
  }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.small { font-size: 12px; color: var(--muted); }
.center { text-align: center; }
.input-admin { width: 100%; padding: 10px; border: 1px solid #e6e6e6; border-radius: 8px; }
pre { white-space: pre-wrap; word-wrap: break-word; }

/* Hide elements on mobile */
@media (max-width: 768px) {
  .hide-on-mobile {
    display: none !important;
  }
}

/* ============================================
   ADDITIONAL ADMIN COMPONENT FIXES
   ============================================ */

/* Image preview in forms */
.image-preview {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin-top: 10px;
}

/* Upload button */
.upload-preview {
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  border-radius: 8px;
  margin: 10px 0;
}

@media (max-width: 768px) {
  .upload-preview {
    max-height: 200px;
  }
  
  /* Stack image grid tighter on mobile */
  .occasions-grid {
    grid-template-columns: 1fr !important;
    gap: 15px;
  }
  
  .occasion-card {
    margin-bottom: 0;
  }
}
