* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: url('/static/background.jpg') center center / cover no-repeat fixed;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 40px;
  position: relative;
  overflow: hidden;
}

/* Top Menu */
.top-menu {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 100;
  display: flex;
  gap: 20px;
}

.menu-link {
  color: white;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  transition: all 0.2s;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 0;
}

.menu-link:hover {
  background: rgba(255, 255, 255, 0.2);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}

/* Popup Panel */
.popup-panel {
  position: fixed;
  top: 0;
  right: -400px;
  width: 400px;
  height: 100vh;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  box-shadow: -2px 0 20px rgba(0, 0, 0, 0.3);
  z-index: 200;
  transition: right 0.3s ease;
  overflow-y: auto;
  padding: 40px 30px;
}

.popup-panel.open {
  right: 0;
}

.popup-close {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 24px;
  cursor: pointer;
  color: #666;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  transition: all 0.2s;
}

.popup-close:hover {
  background: rgba(0, 0, 0, 0.1);
  color: #333;
}

.popup-content {
  margin-top: 20px;
}

.popup-content h2 {
  font-size: 28px;
  margin-bottom: 20px;
  color: #1a1a1a;
}

.popup-content h3 {
  font-size: 18px;
  margin-top: 24px;
  margin-bottom: 12px;
  color: #333;
}

.popup-content p {
  line-height: 1.6;
  color: #555;
  margin-bottom: 12px;
}

.popup-content ul {
  margin-left: 20px;
  margin-bottom: 12px;
}

.popup-content li {
  line-height: 1.6;
  color: #555;
  margin-bottom: 8px;
}

.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 199;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.popup-overlay.open {
  opacity: 1;
  pointer-events: all;
}

body::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  pointer-events: none;
  z-index: 0;
}

body.dragover::before {
  background: rgba(114, 114, 114, 0.2);
}

.container {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-start;
  padding-left: 380px;
}

/* Left Panel - Options */
.left-panel {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 30px;
  width: 380px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
}

/* Right Panel - Preview Gallery */
.right-panel {
  flex: 1;
  display: none; /* Hidden until previews load */
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  padding: 30px;
}

.right-panel.visible {
  display: flex;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.preview-item {
  position: relative;
  border-radius: 0;
  overflow: hidden;
  border: 2px solid #ddd;
  background: #f9f9f9;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  aspect-ratio: 16/9;
}

.preview-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  border-color: #bbb;
}

.preview-item.selected {
  border: 3px solid #727272;
  box-shadow: 0 0 12px rgba(114, 114, 114, 0.5);
}

.preview-checkbox {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 24px;
  height: 24px;
  cursor: pointer;
  z-index: 10;
  accent-color: #727272;
}

.preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.preview-name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 8px;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Modal for full-size preview */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.9);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 40px;
  font-size: 48px;
  color: white;
  cursor: pointer;
  z-index: 10000;
  transition: transform 0.2s;
}

.modal-close:hover {
  transform: scale(1.2);
}

.modal-content {
  max-width: 90vw;
  max-height: 90vh;
  text-align: center;
}

.modal-content img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 0;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.modal-caption {
  color: white;
  margin-top: 16px;
  font-size: 18px;
  font-weight: 500;
}

h1 {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 24px;
  color: #1a1a1a;
}

.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  font-weight: 500;
  margin-bottom: 8px;
  color: #333;
  font-size: 14px;
}

input[type="email"] {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 0;
  font-size: 14px;
  transition: border-color 0.2s;
}

input[type="email"]:focus {
  outline: none;
  border-color: #727272;
}

.options-section {
  background: #f8f9fa;
  padding: 16px;
  border-radius: 0;
  margin-bottom: 16px;
}

.options-title {
  font-weight: 600;
  margin-bottom: 12px;
  font-size: 14px;
  color: #1a1a1a;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: #555;
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

select {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 0;
  font-size: 14px;
  background: white;
  cursor: pointer;
}

.hint {
  font-size: 12px;
  color: #666;
  margin-top: 6px;
  line-height: 1.4;
}

/* Drop zone instructions */
.drop-hint {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
  z-index: 0;
  color: white;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  transition: all 0.3s ease;
}

.drop-hint.top {
  top: 80px;
  left: 50%;
  transform: translate(-50%, 0);
  font-size: 14px;
}

.drop-hint-icon {
  font-size: 120px;
  margin-bottom: 20px;
  opacity: 0.7;
}

.drop-hint.top .drop-hint-icon {
  display: none;
}

.drop-hint-text {
  font-size: 32px;
  font-weight: 600;
  margin-bottom: 10px;
}

.drop-hint.top .drop-hint-text {
  font-size: 18px;
  margin-bottom: 0;
}

.drop-hint-subtext {
  font-size: 18px;
  opacity: 0.9;
}

.drop-hint.top .drop-hint-subtext {
  font-size: 13px;
}

body.dragover .drop-hint {
  animation: pulse 0.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

.file-info {
  background: #e6f7ff;
  border: 1px solid #91d5ff;
  padding: 16px;
  border-radius: 0;
  margin: 20px 0;
  display: none;
  width: 100%;
}

.file-list {
  margin: 20px 0;
  display: none;
  max-height: 300px;
  overflow-y: auto;
}

.file-list::-webkit-scrollbar {
  width: 2px;
}

.file-list::-webkit-scrollbar-track {
  background: transparent;
}

.file-list::-webkit-scrollbar-thumb {
  background: #91d5ff;
  border-radius: 0;
}

.file-list::-webkit-scrollbar-thumb:hover {
  background: #69c0ff;
}

.file-item-name {
  font-weight: 500;
  color: #096dd9;
  font-size: 13px;
}

.file-item-delete {
  color: #ff4d4f;
  cursor: pointer;
  font-size: 18px;
  font-weight: bold;
  line-height: 1;
  transition: color 0.2s;
  margin-left: 8px;
}

.file-item-delete:hover {
  color: #cf1322;
}


.button-group {
  margin-top: auto;
  padding-top: 20px;
}

button {
  width: 100%;
  padding: 14px 24px;
  border: none;
  border-radius: 0;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  margin-bottom: 10px;
}

.btn-primary {
  background: #727272;
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: #3a8ee6;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(114, 114, 114, 0.4);
}

.btn-primary:disabled {
  background: #a0cfff;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: white;
  color: #666;
  border: 1px solid #ddd;
}

.btn-secondary:hover {
  background: #f5f5f5;
}

.log {
  width: 100%;
  margin-top: 20px;
  padding: 16px;
  background: #f8f9fa;
  border-radius: 0;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  color: #333;
  white-space: pre-wrap;
  max-height: 200px;
  overflow-y: auto;
  display: none;
}

#fileInput { display: none; }

@media (max-width: 768px) {
  body {
    padding: 20px;
  }
  
  .left-panel {
    width: 100%;
    max-width: 400px;
  }
  
  .drop-hint-icon {
    font-size: 80px;
  }
  
  .drop-hint-text {
    font-size: 24px;
  }
  
  .drop-hint-subtext {
    font-size: 16px;
  }
}

/* Account Panel Styles */
.account-form-group {
  margin-bottom: 16px;
}

.account-form-group label {
  display: block;
  font-size: 13px;
  color: #333;
  margin-bottom: 6px;
  font-weight: 500;
}

.account-form-group input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 0;
  font-size: 14px;
  transition: border-color 0.2s;
}

.account-form-group input:focus {
  outline: none;
  border-color: #727272;
}

.account-btn {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 0;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 10px;
}

.account-btn-primary {
  background: #727272;
  color: white;
}

.account-btn-primary:hover {
  background: #45a049;
}

.account-btn-secondary {
  background: transparent;
  color: #727272;
  border: 1px solid #727272;
}

.account-btn-secondary:hover {
  background: rgba(114, 114, 114, 0.1);
}

.account-user-info {
  padding: 16px;
  background: rgba(114, 114, 114, 0.1);
  border-radius: 0;
  margin-bottom: 20px;
}

.account-user-email {
  font-size: 14px;
  color: #333;
  margin-bottom: 8px;
}

.account-user-credits {
  font-size: 20px;
  font-weight: 700;
  color: #727272;
}

.account-credit-input {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.account-credit-input input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 0;
  font-size: 14px;
}

.account-jobs-list {
  margin-bottom: 20px;
}

.account-jobs-title {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin-bottom: 12px;
}

.account-job-item {
  padding: 10px;
  margin-bottom: 8px;
  border-radius: 0;
  background: rgba(0, 0, 0, 0.03);
  font-size: 13px;
  text-decoration: none;
  display: block;
  transition: all 0.2s;
}

.account-job-completed {
  color: #727272;
}

.account-job-completed:hover {
  background: rgba(114, 114, 114, 0.1);
}

.account-job-failed {
  color: #f44336;
}

.account-job-failed:hover {
  background: rgba(244, 67, 54, 0.1);
}

.account-job-processing {
  color: #999;
  background: linear-gradient(90deg, #f5f5f5 0%, #e0e0e0 50%, #f5f5f5 100%);
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
  cursor: default;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.account-divider {
  height: 1px;
  background: #ddd;
  margin: 20px 0;
}
