body {
  box-sizing: border-box;
  background: #f4f6fa;
  font-family: 'Segoe UI', Arial, sans-serif;
  color: #222;
  margin: 0;
  min-height: 100vh;
  padding: 10px;
}

body.dark-theme {
  background: #181c22;
  color: #e6eaf1;
}

body.dark-theme .container {
  background: #23272f;
  box-shadow: 0 4px 24px rgba(10, 10, 20, 0.18);
}

body.dark-theme .field input {
  background: #23272f;
  border: 1.5px solid #353b45;
  color: #e6eaf1;
}

body.dark-theme .field input:focus {
  border: 1.5px solid #50e3c2;
  background: #23272f;
}

body.dark-theme .field label {
  color: #b0b8c9;
}

body.dark-theme .switchers {
  color: #e6eaf1;
}

body.dark-theme .custom-radio {
  background: #23272f;
  border: 2px solid #353b45;
}

body.dark-theme .radio input[type="radio"]:checked+.custom-radio {
  border: 2.5px solid #50e3c2;
  background: #23272f;
}

body.dark-theme .radio input[type="radio"]:checked+.custom-radio::after {
  background: #50e3c2;
}

body.dark-theme .submit-btn {
  background: linear-gradient(90deg, #2d3340 0%, #50e3c2 100%);
  color: #fff;
}

body.dark-theme .submit-btn::after {
  background: linear-gradient(90deg, rgba(44, 52, 70, 0.85) 0%, rgba(80, 227, 194, 0.18) 100%);
  opacity: 0;
}

body.dark-theme .submit-btn:hover::after {
  opacity: 1;
  background: linear-gradient(90deg, rgba(53, 122, 184, 0.32) 0%, rgba(80, 227, 194, 0.18) 100%);
}

body.dark-theme .theme-toggle {
  background: #23272f;
  border: 1.5px solid #353b45;
  color: #e6eaf1;
}

body.dark-theme .theme-toggle:hover {
  background: #181c22;
  border: 1.5px solid #50e3c2;
}

.container {
  max-width: 900px;
  margin: 20vh auto 40px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 4px 24px rgba(60, 60, 90, 0.08);
  padding: 40px 32px 32px 32px;
}

.switchers {
  display: flex;
  gap: 32px;
  margin-bottom: 36px;
}

.radio {
  display: flex;
  align-items: center;
  font-size: 1.2rem;
  cursor: pointer;
  position: relative;
  user-select: none;
}

.radio input[type="radio"] {
  display: none;
}

.custom-radio {
  width: 20px;
  height: 20px;
  border: 2px solid #b0b8c9;
  border-radius: 50%;
  margin-right: 10px;
  background: #f4f6fa;
  display: inline-block;
  position: relative;
  transition: border 0.2s;
}

.radio input[type="radio"]:checked+.custom-radio {
  border: 2px solid #4a90e2;
  background: #eaf3fb;
}

.radio input[type="radio"]:checked+.custom-radio::after {
  content: '';
  display: block;
  width: 10px;
  height: 10px;
  background: #4a90e2;
  border-radius: 50%;
  position: absolute;
  top: 3px;
  left: 3px;
}

.search-form {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.fields {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.fields-row {
  display: flex;
  gap: 24px;
  justify-content: space-between;
}

.field {
  flex: 1;
  display: flex;
  flex-direction: column;
  transition: opacity 0.35s cubic-bezier(.4, 0, .2, 1), max-height 0.35s cubic-bezier(.4, 0, .2, 1), visibility 0.35s;
  opacity: 1;
  max-height: 200px;
  visibility: visible;
}

.field label {
  font-size: 1rem;
  margin-bottom: 8px;
  color: #3a3a4a;
}

.field input {
  padding: 10px 14px;
  border: 1.5px solid #dbe2ea;
  border-radius: 10px;
  background: #f8fafc;
  font-size: 1rem;
  transition: border 0.2s;
  outline: none;
}

.field input:focus {
  border: 1.5px solid #4a90e2;
  background: #eaf3fb;
}

.submit-btn {
  position: relative;
  overflow: hidden;
  margin-top: 24px;
  padding: 12px 32px;
  background: linear-gradient(90deg, #4a90e2 0%, #50e3c2 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(60, 60, 90, 0.08);
  cursor: pointer;
  transition: box-shadow 0.2s;
}

.submit-btn::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, #357ab8 0%, #3cc9a7 100%);
  opacity: 0;
  transition: opacity 0.35s cubic-bezier(.4, 0, .2, 1);
  z-index: 1;
}

.submit-btn:hover::after {
  opacity: 1;
}

.submit-btn span {
  position: relative;
  z-index: 2;
}

.submit-btn:hover {
  box-shadow: 0 4px 16px rgba(60, 60, 90, 0.12);
}

@media (max-width: 900px) {
  .fields-row {
    flex-direction: column;
    gap: 18px;
  }

  .container {
    padding: 24px 8px;
  }
}

.theme-toggle {
  position: fixed;
  top: 24px;
  right: 32px;
  z-index: 100;
  background: #fff;
  border: 1.5px solid #dbe2ea;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(60, 60, 90, 0.08);
  cursor: pointer;
  transition: background 0.2s, border 0.2s;
  font-size: 1.4rem;
  outline: none;
}

.theme-toggle:hover {
  background: #f4f6fa;
  border: 1.5px solid #4a90e2;
}

.theme-icon {
  pointer-events: none;
  transition: color 0.2s;
}

@media (max-width: 600px) {
  .theme-toggle {
    top: 12px;
    right: 12px;
    width: 38px;
    height: 38px;
    font-size: 1.1rem;
  }
}

.icon-youtube,
.icon-reddit {
  margin-right: 8px;
  vertical-align: middle;
  color: #b0b8c9;
  transition: color 0.2s;
}

.radio input[type="radio"]:checked~.icon-youtube {
  color: #FF0000;
}

.radio input[type="radio"]:checked~.icon-reddit {
  color: #FF4500;
}

.platform-label {
  vertical-align: middle;
}

.input-error {
  border: 1.5px solid #ff4d4f !important;
  background: #fff0f0 !important;
  transition: border 0.2s, background 0.2s;
}

.field-hide {
  opacity: 0;
  max-height: 0;
  visibility: hidden;
  pointer-events: none;
}

.btn-disabled {
  opacity: 0.6;
  cursor: not-allowed !important;
  pointer-events: none;
  box-shadow: none !important;
}

.submit-btn:disabled::after {
  opacity: 0 !important;
}

.btn-spinner {
  vertical-align: middle;
  display: inline-block;
}

.submit-btn.loading .btn-text {
  display: none;
}

.submit-btn.loading .btn-spinner {
  display: flex !important;
  align-items: center;
  justify-content: center;
}

/* Попап успіху */
.popup {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.popup-content {
  background: #fff;
  padding: 32px 24px 24px 24px;
  border-radius: 12px;
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.15);
  text-align: center;
  min-width: 260px;
}

.popup-message {
  display: block;
  font-size: 1.2em;
  margin-bottom: 18px;
  color: #222;
}

.popup-close {
  background: #4caf50;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 24px;
  font-size: 1em;
  cursor: pointer;
  transition: background 0.2s;
}

.popup-close:hover {
  background: #388e3c;
}

/* Для темної теми */
body.dark-theme .popup-content {
  background: #23272f;
  color: #fff;
}

body.dark-theme .popup-message {
  color: #fff;
}

body.dark-theme .popup-close {
  background: #388e3c;
}

/* Анімація розлітання input на шматочки */
.explode-input {
  pointer-events: none;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.input-piece {
  will-change: transform, opacity;
}

.move-far-right {
  transition: transform 1.2s cubic-bezier(.2, 1.8, .5, 1);
  transform: translateX(1000vh);
}

.broken-msg {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1em;
  color: #ff4d4f;
  min-height: 48px;
  margin-bottom: 8px;
  font-weight: 600;
  gap: 8px;
}

.form-box {
  border: 2px solid #ccc;
  border-radius: 20px;
  padding: 20px;
  height: 400px;
  overflow-y: auto;
}

.sidebar {
  height: 97vh;
  border: 1.5px solid #dbe2ea;
  border-radius: 10px;
  background: #f8fafc;
}