* {
  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;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  background: white;
  border-radius: 20px;
  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.5rem;
  margin-bottom: 10px;
  font-weight: 300;
}

.header p {
  font-size: 1.1rem;
  opacity: 0.9;
}

.privacy-banner .note-inline {
  display: inline-block;   /* makes width control possible */
  max-width: 480px;        /* adjust until it wraps nicely into two lines */
  line-height: 1.4;
  text-align: left;        /* keeps it readable */
}

.privacy-banner {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: white;
  padding: 20px;
  text-align: center;
  font-weight: 500;
}

.privacy-banner .lock-icon {
  font-size: 1.2rem;
  margin-right: 10px;
}

.main-content {
  padding: 40px;
}

.file-upload {
  background: #f8f9fa;
  border: 3px dashed #dee2e6;
  border-radius: 15px;
  padding: 40px;
  text-align: center;
  margin-bottom: 30px;
  transition: all 0.3s ease;
}

.file-upload:hover {
  border-color: #4facfe;
  background: #f0f8ff;
}

.file-upload.dragover {
  border-color: #4facfe;
  background: #e3f2fd;
}

.file-input {
  display: none;
}

.file-label {
  display: inline-block;
  padding: 15px 30px;
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  color: white;
  border-radius: 25px;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.file-label:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(79, 172, 254, 0.3);
}

.file-info {
  margin-top: 20px;
  color: #6c757d;
}

.settings-section {
  background: #f8f9fa;
  border-radius: 15px;
  padding: 30px;
  margin-bottom: 30px;
}

.settings-section h3 {
  color: #495057;
  margin-bottom: 20px;
  font-size: 1.3rem;
  border-bottom: 2px solid #e9ecef;
  padding-bottom: 10px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.setting-group {
  display: flex;
  flex-direction: column;
  height: 80px;
  justify-content: flex-start;
}

.setting-group label {
  font-weight: 500;
  color: #495057;
  margin-bottom: 8px;
}

.setting-group select,
.setting-group input {
  padding: 12px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
  width: 100%;
}

.setting-group select:focus,
.setting-group input:focus {
  outline: none;
  border-color: #4facfe;
}

.mode-stack {
  position: relative;
  min-height: 80px;   /* keep the slot height stable */
}

.mode-option {
  position: absolute;
  inset: 0;
  display: none;      /* hidden by default */
}

.mode-option.active {
  display: flex;      /* only the active one shows */
  flex-direction: column;
}


.preset-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.preset-btn {
  padding: 10px 20px;
  border: 2px solid #e9ecef;
  background: white;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
}

.preset-btn:hover {
  border-color: #4facfe;
  background: #f0f8ff;
}

.preset-btn.active {
  background: #4facfe;
  color: white;
  border-color: #4facfe;
}

.compress-btn {
  width: 100%;
  padding: 20px;
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
  color: white;
  border: none;
  border-radius: 15px;
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 30px;
}

.compress-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 15px 30px rgba(255, 107, 107, 0.3);
}

.compress-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.progress-section {
  background: #e8f5e8;
  border-radius: 15px;
  padding: 20px;
  margin-bottom: 30px;
  display: none;
}

.progress-section.show {
  display: block;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  font-weight: 500;
  color: #495057;
}

.progress-bar {
  width: 100%;
  height: 20px;
  background: #e9ecef;
  border-radius: 10px;
  overflow: hidden;
  margin: 15px 0;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
  width: 0%;
  transition: width 0.3s ease;
}

.progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.8rem;
  font-weight: 600;
  color: #495057;
  text-shadow: 0 0 2px rgba(255,255,255,0.8);
}

.log {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 15px;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  color: #495057;
  max-height: 200px;
  overflow-y: auto;
  border-left: 4px solid #4facfe;
}

.result-section {
  background: #f8f9fa;
  border-radius: 15px;
  padding: 30px;
  margin-bottom: 30px;
  display: none;
}

.result-section.show {
  display: block;
}

.video-preview {
  width: 100%;
  max-width: 600px;
  border-radius: 10px;
  margin: 20px 0;
}

.download-btn {
  display: inline-block;
  padding: 15px 30px;
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: white;
  text-decoration: none;
  border-radius: 25px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(40, 167, 69, 0.3);
}

.adsense-placeholder {
  background: #f8f9fa;
  border: 2px dashed #dee2e6;
  border-radius: 15px;
  padding: 40px;
  text-align: center;
  margin: 30px 0;
  color: #6c757d;
}

.adsense-placeholder h4 {
  margin-bottom: 10px;
  color: #495057;
}

.reminder-section {
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  border-radius: 15px;
  padding: 20px;
  margin: 30px 0;
  color: #856404;
}

.reminder-section h4 {
  color: #856404;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
}

.reminder-section .info-icon {
  margin-right: 8px;
  font-size: 1.2rem;
}

.reminder-section ul {
  margin-left: 20px;
  margin-top: 10px;
}

.reminder-section li {
  margin-bottom: 5px;
}

.browser-limitations {
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  border-radius: 15px;
  padding: 20px;
  margin: 30px 0;
  color: #721c24;
}

.browser-limitations h4 {
  color: #721c24;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
}

.browser-limitations .warning-icon {
  margin-right: 8px;
  font-size: 1.2rem;
}

.browser-limitations ul {
  margin-left: 20px;
  margin-top: 10px;
}

.browser-limitations li {
  margin-bottom: 5px;
}

.browser-limitations .privacy-highlight {
  background: #d4edda;
  border: 1px solid #c3e6cb;
  border-radius: 8px;
  padding: 15px;
  margin-top: 15px;
  color: #155724;
  text-align: center;
  font-weight: 600;
}

@media (max-width: 768px) {
  .container {
    margin: 10px;
    border-radius: 15px;
  }
  
  .main-content {
    padding: 20px;
  }
  
  .settings-grid {
    grid-template-columns: 1fr;
  }
  
  .header h1 {
    font-size: 2rem;
  }
}

.footer {
  text-align: center;
  padding: 20px;
  font-size: 0.9rem;
  color: #6c757d;
  border-top: 1px solid #e9ecef;
  background: #f8f9fa;
}

.footer a {
  color: #4facfe;
  text-decoration: none;
  font-weight: 500;
}

.footer a:hover {
  text-decoration: underline;
}