/* ===== UPLOAD MODAL POPUP ===== */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.85);
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: #111;
  color: #fff;
  width: 480px;
  max-width: 92vw;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  animation: scaleIn 0.25s ease;
}

.code-header {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 6px 12px;
  background: #222;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.dot-red { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green { background: #27c93f; }

.modal-body {
  padding: 20px 22px;
  text-align: center;
}

.modal-category .category-icon {
  font-size: 38px;
  margin-bottom: 8px;
  color: #667eea;
}

.modal-category .category-title {
  font-weight: 900;
  letter-spacing: 0.6px;
  font-size: 1.3rem;
  margin-top: 8px;
}

.modal-category .category-desc {
  color: #bbb;
  font-size: 0.9rem;
  margin-top: 4px;
}

/* File Upload Button */
.file-upload {
  display: flex;
  justify-content: center;
  margin: 12px 0 10px;
}

.file-upload input[type="file"] {
  display: none;
}

.file-upload > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #222;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid #333;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.file-upload > span:hover {
  background: #2a2a2a;
}

/* ✅ Video URL Section Styles */
.video-url-section {
  margin-top: 15px;
  padding: 15px;
  background: rgba(102, 126, 234, 0.05);
  border: 1px solid rgba(102, 126, 234, 0.2);
  border-radius: 10px;
}

.video-url-section input[type="url"] {
  width: 100%;
  padding: 12px;
  background: #1a1a2e;
  border: 2px solid #2d2d44;
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  transition: border-color 0.2s;
}

.video-url-section input[type="url"]:focus {
  outline: none;
  border-color: #667eea;
}

.video-url-section input[type="url"]::placeholder {
  color: #8892b0;
}

.video-url-section button {
  margin-top: 10px;
  width: 100%;
  padding: 12px;
  background: #667eea;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.video-url-section button:hover {
  background: #5568d3;
}

.video-url-section button:active {
  transform: scale(0.98);
}

/* Preview Area */
.preview {
  width: 100%;
  height: 160px;
  max-height: 32vh;
  background: #0d0d0d;
  border: 1px solid #333;
  border-radius: 10px;
  margin: 12px 0 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.preview img,
.preview video,
.preview canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.preview video {
  background: #000;
}

/* Upload Button */
.upload-btn {
  background: #667eea;
  color: #fff;
  border: none;
  padding: 12px 18px;
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.upload-btn:hover {
  background: #5568d3;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.upload-btn:active {
  transform: translateY(0);
}

/* Close Button */
.close-btn {
  margin-top: 10px;
  background: #444;
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.close-btn:hover {
  background: #666;
}

/* Result Message */
.result {
  margin-top: 12px;
  font-size: 0.95rem;
  border-radius: 10px;
  padding: 10px;
  animation: fadeIn 0.3s ease;
}

.result.success {
  color: #28a745;
  background: rgba(40, 167, 69, 0.1);
  border: 1px solid rgba(40, 167, 69, 0.3);
}

.result.error {
  color: #dc3545;
  background: rgba(220, 53, 69, 0.1);
  border: 1px solid rgba(220, 53, 69, 0.3);
}

.result.loading {
  color: #8bd5ef;
  background: rgba(139, 213, 239, 0.08);
  border: 1px solid rgba(139, 213, 239, 0.25);
}

/* ✅ Analysis Results Styles */
.analysis-results {
  text-align: left;
  margin-top: 15px;
}

.analysis-results h4 {
  color: #4ecdc4;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.result-item {
  background: rgba(40, 167, 69, 0.1);
  border: 1px solid rgba(40, 167, 69, 0.3);
  padding: 12px;
  border-radius: 8px;
  margin: 10px 0;
  line-height: 1.6;
}

.result-item.success {
  background: rgba(40, 167, 69, 0.1);
  border-color: rgba(40, 167, 69, 0.3);
}

.result-item.warning {
  background: rgba(255, 193, 7, 0.1);
  border-color: rgba(255, 193, 7, 0.3);
  color: #ffc107;
}

.result-item strong {
  display: block;
  margin-bottom: 5px;
  color: #fff;
}

.result-item a {
  color: #667eea;
  text-decoration: none;
  transition: color 0.2s;
}

.result-item a:hover {
  color: #8b9eff;
  text-decoration: underline;
}

/* File Chip */
.file-chip {
  background: #1e1e1e;
  border: 1px solid #333;
  padding: 8px 12px;
  border-radius: 9999px;
  font-size: 0.9rem;
  color: #ddd;
  display: inline-block;
}

/* Mobile */
@media (max-width: 420px) {
  .modal-content {
    width: 95vw;
  }
  
  .preview {
    height: 140px;
    max-height: 30vh;
  }
  
  .video-url-section {
    padding: 12px;
  }
  
  .video-url-section input[type="url"],
  .video-url-section button {
    font-size: 13px;
  }
}

/* Animations */
@keyframes scaleIn {
  from {
    transform: scale(0.86);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ✅ Loading Spinner */
.result.loading::before {
  content: "⏳ ";
  animation: spin 1s linear infinite;
  display: inline-block;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
