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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f0f2f5;
  color: #1a1a2e;
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

/* === LOGIN === */
#login-screen {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

.login-box {
  background: white;
  padding: 2.5rem;
  border-radius: 16px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  text-align: center;
}

.login-box h1 {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
  color: #1a1a2e;
}

.login-box > p {
  color: #666;
  margin-bottom: 1.5rem;
}

.login-box form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

input[type="password"] {
  padding: 0.75rem 1rem;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s;
}

input[type="password"]:focus {
  outline: none;
  border-color: #0f3460;
}

button[type="submit"],
#upload-btn {
  padding: 0.75rem 1.5rem;
  background: #0f3460;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

button[type="submit"]:hover,
#upload-btn:hover {
  background: #16213e;
}

button[type="submit"]:active,
#upload-btn:active {
  transform: scale(0.98);
}

button[type="submit"]:disabled,
#upload-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.error {
  color: #e74c3c;
  font-size: 0.9rem;
}

/* === HOOFD APP === */
#app-screen {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  margin-bottom: 2rem;
  border-bottom: 2px solid #e0e0e0;
}

header h1 {
  font-size: 1.8rem;
  color: #1a1a2e;
}

.secondary-btn {
  padding: 0.5rem 1rem;
  background: transparent;
  color: #666;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.secondary-btn:hover {
  border-color: #0f3460;
  color: #0f3460;
}

/* === UPLOAD === */
.upload-section {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.upload-section h2 {
  margin-bottom: 1.5rem;
  color: #1a1a2e;
}

.drop-zone {
  border: 2px dashed #c0c0c0;
  border-radius: 12px;
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: #fafafa;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: #0f3460;
  background: #f0f4ff;
}

.drop-zone-content {
  pointer-events: none;
}

.upload-icon {
  font-size: 3rem;
  color: #c0c0c0;
  display: block;
  margin-bottom: 1rem;
  font-weight: 300;
}

.drop-zone p {
  font-size: 1.1rem;
  color: #555;
  margin-bottom: 0.25rem;
}

.drop-zone .sub {
  font-size: 0.85rem;
  color: #999;
}

.file-list {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
}

.file-item-preview {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 6px;
}

.file-item-info {
  flex: 1;
}

.file-item-name {
  font-weight: 500;
  font-size: 0.9rem;
}

.file-item-size {
  font-size: 0.8rem;
  color: #999;
}

.file-item-remove {
  background: none;
  border: none;
  color: #e74c3c;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0.25rem;
  line-height: 1;
}

#upload-btn {
  margin-top: 1rem;
  width: 100%;
}

.progress-container {
  margin-top: 1rem;
}

.progress-bar {
  height: 8px;
  background: linear-gradient(90deg, #0f3460, #e94560);
  border-radius: 4px;
  width: 0%;
  transition: width 0.3s;
}

#progress-text {
  font-size: 0.9rem;
  color: #666;
  margin-top: 0.5rem;
  text-align: center;
}

.result-message {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  text-align: center;
}

.result-message.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.result-message.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* === GALERIJ === */
.gallery-section {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.gallery-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.gallery-header h2 {
  color: #1a1a2e;
}

.loading,
.empty-message {
  text-align: center;
  padding: 3rem;
  color: #999;
}

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

.gallery-item {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 1;
  cursor: pointer;
  background: #f0f2f5;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s, box-shadow 0.2s;
}

.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

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

.gallery-item-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  color: white;
  padding: 1rem 0.75rem 0.75rem;
  font-size: 0.8rem;
  opacity: 0;
  transition: opacity 0.2s;
}

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

/* === LIGHTBOX === */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 2rem;
}

.lightbox img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
}

.lightbox-close {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  background: rgba(255,255,255,0.1);
  border: 2px solid rgba(255,255,255,0.3);
  color: white;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.lightbox-close:hover {
  background: rgba(255,255,255,0.2);
}

#lightbox-caption {
  color: rgba(255,255,255,0.7);
  margin-top: 1rem;
  font-size: 0.9rem;
}

/* === RESPONSIVE === */
@media (max-width: 600px) {
  #app-screen {
    padding: 1rem;
  }

  header h1 {
    font-size: 1.3rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .drop-zone {
    padding: 2rem 1rem;
  }
}
