/* Y2Mate Original - Ultra Fast Performance Stylesheet (0ms blocking) */
:root {
  --primary: #007FFF;
  --primary-hover: #0066CC;
  --primary-light: rgba(0, 127, 255, 0.08);
  --primary-border: rgba(0, 127, 255, 0.25);
  --dark: #041E49;
  --dark-sub: #1E293B;
  --text-main: #293A46;
  --text-muted: #64748B;
  --border: #E2E8F0;
  --bg-page: #F8FAFC;
  --bg-card: #FFFFFF;
  --success: #10B981;
  --accent-gold: #F59E0B;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 14px rgba(4, 30, 73, 0.08);
  --shadow-lg: 0 12px 32px rgba(4, 30, 73, 0.12);
  --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-stack);
  line-height: 1.6;
  color: var(--text-main);
  background-color: var(--bg-page);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* Site Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 16px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none !important;
}

.brand-img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 2px 10px rgba(0, 127, 255, 0.25);
  flex-shrink: 0;
}

.brand-name {
  font-size: 22px;
  font-weight: 800;
  color: var(--dark);
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-name span.brand-red {
  color: #FF0033;
}

.brand-name .badge-orig {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  background: rgba(255, 0, 51, 0.08);
  border: 1px solid rgba(255, 0, 51, 0.3);
  color: #FF0033;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-links a {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--dark-sub);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  text-decoration: none !important;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
  background: var(--primary-light);
}

/* Language Selector */
.lang-dropdown {
  position: relative;
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--dark-sub);
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.lang-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  display: none;
  grid-template-columns: repeat(2, 120px);
  gap: 4px;
  z-index: 110;
}

.lang-dropdown:hover .lang-menu,
.lang-dropdown:focus-within .lang-menu {
  display: grid;
}

.lang-menu a {
  display: block;
  padding: 6px 10px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--dark-sub);
  border-radius: 6px;
  text-decoration: none !important;
}

.lang-menu a:hover,
.lang-menu a.active {
  background: var(--primary);
  color: #FFFFFF;
}

/* Hero Section */
.hero {
  padding: 48px 16px 28px;
  text-align: center;
  background: linear-gradient(180deg, #FFFFFF 0%, var(--bg-page) 100%);
  border-bottom: 1px solid var(--border);
}

.hero-wrap {
  max-width: 860px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 18px;
}

.hero-badge .star {
  color: var(--accent-gold);
}

.hero h1 {
  font-size: 34px;
  font-weight: 800;
  color: var(--dark);
  line-height: 1.25;
  letter-spacing: -0.5px;
  margin-bottom: 14px;
}

.hero h1 span.highlight {
  color: var(--primary);
}

.hero-desc {
  font-size: 16.5px;
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto 30px;
}

/* Downloader Search Box */
.downloader-box {
  background: #FFFFFF;
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 8px;
  box-shadow: var(--shadow-md);
  max-width: 720px;
  margin: 0 auto;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.downloader-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(0, 127, 255, 0.15);
}

.input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.input-icon {
  width: 22px;
  height: 22px;
  margin-left: 14px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 16px;
  padding: 14px 10px;
  color: var(--dark);
  font-family: inherit;
  background: transparent;
}

.search-input::placeholder {
  color: #94A3B8;
}

.btn-paste {
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  color: var(--primary);
  font-weight: 600;
  font-size: 13.5px;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.btn-paste:hover {
  background: rgba(0, 127, 255, 0.16);
}

.btn-submit {
  background: var(--primary);
  border: none;
  color: #FFFFFF;
  font-weight: 700;
  font-size: 15px;
  padding: 12px 26px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
  box-shadow: 0 2px 8px rgba(0, 127, 255, 0.35);
}

.btn-submit:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

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

.disclaimer-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 14px;
}

/* Status & Loader */
.status-msg {
  display: none;
  margin-top: 16px;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  text-align: center;
}

.status-msg.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--primary-light);
  color: var(--primary);
}

.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(0, 127, 255, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.status-msg.error {
  display: block;
  background: #FEE2E2;
  color: #DC2626;
  border: 1px solid #FCA5A5;
}

/* Result Container */
.result-card {
  display: none;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-lg);
  max-width: 820px;
  margin: 28px auto 0;
  text-align: left;
}

.result-card.active {
  display: block;
}

.result-header {
  display: flex;
  gap: 20px;
  margin-bottom: 24px;
}

.result-thumb {
  width: 200px;
  height: 112px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  background: #000;
}

.result-info {
  flex: 1;
  min-width: 0;
}

.result-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 6px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--text-muted);
}

.result-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Native Video Player Section (User's 3-Dots Stream Feature) */
.player-box {
  background: #000000;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 24px;
  position: relative;
}

.player-box video {
  width: 100%;
  max-height: 420px;
  display: block;
}

.player-tip {
  padding: 10px 14px;
  background: #F1F5F9;
  border-left: 4px solid var(--primary);
  font-size: 13px;
  color: var(--dark-sub);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* Download Formats Table */
.format-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.tab-btn {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.format-table {
  width: 100%;
  border-collapse: collapse;
}

.format-table th {
  text-align: left;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.format-table td {
  padding: 12px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  color: var(--dark-sub);
}

.format-table tr:last-child td {
  border-bottom: none;
}

.btn-download-format {
  background: var(--primary);
  color: #FFFFFF;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none !important;
}

.btn-download-format:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.badge-res {
  display: inline-block;
  padding: 2px 8px;
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  border-radius: 4px;
  font-size: 12px;
}

/* Trust Strip */
.trust-strip {
  background: #FFFFFF;
  border-bottom: 1px solid var(--border);
  padding: 18px 16px;
}

.trust-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 28px;
  font-size: 13.5px;
  color: var(--text-muted);
  font-weight: 600;
}

.trust-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.trust-item svg {
  color: var(--primary);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Content Container */
.content-section {
  max-width: 960px;
  margin: 48px auto;
  padding: 0 20px;
}

.section-head {
  text-align: center;
  margin-bottom: 36px;
}

.section-head h2 {
  font-size: 26px;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 8px;
}

.section-head p {
  color: var(--text-muted);
  font-size: 15.5px;
}

/* Steps (HowTo Schema match) */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 48px;
}

.step-card {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  position: relative;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
}

.step-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-border);
}

.step-num {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary);
  color: #FFFFFF;
  font-weight: 800;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  box-shadow: 0 4px 10px rgba(0, 127, 255, 0.35);
}

.step-card h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 8px;
}

.step-card p {
  font-size: 14px;
  color: var(--text-main);
  line-height: 1.55;
}

/* Feature Cards */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 48px;
}

.feature-card {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.feature-card h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Supported Devices Chips */
.devices-bar {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
  margin-bottom: 48px;
  text-align: center;
}

.devices-bar h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 14px;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.chip {
  padding: 6px 16px;
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--dark-sub);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* FAQ Section */
.faq-wrap {
  margin-bottom: 48px;
}

.faq-item {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.faq-question {
  width: 100%;
  padding: 18px 20px;
  text-align: left;
  background: transparent;
  border: none;
  font-size: 16px;
  font-weight: 700;
  color: var(--dark);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-family: inherit;
}

.faq-icon {
  transition: transform 0.2s ease;
  color: var(--primary);
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.faq-item.open .faq-icon {
  transform: rotate(180deg);
}

.faq-answer {
  padding: 0 20px 18px;
  font-size: 14.5px;
  color: var(--text-main);
  line-height: 1.65;
  display: none;
}

.faq-item.open .faq-answer {
  display: block;
}

/* Comprehensive Humanized Editorial Block */
.editorial-block {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  margin-bottom: 48px;
  box-shadow: var(--shadow-sm);
  line-height: 1.8;
}

.editorial-block h2 {
  font-size: 24px;
  font-weight: 800;
  color: var(--dark);
  margin: 28px 0 12px;
}

.editorial-block h2:first-child {
  margin-top: 0;
}

.editorial-block h3 {
  font-size: 19px;
  font-weight: 700;
  color: var(--dark-sub);
  margin: 20px 0 10px;
}

.editorial-block p {
  margin-bottom: 16px;
  font-size: 15px;
  color: var(--text-main);
}

.editorial-block ul {
  margin: 12px 0 20px 24px;
}

.editorial-block li {
  margin-bottom: 8px;
  font-size: 14.5px;
}

/* Footer */
.site-footer {
  margin-top: auto;
  background: #FFFFFF;
  border-top: 1px solid var(--border);
  padding: 48px 16px 28px;
}

.footer-inner {
  max-width: 1060px;
  margin: 0 auto;
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 36px;
  margin-bottom: 36px;
}

.footer-brand p {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-top: 10px;
  max-width: 320px;
  line-height: 1.6;
}

.footer-col h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--dark);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 14px;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 8px;
}

.footer-col a {
  font-size: 13.5px;
  color: var(--text-muted);
  text-decoration: none;
}

.footer-col a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .header-inner {
    height: 60px;
  }
  .nav-links {
    display: none;
  }
  .hero {
    padding: 32px 14px 24px;
  }
  .hero h1 {
    font-size: 26px;
  }
  .hero-desc {
    font-size: 14.5px;
  }
  .downloader-box {
    padding: 10px;
    border-radius: 12px;
  }
  .input-row {
    display: grid !important;
    grid-template-columns: 1fr 1.4fr !important;
    grid-template-areas: 
      "input input"
      "paste submit" !important;
    gap: 10px !important;
    align-items: stretch !important;
  }
  .input-icon {
    display: none !important;
  }
  .search-input {
    grid-area: input !important;
    width: 100% !important;
    background: #F8FAFC !important;
    border: 1.5px solid #E2E8F0 !important;
    border-radius: 8px !important;
    padding: 13px 14px !important;
    font-size: 15px !important;
    box-sizing: border-box !important;
    color: var(--dark) !important;
  }
  .search-input:focus {
    background: #FFFFFF !important;
    border-color: var(--primary) !important;
    outline: none !important;
  }
  .btn-paste {
    grid-area: paste !important;
    height: 48px !important;
    justify-content: center !important;
    font-size: 14.5px !important;
    border-radius: 8px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .btn-submit {
    grid-area: submit !important;
    height: 48px !important;
    justify-content: center !important;
    font-size: 15.5px !important;
    border-radius: 8px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .result-header {
    flex-direction: column;
  }
  .result-thumb {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
  }
  .footer-top {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .format-table th, .format-table td {
    padding: 8px 6px;
    font-size: 13px;
  }
}
