/* === RESET & BASE === */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Lato', sans-serif;
  font-size: 14px;
  color: #33334f;
  background: #fff;
  line-height: 1.6;
}

a {
  color: #6078ff;
  text-decoration: none;
  font-weight: 700;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
}

/* === LAYOUT === */
.container {
  max-width: 1030px;
  margin: 0 auto;
  padding: 0 24px;
}

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7em 0.8em;
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  color: #000;
  background: transparent;
  box-shadow: inset 0 0 0 1px, 0 1px 2px rgba(0, 0, 0, .17);
}

.btn:hover {
  box-shadow: inset 0 0 0 1px, 0 4px 10px rgba(50, 50, 93, .23), 0 1px 3px rgba(0, 0, 0, .08);
  text-decoration: none;
}

.btn.primary {
  color: #fff;
  background: #000;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .17);
}

.btn.primary:hover {
  box-shadow: 0 4px 10px rgba(50, 50, 93, .23), 0 1px 3px rgba(0, 0, 0, .08);
}

/* === HEADER === */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  max-width: 1030px;
  margin: 0 auto;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #33334f;
  flex-shrink: 0;
  min-width: 0;
}

.header-logo:hover {
  text-decoration: none;
}

.header-logo img {
  width: 51px;
  height: 51px;
}

.header-logo span {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: clamp(16px, 5vw, 24px);
  white-space: nowrap;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-actions .btn {
  background: none;
  border: none;
  box-shadow: none;
  padding: 0;
  font-size: 15px;
  font-weight: 400;
  color: #999;
  transition: color 0.2s;
}

.header-actions .btn:hover {
  color: #333;
  box-shadow: none;
  text-decoration: none;
}

/* === HERO === */
.hero {
  padding: 40px 0 20px;
}

.hero-grid {
  display: flex;
  align-items: center;
  gap: 40px;
}

.hero-text {
  flex: 1;
}

.hero-image {
  flex: 1;
  text-align: center;
}

.hero-image img {
  max-height: 350px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  background: #eef0ff;
  color: #5b5fc7;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 16px;
  text-decoration: none;
}

.hero-badge svg {
  flex-shrink: 0;
}

.hero-badge:hover {
  text-decoration: none;
  background: #e2e5ff;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(96, 120, 255, .15);
}

.hero-title {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 40px;
  color: #33334f;
  line-height: 1.15;
  margin-bottom: 16px;
}

.hero-subtitle {
  color: #767ead;
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: 24px;
}

.hero-ctas {
  display: none;
  gap: 10px;
  flex-wrap: wrap;
}

/* === FEATURES === */
.features-section {
  padding: 10px 0 30px;
}

.features-grid {
  display: flex;
  gap: 30px;
}

.feature-card {
  flex: 1;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
  border-radius: 12px;
  padding: 20px 16px;
}

.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(96, 120, 255, .12);
}

.feature-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  background-size: contain;
  background-repeat: no-repeat;
}

.feature-title {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: #33334f;
  margin-bottom: 8px;
}

.feature-desc {
  color: #767ead;
  font-size: 14px;
  line-height: 1.5;
}

/* === FOOTER === */
.site-footer {
  padding: 30px 0 15px;
  border-top: 1px solid #eee;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-inner span {
  color: #999;
  font-size: 14px;
}

.footer-inner a {
  color: #999;
  transition: color 0.2s;
}

.footer-inner a:hover {
  color: #6078ff;
}

.footer-social {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}

.footer-social a {
  color: #aaa;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  transition: color 0.25s, transform 0.25s;
}

.footer-social a svg path {
  fill: currentColor;
}

.footer-social a:hover {
  transform: scale(1.2);
  text-decoration: none;
}

.footer-social .social-telegram:hover {
  color: #0088cc;
}

.footer-social .social-youtube:hover {
  color: #FF0000;
}

.footer-social .social-instagram:hover {
  color: #E4405F;
}

.footer-social .social-x:hover {
  color: #000;
}

.footer-social .social-github:hover {
  color: #333;
}

.footer-social .social-linkedin:hover {
  color: #0A66C2;
}

.footer-social .social-devto:hover {
  color: #000;
}

/* === AVATAR === */
.avatar-wrap {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  position: relative;
  margin-left: 12px;
  flex-shrink: 0;
}

.avatar-wrap img {
  width: 37px;
  height: 37px;
  border-radius: 50%;
  border: 2px solid #e2e4ef;
  display: none;
  transition: transform 0.2s, border-color 0.2s;
}

.avatar-wrap img.visible {
  display: inline-block;
}

.avatar-wrap:hover img {
  transform: scale(1.15);
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, .15));
  border-color: transparent;
  box-shadow: 1.5px 1.5px 0 0 #34A853, -1.5px -1.5px 0 0 #EA4335, 1.5px -1.5px 0 0 #4285F4, -1.5px 1.5px 0 0 #FBBC05;
}

.avatar-wrap .google-icon {
  width: 37px;
  height: 37px;
  display: inline-block;
  border-radius: 50%;
  transition: transform 0.2s;
}

.avatar-wrap:hover .google-icon {
  transform: scale(1.15);
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, .2));
}

.avatar-wrap .google-icon.hidden {
  display: none;
}

.avatar-dropdown {
  display: none;
  position: absolute;
  top: 44px;
  left: 50%;
  transform: translateX(-50%);
  background: #eef0ff;
  border-radius: 10px;
  padding: 14px 20px;
  z-index: 10000;
  min-width: 160px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(99, 102, 241, .15);
}

.avatar-dropdown.open {
  display: block;
}

.avatar-dropdown .dropdown-name {
  font-size: 14px;
  font-weight: 700;
  color: #33334f;
  margin-bottom: 2px;
}

.avatar-dropdown .dropdown-email {
  font-size: 14px;
  font-weight: 700;
  color: #33334f;
  margin-bottom: 10px;
  word-break: break-all;
}

.avatar-dropdown .dropdown-logout {
  display: block;
  width: 100%;
  padding: 10px 0 0;
  background: none;
  border: none;
  border-top: 1px solid rgba(99, 102, 241, .15);
  font-size: 14px;
  font-weight: 600;
  color: #ff6b6b;
  cursor: pointer;
}

.avatar-dropdown .dropdown-logout:hover {
  color: #ff4444;
}

.avatar-wrap[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  top: 44px;
  left: 50%;
  transform: translateX(-50%);
  background: #222;
  color: #fff;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 8px;
  white-space: nowrap;
  z-index: 9999;
  pointer-events: none;
}

.avatar-wrap:has(.avatar-dropdown.open)[data-tooltip]:hover::after {
  display: none;
}

/* === MODAL === */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}

.modal-overlay.active {
  display: flex;
}

.modal-box {
  background: #fff;
  border-radius: 20px;
  padding: 0 36px 36px;
  max-width: 560px;
  width: 90%;
  position: relative;
  box-shadow: 0 8px 40px rgba(99, 102, 241, .12), 0 2px 12px rgba(0, 0, 0, .06);
  animation: modalIn 0.25s ease;
}

.modal-dots {
  display: flex;
  gap: 7px;
  padding: 18px 0 14px;
  align-items: center;
}

.modal-dots span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.modal-dots .dot-r {
  background: #ff5f57;
}

.modal-dots .dot-y {
  background: #febc2e;
}

.modal-dots .dot-g {
  background: #28c840;
}

@keyframes modalIn {
  from {
    transform: translateY(30px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #999;
}

.modal-close:hover {
  color: #333;
}

.modal-box h2 {
  font-family: 'Sora';
  font-weight: 700;
  font-size: 22px;
  color: #33334f;
  margin: 0 0 6px;
}

.modal-box .subtitle {
  color: #767ead;
  text-align: center;
  margin-bottom: 24px;
  font-size: 14px;
}

.modal-box label:not(.quality-option):not(.checkbox-row) {
  display: block;
  font-weight: 700;
  color: #33334f;
  margin-bottom: 8px;
  font-size: 14px;
}

.modal-box textarea {
  width: 100%;
  min-height: 80px;
  border: 2px solid #e2e4ef;
  border-radius: 8px;
  padding: 12px;
  font-family: 'Lato', sans-serif;
  font-size: 14px;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.modal-box textarea:focus {
  border-color: #6078ff;
}

.modal-box .field {
  margin-bottom: 18px;
}

.modal-box input[type=text] {
  width: 100%;
  border: 2px solid #e2e4ef;
  border-radius: 8px;
  padding: 10px 12px;
  font-family: 'Lato', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.modal-box input[type=text]:focus {
  border-color: #6078ff;
}

.title-input-wrap {
  display: flex;
  align-items: center;
  border: 2px solid #eee;
  border-radius: 10px;
  padding: 0 14px;
  transition: border-color 0.2s;
}

.title-input-wrap:focus-within {
  border-color: #6078ff;
}

.title-prefix {
  color: #aaa;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  margin-right: 6px;
  transition: color 0.2s;
}

.title-input-wrap:hover .title-prefix,
.title-input-wrap:focus-within .title-prefix {
  color: #333;
}

.title-input-wrap input[type=text] {
  border: none !important;
  padding-left: 0 !important;
  flex: 1;
}

.title-input-wrap input[type=text]:focus {
  border: none !important;
}

/* Merge button */
@keyframes mergeGlow {

  0%,
  100% {
    box-shadow: 0 4px 15px rgba(99, 102, 241, .3);
  }

  50% {
    box-shadow: 0 6px 25px rgba(99, 102, 241, .55);
  }
}

.merge-btn {
  display: block;
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #7c3aed, #6366f1, #818cf8);
  background-size: 200% 200%;
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.4s;
  font-family: 'Sora', sans-serif;
  box-shadow: 0 4px 15px rgba(99, 102, 241, .3);
}

.merge-btn:hover {
  background-position: 100% 0;
  box-shadow: 0 8px 25px rgba(99, 102, 241, .5);
  transform: translateY(-2px);
  animation: mergeGlow 1.5s ease-in-out infinite;
}

.merge-btn:disabled {
  background: linear-gradient(135deg, #c4b5fd, #a5b4fc);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
  animation: none;
}

.merge-status {
  margin-top: 16px;
  padding: 14px;
  border-radius: 8px;
  display: none;
  font-size: 14px;
}

.merge-status.info {
  display: block;
  background: #eef1ff;
  color: #33334f;
  border: 1px solid #c5cdff;
}

.merge-status.error {
  display: block;
  background: #fff0f0;
  color: #c00;
  border: 1px solid #fcc;
}

.merge-status.success {
  display: block;
  background: #f0fff4;
  color: #080;
  border: 1px solid #bfb;
}

.merge-hint {
  color: #999;
  font-size: 12px;
  margin-top: 4px;
}

/* Tabs */
.merge-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 18px;
  border-bottom: 2px solid #eee;
}

.merge-tab {
  background: none;
  border: none;
  padding: 10px 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  color: #888;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}

.merge-tab.active {
  color: #333;
  border-bottom-color: #6078ff;
  background: linear-gradient(to bottom, transparent 60%, rgba(96, 120, 255, .08));
  border-radius: 8px 8px 0 0;
}

.merge-tab:hover {
  color: #333;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  min-height: 220px;
}

/* Quality options */
.quality-options {
  display: flex;
  gap: 10px;
}

.quality-option {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  padding: 8px 10px;
  border: 2px solid #eee;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.quality-option:has(input:checked) {
  border-color: #6078ff;
  background: #f8f9ff;
}

.quality-option input[type=radio] {
  display: none;
}

.quality-icon {
  font-size: 48px;
  line-height: 1;
  flex-shrink: 0;
}

.quality-text {
  display: flex;
  flex-direction: column;
}

.quality-label {
  font-weight: 600;
  font-size: 14px;
}

.quality-desc {
  font-size: 11px;
  color: #888;
  margin-top: 2px;
}

.quality-info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: none;
  color: #6078ff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  margin-left: 6px;
  transition: all 0.2s;
}

.quality-info-btn:hover {
  color: #4058df;
}

.quality-info {
  display: none;
  margin: 14px 0 12px;
}

.quality-info.open {
  display: block;
}

.quality-info table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  background: #fafbff;
  border-radius: 8px;
  overflow: hidden;
}

.quality-info th {
  background: #eef1ff;
  color: #333;
  padding: 8px 10px;
  text-align: left;
  font-weight: 600;
}

.quality-info td {
  padding: 6px 10px;
  border-top: 1px solid #eee;
}

/* Checkbox / toggle */
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  font-size: 14px;
  cursor: pointer;
}

.checkbox-row input[type=checkbox] {
  display: none;
}

.toggle-switch {
  position: relative;
  width: 40px;
  height: 22px;
  background: #ccc;
  border-radius: 11px;
  cursor: pointer;
  transition: background 0.3s;
  flex-shrink: 0;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.3s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
}

.checkbox-row input:checked+.toggle-switch {
  background: #6366f1;
}

.checkbox-row input:checked+.toggle-switch::after {
  transform: translateX(18px);
}

/* File drop */
.file-drop {
  border: 2px dashed #ccc;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  color: #888;
}

.file-drop:hover,
.file-drop.drag-over {
  border: 2px solid #6078ff;
  background: #f0f2ff;
  color: #333;
  transform: scale(1.01);
  box-shadow: 0 2px 12px rgba(96, 120, 255, .15);
}

.file-drop-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.file-list {
  margin-top: 10px;
}

.file-summary {
  padding: 8px 12px;
  background: #eef1ff;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #333;
  margin-bottom: 6px;
}

.file-meta {
  font-size: 11px;
  color: #888;
  white-space: nowrap;
}

.file-scanning {
  padding: 14px;
  text-align: center;
  color: #666;
  font-size: 14px;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: .4;
  }
}

.file-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: #f7f8fb;
  border-radius: 6px;
  margin-bottom: 4px;
  font-size: 13px;
}

.file-item .file-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-item .file-size {
  color: #999;
  margin-left: 10px;
  white-space: nowrap;
}

.file-item .file-remove {
  cursor: pointer;
  color: #c00;
  margin-left: 8px;
  font-weight: 700;
}

/* === MOBILE DRAWER === */
.mobile-drawer {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
}

.mobile-drawer.open {
  display: block;
}

.mobile-drawer-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, .4);
}

.mobile-drawer-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 280px;
  height: 100%;
  background: #fff;
  box-shadow: -4px 0 20px rgba(0, 0, 0, .15);
  padding: 24px;
  z-index: 10001;
  animation: slideIn 0.25s ease;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
  }

  to {
    transform: translateX(0);
  }
}

.mobile-drawer-panel a {
  display: block;
  padding: 14px 16px;
  font-size: 16px;
  font-weight: 600;
  color: #333;
  text-decoration: none;
  border-radius: 10px;
  transition: background 0.2s;
}

.mobile-drawer-panel a:hover {
  background: #f5f5ff;
}

/* === MOBILE (max-width: 768px) === */
@media (max-width: 768px) {
  .header-actions .btn {
    display: none;
  }

  .header-actions .avatar-wrap img,
  .header-actions .avatar-wrap .google-icon {
    width: 56px;
    height: 56px;
  }

  .header-logo img {
    width: 64px;
    height: 64px;
  }

  .avatar-dropdown {
    left: auto;
    right: -3px;
    transform: none;
    top: 62px;
  }

  .avatar-wrap[data-tooltip]:hover::after {
    left: auto;
    right: -3px;
    transform: none;
    top: 62px;
  }

  .hero-grid {
    flex-direction: column;
    gap: 20px;
  }

  .hero-title {
    font-size: 26px;
  }

  .hero-subtitle {
    font-size: 14px;
  }

  .hero-badge {
    display: none;
  }

  .hero-image {
    display: none;
  }

  .hero-ctas {
    display: flex;
  }

  .hero-ctas .btn.primary {
    background: linear-gradient(135deg, #7c3aed, #6366f1);
    box-shadow: 0 2px 8px rgba(99, 102, 241, .3);
  }

  .hero-ctas .btn svg {
    margin-left: 2px;
  }

  .hero-ctas .btn {
    font-weight: 400 !important;
  }

  .features-grid {
    flex-direction: column;
    gap: 14px;
  }

  .feature-card {
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    padding: 0;
  }

  .feature-card .feature-icon {
    margin: 0;
    flex-shrink: 0;
  }

  .feature-card .feature-title {
    display: none;
  }

  .feature-card .feature-desc {
    font-size: 12px;
    line-height: 1.4;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }

  .footer-social {
    justify-content: center;
  }

  .modal-overlay {
    align-items: flex-end;
  }

  .modal-box {
    width: 100%;
    max-width: 100%;
    border-radius: 20px 20px 0 0;
    max-height: 90vh;
    overflow-y: auto;
    padding: 0 20px 24px;
  }

  .quality-options {
    flex-direction: row;
  }

  .quality-option {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 380px) {
  .hero-title {
    font-size: 22px;
  }

  .hero-subtitle {
    font-size: 13px;
  }

  .btn {
    font-size: 14px;
    padding: 10px 16px;
  }
}