/* --- Global Settings & Variables --- */
:root {
  --primary-color: #3b82f6; /* Blue */
  --primary-hover: #2563eb;
  --secondary-color: #1f2937; /* Dark Gray/Black */
  --light-gray: #f3f4f6;
  --text-color: #374151;
  --border-color: #e5e7eb;
  --header-height: 60px;
  /* Footer height is flexibel (min-height) */
  --delete-color-light: #fee2e2; /* Light Red */
  --delete-color-dark: #ef4444; /* Red */
  --delete-color-dark-hover: #dc2626; /* Darker Red */
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: var(--light-gray);
  color: var(--text-color);
}

h1,
h2 {
  margin-bottom: 1rem;
  color: var(--secondary-color);
}

/* Algemene link stijlen */
a {
    color: var(--primary-color);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

.content-wrapper ol,
.content-wrapper ul {
  padding-left: 2rem; 
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

/* --- Header Logo Styling --- */
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem; 
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--secondary-color); 
  text-decoration: none; 
}
.brand:visited, .brand:hover, .brand:active {
    color: var(--secondary-color);
}
.header-logo {
  height: 32px; 
  border-radius: 6px; 
}

/* --- Rol Icoon Stijlen --- */
.nav-user-name {
  align-self: center;
  font-weight: 500;
  color: var(--text-color);
}
.role-icon {
  font-size: 0.9rem; 
  margin-right: 0.35rem; 
  line-height: 1; 
}
#user-name-display {
  margin-right: 1.5rem; 
}

/* --- Layout (Header, Main, Footer) --- */
.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2rem;
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  height: var(--header-height);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.main-footer {
  background-color: #ffffff;
  border-top: 1px solid var(--border-color);
  box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.05);
  min-height: 50px; /* Flexibele hoogte voor mobiel */
  padding: 1rem 2rem;
  font-size: 0.8rem;
  color: #6b7280;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap; /* Laat items zakken op mobiel */
  gap: 1rem;
}

/* Zorg dat footer zichtbaar is */
body.logged-in .main-footer,
body.not-logged-in .main-footer {
  display: flex;
}

.footer-left {
  display: flex;
  gap: 1rem 1.5rem;
  align-items: center; 
  flex-wrap: wrap;
}
.footer-left a {
  color: var(--secondary-color);
  text-decoration: none;
  white-space: nowrap;
}
.footer-left a:hover {
    text-decoration: underline;
}
.footer-left span {
    white-space: nowrap;
}

.footer-right {
  display: flex;
  gap: 1rem;
  align-items: center;
  white-space: nowrap;
  margin-left: auto; /* Duw naar rechts */
}

.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #ef4444; 
  margin-right: 5px;
}
.status-dot.online {
  background-color: #22c55e;
}

/* --- Navigatie --- */
.nav-buttons {
  display: none; 
  position: relative; 
}
body.logged-in .nav-buttons {
  display: flex;
  align-items: center; 
}
#mobile-menu-btn {
  display: none; 
  background: none;
  border: none;
  font-size: 1.75rem;
  cursor: pointer;
  padding: 0.5rem;
  line-height: 1;
  color: var(--text-color);
}
#nav-menu-dropdown {
  display: flex; 
  flex-direction: row;
  align-items: center;
  gap: 1rem;
}
#nav-menu-dropdown button, .dynamic-nav-btn {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  transition: background-color 0.2s ease-in-out, transform 0.1s ease;
}
#nav-menu-dropdown button:hover {
  background-color: var(--primary-hover);
}

/* --- Algemene Knoppen --- */
.btn {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  transition: background-color 0.2s ease-in-out, transform 0.1s ease;
}
.btn:hover {
  background-color: var(--primary-hover);
}
.btn:active {
  transform: scale(0.98);
}
.btn:disabled {
  background-color: #9ca3af;
  cursor: not-allowed;
}
.btn-secondary {
  background-color: #6b7280;
}
.btn-secondary:hover {
  background-color: #4b5563;
}
.btn-danger {
  background-color: var(--delete-color-dark);
}
.btn-danger:hover {
  background-color: var(--delete-color-dark-hover);
}
.btn-danger:disabled {
  background-color: #fca5a5; 
  cursor: not-allowed;
}
.btn-full-width {
    width: 100%;
}

/* --- Pagina Content --- */
main {
  flex: 1; 
  padding: 2rem;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - var(--header-height) - 50px);
}
.content-wrapper {
  width: 100%;
  max-width: 1200px;
  background-color: #ffffff;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* --- NIEUW: About Page Styles --- */
.about-intro {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #4b5563;
    margin-bottom: 2rem;
}
.about-section-title {
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 0.5rem;
    margin-top: 2rem;
    font-size: 1.25rem;
    font-weight: 600;
}
.about-text {
    margin-bottom: 1rem;
    line-height: 1.6;
}
.about-quote-container {
    margin-top: 3rem;
    text-align: center;
}
.about-quote {
    margin-bottom: 1rem;
    font-style: italic;
    color: #6b7280;
    font-size: 1.1rem;
}

/* --- NIEUW: Contact Page Styles --- */
.contact-container {
    max-width: 600px;
}
.contact-intro {
    margin-bottom: 2rem;
    color: #666;
}
.contact-form {
    max-width: 100%;
    width: 100%;
}
.contact-textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    min-height: 150px;
}

/* --- Specifieke Pagina's (Login, etc) --- */
.login-container {
  max-width: 400px;
  width: 100%;
  padding: 2rem;
  text-align: center;
}
.login-form input {
  width: 100%;
  padding: 0.8rem 1rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
}
.login-form .form-group-legal {
  text-align: left;
  font-size: 0.85rem;
  margin-bottom: 1rem;
  color: #6b7280;
}
.login-form .form-group-legal label {
  display: flex;
  align-items: flex-start; 
  gap: 0.5rem;
  cursor: pointer;
  line-height: 1.5; 
}
.login-form .form-group-legal input {
  width: auto;
  margin: 0;
  flex-shrink: 0; 
  margin-top: 0.2em; 
}
.login-form .form-group-legal a {
  color: var(--primary-color);
  text-decoration: underline;
}
.login-form select,
.settings-form-select {
  width: 100%;
  max-width: 400px;
  padding: 0.8rem 1rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  background-color: white;
  color: var(--text-color);
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%2M0-5-1.8-9.2-5.4-12.8z%22%2F%3E%3C%2Fsvg%3E');
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 0.8em auto;
  cursor: pointer;
}
.login-form select:required:invalid,
.settings-form-select:required:invalid {
  color: #6b7280;
}
.login-form option[value=""][disabled],
.settings-form-select option[value=""][disabled] {
  display: none;
}
.login-form option,
.settings-form-select option {
  color: var(--text-color);
}
.login-form .btn {
  width: 100%;
}

/* Home Page (Wardrobe) */
.wardrobe-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  height: 70vh;
}
.person-viewer {
  background-color: var(--light-gray);
  border: 2px dashed var(--border-color);
  border-radius: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
}
.person-viewer .layer {
  position: absolute;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
#person-viewer-placeholder {
  padding: 2rem 10%; 
  text-align: center;
  color: #6b7280; 
  line-height: 1.6;
  font-size: 1.1rem;
  max-width: 90%; 
}

.clothing-picker {
  background-color: var(--light-gray);
  border-radius: 12px;
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s, border-color 0.2s;
  border: 2px solid transparent; 
}
.clothing-controls {
  display: flex;
  gap: 0.5rem; 
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
  align-items: center; 
}
.filter-container {
  position: relative; 
  margin-left: auto; 
}
.filter-dropdown-content {
  display: none; 
  position: absolute;
  top: 100%; 
  right: 0;
  background-color: white;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 100;
  min-width: 250px;
  max-height: 400px;
  overflow-y: auto;
  padding: 0.5rem;
}
.filter-dropdown-content.show {
  display: block;
}
.filter-item {
  display: block;
  padding: 0.5rem 0.75rem;
}
.filter-item label {
  font-weight: normal;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}
.filter-item input {
  cursor: pointer;
}
.filter-item-main label {
  font-weight: 600;
}
.filter-item-sub {
  padding-left: 2rem;
}
.filter-actions {
  display: flex;
  border-bottom: 1px solid var(--border-color); 
  margin-bottom: 0.5rem; 
}
.filter-btn-action {
  flex: 1; 
  padding: 0.75rem 0.5rem;
  border: none;
  background: none;
  color: var(--primary-color);
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  font-size: 0.9rem;
}
.filter-btn-action:hover {
  background-color: var(--light-gray);
}
#filter-select-all-btn {
  border-right: 1px solid var(--border-color);
}
.clothing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 1rem;
}
.clothing-item {
  position: relative; 
  width: 100%;
  padding-bottom: 100%; 
  background-color: white;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: box-shadow 0.2s; 
  display: none; 
  overflow: hidden; 
}
.clothing-item-image {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: transform 0.1s ease; 
}
.clothing-item-tag {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(2px);
  padding: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-color);
  text-align: center;
  text-transform: capitalize; 
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.clothing-item.visible {
  display: block; 
}
.clothing-item.selected {
  box-shadow: 0 0 0 4px var(--primary-color);
}
.clothing-item.selected .clothing-item-image {
  transform: scale(0.95);
}

/* --- Delete Mode Stijlen --- */
.clothing-picker.delete-mode {
  border: 2px solid var(--delete-color-dark);
  box-shadow: 0 0 8px var(--delete-color-light);
}
.clothing-grid.delete-mode .clothing-item.visible {
  cursor: pointer;
}
.clothing-grid.delete-mode .clothing-item.visible:hover .clothing-item-image {
  transform: scale(0.95); 
}
.clothing-item.delete-selected {
  border: 2px solid var(--delete-color-dark) !important;
  box-shadow: 0 0 0 3px var(--delete-color-dark);
}
.clothing-item.delete-selected .clothing-item-image {
  transform: scale(0.95);
}
.clothing-item.delete-selected .clothing-item-image::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--delete-color-dark);
  opacity: 0.4;
  z-index: 1;
}
.grid-placeholder {
  display: none; 
  width: 100%;
  text-align: center;
  padding: 4rem 2rem;
  font-size: 1.1rem;
  color: #6b7280;
  grid-column: 1 / -1; 
}

/* --- Camera Pages (Me & Add) --- */
.camera-page-wrapper .helper-text {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  margin-left: auto;
  margin-right: auto;
}
.camera-page-wrapper .form-group {
    text-align: left;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}
.camera-container {
  position: relative;
  width: 100%;
  max-width: 600px;
  margin: 0 auto 1.5rem auto;
  aspect-ratio: 3 / 4;
  background-color: #000;
  border-radius: 12px;
  overflow: hidden;
}
#camera-feed {
  width: 100%;
  height: 100%;
  object-fit: cover; 
}
#pose-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover; 
  opacity: 0.6;
  pointer-events: none;
  filter: grayscale(100%);
}
#snap-photo-btn {
  margin-top: 1.5rem;
}
#preview-wrapper {
  position: relative;
  width: 100%;
  max-width: 600px;
  margin: 0 auto 1.5rem auto;
  aspect-ratio: 3 / 4;
  background-color: #000;
  border-radius: 12px;
  overflow: hidden;
}
#captured-image {
  width: 100%;
  height: 100%;
  object-fit: contain; 
}
#preview-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover; 
  opacity: 0.6;
  pointer-events: none;
  filter: grayscale(100%);
}
.preview-controls {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap; 
}
#drawing-wrapper {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto 1.5rem auto;
    aspect-ratio: 3 / 4;
    border-radius: 12px;
    overflow: hidden;
    background-size: cover;
    background-position: center;
}
#drawing-canvas {
    position: absolute;
    top: 0;
    left: 0;
    cursor: crosshair;
    touch-action: none;
}
#cutout-preview-wrapper {
  position: relative;
  width: 100%;
  max-width: 600px;
  min-height: 400px;
  margin: 0 auto 1.5rem auto;
  aspect-ratio: 3 / 4;
  background-color: var(--light-gray); 
  background-image: 
    linear-gradient(45deg, var(--border-color) 25%, transparent 25%), 
    linear-gradient(-45deg, var(--border-color) 25%, transparent 25%), 
    linear-gradient(45deg, transparent 75%, var(--border-color) 75%), 
    linear-gradient(-45deg, transparent 75%, var(--border-color) 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
  border: 2px dashed var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}
#cutout-image {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.loading-indicator {
    padding: 2rem;
    font-size: 1.2rem;
    color: var(--secondary-color);
    display: none; 
}
#cutout-preview-wrapper.loading .loading-indicator {
    display: block;
}
#cutout-preview-wrapper.loading #cutout-image {
    display: none;
}

.settings-form .form-group {
  margin-bottom: 1.5rem;
}
.settings-form label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.settings-form input {
  width: 100%;
  max-width: 400px;
  padding: 0.8rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
}
.settings-form select {
  width: 100%;
  max-width: 400px;
  padding: 0.8rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  background-color: white;
  color: var(--text-color);
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%2M0-5-1.8-9.2-5.4-12.8z%22%2F%3E%3C%2Fsvg%3E');
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 0.8em auto;
  cursor: pointer;
}
.settings-form input:read-only {
  background-color: var(--light-gray);
  cursor: not-allowed;
  color: #6b7280;
}
.helper-text {
  font-size: 0.85rem;
  color: #6b7280;
  margin-top: 0.5rem;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}
.settings-group {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  margin-top: 2rem;
  margin-bottom: 1.5rem;
}
.settings-group:first-of-type {
  margin-top: 0;
}
.settings-group legend {
  font-weight: 600;
  padding: 0 0.5rem; 
  margin-left: 1rem; 
}
.settings-group .form-group:last-of-type {
  margin-bottom: 0;
}
.settings-group .group-description {
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  color: #6b7280;
}
.form-actions {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}
.form-error-message {
  color: #ef4444; 
  font-size: 0.9rem;
  font-weight: 500;
  text-align: left;
  margin-top: 0.25rem;
  margin-bottom: 1rem;
  display: none; 
}
#countdown-display {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 10rem;
  font-weight: bold;
  color: white;
  z-index: 20;
  display: none; 
  text-shadow: 0 0 15px rgba(0, 0, 0, 0.7);
}
.camera-selector-container {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 20;
}
#camera-menu-btn {
  background-color: rgba(0, 0, 0, 0.4);
  color: white;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 44px;
  text-align: center;
  padding: 0;
}
#camera-menu-btn:hover {
  background-color: rgba(0, 0, 0, 0.6);
}
.camera-list-dropdown {
  display: none; 
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 160px;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  margin-top: 0.5rem;
}
.camera-list-dropdown.show {
  display: block; 
}
.camera-list-item {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  background: none;
  border: none;
  text-align: left;
  font-size: 0.9rem;
  color: var(--text-color);
  cursor: pointer;
}
.camera-list-item:hover {
  background-color: var(--light-gray);
}

/* --- Tester Zone Styles --- */
.tester-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.tester-card h3 {
    margin-top: 0;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.status-badge {
    background: #eee;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: normal;
}
.status-badge.success { background: #dcfce7; color: #166534; }
.status-badge.error { background: #fee2e2; color: #991b1b; }

.console-output {
    background: #1f2937;
    color: #10b981;
    font-family: monospace;
    padding: 1rem;
    border-radius: 6px;
    height: 300px;
    overflow-y: auto;
    font-size: 0.85rem;
    white-space: pre-wrap;
}
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}
.stat-box {
    background: #f9fafb;
    padding: 1rem;
    border-radius: 6px;
    text-align: center;
}
.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #3b82f6;
}
.stat-label {
    font-size: 0.8rem;
    color: #6b7280;
}
.progress-bar {
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 1rem;
}
.progress-fill {
    height: 100%;
    background: #3b82f6;
    width: 0%;
    transition: width 0.2s;
}

/* --- DEV DASHBOARD STYLES --- */
.badge-tester {
    font-size: 0.8rem; background: #fbbf24; color: black; padding: 2px 6px; border-radius: 4px; margin-left: 5px;
}

.dev-toolbar {
    display: flex;
    gap: 1rem;
    background: #fff;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
}
.dev-toolbar .search-input {
    flex: 1;
    padding: 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    min-width: 200px;
}
.dev-toolbar select {
    padding: 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: white;
}

.user-table-container {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 1.5rem;
}
.user-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}
.user-table th, .user-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}
.user-table th {
    background: #f9fafb;
    font-weight: 600;
    color: #6b7280;
    font-size: 0.9rem;
}
.user-table tr:hover {
    background-color: #f9fafb;
}

.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}
.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}
.modal-content h2 {
    margin-top: 0;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}
.input-small {
    width: 80px; 
    padding: 0.5rem; 
    border: 1px solid #ccc; 
    border-radius: 4px;
}
.token-input {
    width: 100%; 
    padding: 0.5rem; 
    font-family: monospace; 
    font-size: 0.8rem; 
    background: #f3f4f6; 
    border: 1px solid #ddd; 
    cursor: pointer;
}

/* --- VERSION HISTORY STYLES --- */
.version-card {
    border-left: 4px solid var(--primary-color);
    background: #fff;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.version-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.version-number {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--secondary-color);
}
.version-date {
    font-size: 0.85rem;
    color: #6b7280;
}
.version-changes {
    list-style-type: disc;
    padding-left: 1.5rem;
    color: var(--text-color);
}
.version-changes li {
    margin-bottom: 0.5rem;
}
.major-group-header {
    font-size: 1.5rem;
    font-weight: 800;
    color: #1f2937;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e5e7eb;
}
.load-more-container {
    text-align: center;
    margin: 2rem 0;
}
.hidden-group {
    display: none;
}

/* --- DEV CONSOLE STYLES (Extracted) --- */
.dev-section-title {
    border-bottom: 1px solid #eee; 
    padding-bottom: 0.5rem;
    margin-top: 1rem;
}
.dev-panel {
    background: white; 
    padding: 1.5rem; 
    border-radius: 8px; 
    border: 1px solid #e5e7eb; 
    margin-bottom: 3rem;
}
.dev-input-group {
    display: flex; 
    gap: 10px; 
    margin-bottom: 1rem; 
    flex-wrap: wrap;
}
.dev-input-row {
    display: flex; 
    gap: 1rem; 
    flex-wrap: wrap; 
    align-items: flex-start; 
    margin-bottom: 1.5rem;
}
.dev-input-flex-1 {
    flex: 1; 
    min-width: 200px;
}
.dev-input-flex-2 {
    flex: 2; 
    min-width: 300px;
}
.dev-label {
    display:block; 
    font-size: 0.9rem; 
    font-weight: 600; 
    margin-bottom: 0.5rem;
}
.input-styled {
    padding: 0.5rem; 
    border: 1px solid #ccc; 
    border-radius: 4px;
}
.input-full {
    width: 100%;
}
.link-highlight {
    display: block; 
    margin-bottom: 1rem; 
    color: var(--primary-color); 
    font-weight: 600;
}

/* --- Queue & Ad Styles --- */
.queue-status-text {
    text-align: center;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    min-height: 1.5rem; /* Reserveer ruimte */
}

/* Container voor de advertentie (Free Users) */
#ad-container {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    display: none; /* Standaard verborgen */
    z-index: 10;
    background-color: #000; /* Video's hebben wel een zwarte achtergrond nodig */
}

#ad-video {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Zorg dat video past */
}

#ad-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ad-label {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(0,0,0,0.5);
    color: white;
    padding: 2px 6px;
    font-size: 0.7rem;
    border-radius: 4px;
    pointer-events: none;
}

/* Container voor quotes (Paid Users) */
#quote-container {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    display: none; /* Standaard verborgen */
    z-index: 10;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    color: var(--secondary-color);
    padding: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    flex-direction: column;
}

#quote-text {
    font-size: 1.2rem;
    font-style: italic;
    margin-bottom: 1rem;
    font-family: serif;
}

#quote-author {
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--primary-color);
}

/* Utility: Verberg elementen standaard */
.hidden {
    display: none;
}

/* Auth Pages (Login, Forgot, Reset) */
.auth-link-container {
    text-align: right;
    margin-bottom: 1rem;
}
.auth-link {
    font-size: 0.9rem;
    color: var(--primary-color);
    text-decoration: none;
}
.auth-link:hover {
    text-decoration: underline;
}
.auth-back-link {
    margin-top: 1rem;
    text-align: center;
}

/* Verify Page Specifiek */
.verify-wrapper {
    max-width: 500px;
    text-align: center;
    padding: 3rem 1rem;
}
.verify-msg {
    margin-bottom: 2rem;
    color: var(--text-color);
}
.verify-title-success {
    color: #22c55e;
}
.verify-title-error {
    color: #ef4444;
}

/* JS Dynamic Messages */
.msg-success {
    color: #22c55e;
    display: block;
    margin-top: 0.5rem;
}
.msg-error {
    color: #ef4444;
    display: block;
    margin-top: 0.5rem;
}

/* Dev Page Specifiek */
.dev-badge-header {
    background: #ef4444;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 5px;
    font-size: 0.8rem;
}
.dev-header-border {
    border-bottom-color: #ef4444;
}
.dev-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}
.form-checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 2rem;
}
.form-checkbox-group label {
    margin: 0;
    cursor: pointer;
}
.form-checkbox-group input {
    width: auto;
    margin: 0;
    cursor: pointer;
}
.modal-footer {
    border: none;
    padding: 0;
    display: flex;
    justify-content: space-between;
}
.modal-btn-group {
    display: flex;
    gap: 10px;
}

/* Login JS Dynamic Button */
.btn-resend-small {
    margin-top: 5px;
    width: auto;
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
}

/* Media Query for Mobile */
@media (max-width: 768px) {
  .main-header {
    justify-content: flex-end; 
  }
  .main-header .brand {
     position: absolute;
     left: 50%;
     transform: translateX(-50%);
     justify-content: center;
     padding: 0;
     z-index: 0; 
  }
  .nav-buttons {
      position: relative;
      z-index: 10;
  }
  .wardrobe-container {
    grid-template-columns: 1fr;
    height: auto;
  }
  .person-viewer {
    height: 50vh;
  }
  .footer-left,
  .footer-right {
    width: 100%;
    justify-content: center;
    margin-bottom: 0.5rem;
  }
  .main-footer {
      justify-content: center;
      text-align: center;
      flex-direction: column; /* Stapel footer items */
  }
  #mobile-menu-btn {
    display: block; 
  }
  #nav-menu-dropdown {
    display: none; 
    position: absolute;
    top: 100%; 
    right: 0;
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 2000;
    width: 200px;
    padding: 0.5rem;
    flex-direction: column; 
    align-items: stretch; 
  }
  #nav-menu-dropdown.show {
    display: flex; 
  }
  .nav-user-name {
    margin: 0;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0.5rem;
    display: flex; 
    align-items: center;
  }
  #user-name-display {
    margin-right: 0; 
  }
  #nav-menu-dropdown button {
    width: 100%; 
    text-align: left;
  }
  .form-actions {
    gap: 1rem;
  }
  .form-actions > div {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
  }
  .form-actions > .btn,
  .form-actions > div .btn {
    width: 100%;
  }
  .clothing-controls {
    gap: 0.5rem; 
  }
  .clothing-controls .btn:first-child {
    width: 100%; 
  }
  #random-btn { 
    flex-grow: 1;
    flex-basis: 0;
  }
  #delete-btn {
    width: 100%;
  }
  .clothing-controls .filter-container {
    display: none; 
  }
  .clothing-picker > .filter-container {
     width: 100%;
     margin-bottom: 1.5rem;
     margin-left: 0; 
     order: -1; 
  }
  .clothing-picker > .filter-container .filter-dropdown-content {
      position: absolute; 
      width: 90%;
      left: 5%;
      right: 5%;
      top: 100%;
      min-width: 0; 
  }
  .clothing-grid {
    grid-template-columns: 1fr 1fr; 
  }
}

/* --- ADMIN PANEL & CHAT STYLES --- */
.admin-badge {
    background: #000; color: #fff; padding: 2px 6px; border-radius: 4px; margin-left: 5px; font-size: 0.8rem;
}

.chat-grid-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .chat-grid-container {
        grid-template-columns: 1fr !important; 
    }
}

.chat-container {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    height: 400px;
    margin-bottom: 2rem;
}

.chat-messages {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column; /* FIX V0.6.7: Column Reverse weggehaald! */
}

.chat-messages-inner {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Chat Date Divider */
.chat-date-divider {
    text-align: center;
    font-size: 0.8rem;
    color: #9ca3af;
    margin: 1rem 0;
    position: relative;
}
.chat-date-divider::before,
.chat-date-divider::after {
    content: "";
    display: inline-block;
    width: 20%;
    height: 1px;
    background: #e5e7eb;
    vertical-align: middle;
    margin: 0 10px;
}

.chat-msg {
    padding: 0.5rem 0.8rem;
    border-radius: 6px;
    background: #fff;
    border: 1px solid #e5e7eb;
    font-size: 0.9rem;
    max-width: 85%;
}
.chat-msg.own {
    align-self: flex-end;
    background: #eff6ff;
    border-color: #bfdbfe;
}
.chat-meta {
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 0.2rem;
    display: flex;
    justify-content: space-between;
}
.chat-role-badge {
    font-size: 0.7rem;
    padding: 1px 4px;
    border-radius: 3px;
    background: #eee;
    color: #555;
    margin-left: 5px;
}

.chat-input-area {
    padding: 0.8rem;
    display: flex;
    gap: 0.5rem;
    background: #fff;
    border-radius: 0 0 8px 8px;
}
.chat-input {
    flex: 1;
    padding: 0.6rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
}

/* Inbox Styles ... (behouden) */
.contact-msg-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    position: relative;
    transition: box-shadow 0.2s;
}
.contact-msg-card.claimed-by-other {
    background-color: #fff1f2; 
    border-color: #fecdd3;
}
.contact-msg-card.claimed-by-me {
    background-color: #f0fdf4; 
    border-color: #bbf7d0;
}

.msg-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.msg-status-open { color: #d97706; font-weight: bold; }
.msg-status-replied { color: #166534; font-weight: bold; }

.claim-badge {
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 12px;
    background: #eee;
    color: #555;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.claim-badge.me { background: #dcfce7; color: #166534; }
.claim-badge.other { background: #fee2e2; color: #991b1b; }

.reply-box {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed #ccc;
    display: none;
}
.reply-box.show { display: block; }

/* Branding Styles ... (behouden) */
.login-logo-large {
    display: block;
    width: 120px;
    height: auto;
    margin: 0 auto 1.5rem auto;
    border-radius: 12px; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.processing-branding {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 5;
    pointer-events: none; 
    display: none; 
}

.processing-branding img {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3); 
    animation: pulse-logo 2s infinite ease-in-out;
}

.processing-branding p {
    margin-top: 1rem;
    font-weight: 600;
    color: var(--secondary-color);
    font-size: 0.9rem;
    opacity: 0.8;
}

@keyframes pulse-logo {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

#cutout-preview-wrapper {
    position: relative; 
}

/* --- V0.7.1: CANVAS EDITOR TOOLS --- */
.editor-controls {
    display: none; /* Verborgen tot editor actief is */
    background: #fff;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-top: 1rem;
    margin-bottom: 1rem;
    text-align: center;
}

.editor-controls.active {
    display: block;
}

.tool-group {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.tool-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    background: #f9fafb;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.tool-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.tool-btn:hover:not(.active) {
    background: #e5e7eb;
}

.slider-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    font-size: 0.9rem;
}

.slider-container input[type=range] {
    width: 150px;
}

/* Zorg dat de canvas in preview-wrapper klikbaar is */
#cutout-preview-wrapper canvas {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    touch-action: none; /* Voorkom scrollen op mobiel */
    cursor: crosshair;
}
#cutout-preview-wrapper canvas.move-cursor {
    cursor: move;
}

.note-box {
    background-color: #eff6ff;
    border-left: 4px solid #3b82f6;
    padding: 0.8rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: #1e3a8a;
    text-align: left;
}