﻿/* Test9e - style.css */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 20px;
}

.app-container {
  max-width: 1400px;
  margin: 0 auto;
  background: white;
  border-radius: 15px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.1);
  overflow: hidden;
}

header {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  color: white;
  padding: 30px;
  text-align: center;
}
header h1 { font-size: 2.2em; margin-bottom: 6px; }

.main-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  padding: 30px;
  min-height: 500px;
}

.photo-source, .gallery-builder {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 20px;
}
.photo-source h3, .gallery-builder h3 { margin-bottom: 16px; color: #333; font-size: 1.2em; }

/* Left library */
.photo-library {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 15px;
  max-height: 400px;
  overflow-y: auto;
  margin-bottom: 12px;
  padding: 10px;
  border: 2px dashed #ddd;
  border-radius: 8px;
  background: #fff;
}
.photo-library.drag-over { border-color: #4facfe; background: rgba(79,172,254,0.08); }
.left-drop-hint { grid-column: 1 / -1; text-align: center; color: #8b8f98; font-size: 0.95em; padding: 16px 0; }

.photo-item {
  position: relative;
  cursor: grab;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  background: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.photo-item:hover { transform: translateY(-3px); box-shadow: 0 5px 15px rgba(0,0,0,0.2); }
.photo-item.dragging { opacity: 0.5; transform: rotate(5deg); cursor: grabbing; }
.photo-item img { width: 100%; height: 100px; object-fit: cover; display: block; }
.photo-caption { padding: 8px; font-size: 0.8em; color: #666; background: white; border-top: 1px solid #eee; }

/* Controls */
.gallery-controls {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px; padding: 12px; background: white; border-radius: 8px;
}
.gallery-controls select {
  padding: 8px 12px; border: 1px solid #ddd; border-radius: 5px; margin-left: 10px;
}

/* Drop zone (right) */
.drop-zone {
  min-height: 400px; border: 3px dashed #ccc; border-radius: 10px;
  position: relative; transition: all 0.3s ease; background: #fff;
}
.drop-zone.drag-over { border-color: #4facfe; background-color: rgba(79,172,254,0.1); transform: scale(1.02); }
.drop-message {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  text-align: center; color: #999; pointer-events: none;
}
.drop-message p { margin-bottom: 8px; font-size: 1.05em; }
.hint { font-size: 0.9em !important; color: #bbb !important; }

/* Gallery grid */
.gallery-grid { display: grid; gap: 15px; padding: 20px; min-height: 360px; }
.gallery-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.gallery-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.gallery-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

.gallery-item {
  position: relative; background: white; border-radius: 8px; overflow: hidden;
  box-shadow: 0 3px 10px rgba(0,0,0,0.1); transition: transform 0.2s;
}
.gallery-item:hover { transform: translateY(-2px); }
.gallery-item img { width: 100%; height: 150px; object-fit: cover; }
.gallery-item .caption { padding: 10px; font-size: 0.9em; color: #555; }

.remove-btn {
  position: absolute; top: 5px; right: 5px;
  background: rgba(200, 0, 0, 0.9); color: white; border: none;
  border-radius: 50%; width: 25px; height: 25px; cursor: pointer; font-size: 0.8em;
  display: flex; align-items: center; justify-content: center;
}
.remove-btn:hover { background: rgba(160, 0, 0, 1); }

/* Output section */
.output-section { background: #2c3e50; color: white; padding: 30px; }
.output-section h3 { margin-bottom: 10px; font-size: 1.2em; }
.output-hint { margin-bottom: 16px; color: #bdc3c7; font-size: 0.9em; }
.code-output { position: relative; }
.code-output textarea {
  width: 100%; height: 150px; padding: 15px; border: none; border-radius: 8px;
  font-family: 'Courier New', monospace; font-size: 0.9em; background: #34495e; color: #ecf0f1;
  resize: vertical;
}

/* Buttons */
.load-more-btn, .clear-btn, .copy-btn {
  padding: 10px 20px; border: none; border-radius: 5px; cursor: pointer; font-weight: bold; transition: all 0.2s;
}
.load-more-btn { background: #3498db; color: white; width: 100%; }
.load-more-btn:hover { background: #2980b9; }
.clear-btn { background: #e74c3c; color: white; }
.clear-btn:hover { background: #c0392b; }
.copy-btn { position: absolute; top: 10px; right: 10px; background: #27ae60; color: white; }
.copy-btn:hover { background: #229954; }
.copy-btn.copied { background: #f39c12; }

/* Row under the photo library */
.photo-actions { display: flex; gap: 10px; margin-top: 8px; }
.small-btn { padding: 8px 12px; font-size: 0.9em; }
.photo-actions .load-more-btn { width: auto; flex: 1; }
.clear-photos-btn {
  background: #95a5a6; color: white; border: none; border-radius: 5px; font-weight: bold; transition: all 0.2s; flex: 1;
}
.clear-photos-btn:hover { background: #7f8c8d; }

/* Post meta (Title + Description) under gallery */
.post-meta {
  display: flex; flex-direction: column; gap: 8px; margin-top: 16px; background: #fff;
  border: 1px solid #e9ecef; border-radius: 8px; padding: 12px;
}
.post-meta label { color: #333; font-size: 0.95em; }
.post-meta input[type="text"], .post-meta textarea {
  padding: 10px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 0.95em; background: #fff;
}
.post-meta textarea { resize: vertical; min-height: 80px; }

/* Responsive */
@media (max-width: 768px) {
  .main-content { grid-template-columns: 1fr; }
  .gallery-controls { flex-direction: column; gap: 10px; }
  .photo-library { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
  .photo-actions { flex-direction: column; }
}
