/* =====================================================
   ROOT VARIABLES
===================================================== */
:root {
    --black: #111;
    --white: #fff;
    --gray: #f5f5f5;
    --dark-gray: #666;
    --accent: #0d6efd;
    --accent-soft: rgba(13, 110, 253, 0.1);
}

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

/* =====================================================
   BODY & BASE STYLES
===================================================== */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
    background-color: var(--white);
    color: var(--black);
    line-height: 1.6;
    overflow-x: hidden; /* prevents horizontal scroll */
}

/* Links */
a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: darken(var(--accent), 10%);
}

/* =====================================================
   HEADER & NAVIGATION
===================================================== */
.main-header {
    background: var(--white);
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
    padding: 0 16px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.site-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--black);
}

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

.nav-links a {
    font-size: 0.95rem;
    color: #333;
}

.nav-links a:hover {
    color: var(--accent);
}

/* Mobile Toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--black);
    margin: 5px 0;
}

/* Mobile Menu */
.mobile-menu {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    width: 100%;
    background: var(--white);
    border-top: 1px solid #eee;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    max-height: 500px;
    overflow-y: auto;
    z-index: 999;
}

.mobile-menu.active {
    display: block;
}

.mobile-menu-content {
    display: flex;
    flex-direction: column;
    padding: 16px;
}

.mobile-menu-content a {
    padding: 12px 0;
    border-bottom: 1px solid #f2f2f2;
    font-size: 1rem;
    color: #333;
}

.mobile-menu-content a:last-child {
    border-bottom: none;
}

/* =====================================================
   RESPONSIVE NAV
===================================================== */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .menu-toggle {
        display: block;
    }
}

/* =====================================================
   HERO / CONTENT CARDS
===================================================== */
.hero-section,
.hero-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: 32px;
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}

.hero-title {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    color: var(--black);
    margin-bottom: 12px;
}

.subtitle {
    font-size: 1rem;
    text-align: center;
    color: #555;
    margin-bottom: 24px;
}

.section-text {
    font-size: 1rem;
    color: #444;
    line-height: 1.7;
    text-align: center;
    margin-bottom: 16px;
}

hr {
    border: none;
    border-top: 1px solid #eee;
    margin: 20px 0;
}

/* Feature Grid */
.feature-highlights,
.quality-grid,
.devices-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
}

.feature-card,
.quality-card,
.device-card,
.contact-card {
    background: #f8f8f8;
    border-radius: 8px;
    padding: 16px;
    flex: 1 1 220px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* Buttons */
.fetch-button,
.cta-button,
.agreement-button,
.policy-contact a,
.btn-back,
.btn-download {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.fetch-button {
    background: var(--accent);
    color: #fff;
    border: none;
}

.fetch-button:hover:not(:disabled) {
    background: #0b5ed7;
    transform: translateY(-1px);
}

.fetch-button:disabled {
    background: #777;
    cursor: not-allowed;
}

.cta-button,
.agreement-button,
.policy-contact a {
    background: #28a745;
    color: #fff;
}

.cta-button:hover,
.agreement-button:hover,
.policy-contact a:hover {
    background: #218838;
}

/* =====================================================
   FORMS
===================================================== */
.video-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

.video-form input,
.video-form textarea {
    width: 100%;
    padding: 14px 12px;
    font-size: 0.95rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    outline: none;
    resize: vertical;
}

.video-form input:focus,
.video-form textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 3px var(--accent-soft);
}

.video-form textarea {
    min-height: 120px;
}

/* =====================================================
   FOOTER
===================================================== */
.main-footer {
    background: var(--gray);
    border-top: 1px solid #eee;
    padding: 32px 16px;
    text-align: center;
}

.footer-links a {
    margin: 0 6px;
    font-size: 0.85rem;
    color: #555;
}

.footer-links a:hover {
    color: var(--accent);
}

/* =====================================================
   404 PAGE
===================================================== */
.error-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
    text-align: center;
    padding: 40px 20px;
}

.error-page h1 {
    font-size: 6rem;
    color: var(--accent);
    margin-bottom: 20px;
}

.error-page h2 {
    font-size: 2rem;
    color: #333;
    margin-bottom: 16px;
}

.error-page p {
    font-size: 1rem;
    color: #555;
    margin-bottom: 24px;
}

.error-page a {
    background: var(--accent);
    color: #fff;
    padding: 12px 25px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
}

.error-page a:hover {
    background: #0b5ed7;
}

/* =====================================================
   RESPONSIVE ADJUSTMENTS
===================================================== */
@media (max-width: 768px) {
    .hero-card,
    .video-form,
    .policy-card {
        padding: 20px;
        margin: 20px;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .hero-title {
        font-size: 1.6rem;
    }

    .error-page h1 {
        font-size: 4rem;
    }

    .error-page h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .section-title {
        font-size: 1.5rem;
    }

    .hero-title {
        font-size: 1.4rem;
    }

    .error-page h1 {
        font-size: 3rem;
    }

    .error-page h2 {
        font-size: 1.2rem;
    }
}


/* ===============================
   INDEX PAGE SPECIFIC STYLING
   Namespaced to .hero-section & .video-form
================================= */

/* Hero section styling */
.hero-section {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px 20px;
    background: #f9f9f9; /* subtle background */
    min-height: 80vh;
}

.hero-card {
    background: #fff;
    border-radius: 12px;
    padding: 40px 30px;
    max-width: 600px;
    width: 100%;
    box-shadow: 0 8px 18px rgba(0,0,0,0.1);
    text-align: center;
    box-sizing: border-box;
}

.logo-title {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.site-title {
    font-size: 2rem;
    font-weight: 700;
    color: #111;
    margin: 0;
}

.subtitle {
    font-size: 1.05rem;
    color: #555;
    margin-bottom: 20px;
}

.trust-text {
    font-size: 0.88rem;
    color: #777;
    margin-top: 16px;
}

/* Error message styling */
.hero-section .error-message {
    color: #d93025;
    font-size: 0.9rem;
    margin: 8px 0;
}

/* Video Form Styling (namespaced to avoid conflicts) */
.hero-section .video-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

.hero-section .video-form .input-wrapper {
    width: 100%;
}

.hero-section .video-form input {
    width: 100%;
    padding: 14px 12px;
    font-size: 0.95rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    outline: none;
    box-sizing: border-box;
}

.hero-section .video-form input:focus {
    border-color: #007bff; /* accent color */
    box-shadow: 0 0 4px rgba(0,123,255,0.3);
}

.hero-section .fetch-button {
    width: 100%;
    padding: 14px;
    font-size: 1rem;
    font-weight: 600;
    background: #007bff; /* accent color */
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.hero-section .fetch-button:hover:not(:disabled) {
    background: #0056b3;
    transform: translateY(-1px);
}

.hero-section .fetch-button:disabled {
    background: #999;
    cursor: not-allowed;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero-card {
        padding: 30px 20px;
    }

    .site-title {
        font-size: 1.75rem;
    }
}

@media (max-width: 480px) {
    .hero-section {
        padding: 40px 12px;
    }

    .hero-card {
        padding: 20px 16px;
    }

    .hero-section .video-form input {
        padding: 12px 10px;
        font-size: 0.9rem;
    }

    .hero-section .fetch-button {
        padding: 12px;
        font-size: 0.95rem;
    }
}

/* ===============================
   PREVIEW PAGE – RESPONSIVE DESIGN
   =============================== */

.preview-main {
    width: 100%;
    padding: 16px;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
}

.preview-container {
    width: 100%;
    max-width: 420px; /* keeps it compact & professional */
    background: #ffffff;
    border-radius: 14px;
    padding: 16px;
    box-sizing: border-box;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

/* -------------------------------
   Thumbnail
-------------------------------- */
.thumbnail-wrapper {
    position: relative;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
}

.video-thumbnail {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
    max-height: 220px;
    object-fit: cover;
}

/* Duration badge */
.duration-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 6px;
}

/* -------------------------------
   Video Info
-------------------------------- */
.video-info {
    margin-top: 12px;
    text-align: center;
}

.video-title {
    font-size: 16px;
    font-weight: 600;
    color: #222;
    line-height: 1.4;
    margin: 0;
    word-break: break-word;
}

/* -------------------------------
   Download Buttons
-------------------------------- */
.download-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 18px;
}

.btn-download {
    width: 100%;
    padding: 12px 16px;
    text-align: center;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    color: #fff;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-download:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.15);
}

/* HD Button */
.btn-download.hd {
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
}

/* Normal Button */
.btn-download.normal {
    background: linear-gradient(135deg, #16a34a, #22c55e);
}

/* -------------------------------
   Info Text
-------------------------------- */
.download-info {
    margin-top: 16px;
    font-size: 13px;
    color: #555;
    text-align: center;
    line-height: 1.5;
}

/* -------------------------------
   Errors
-------------------------------- */
.preview-error {
    margin-top: 14px;
    padding: 12px;
    background: #fee2e2;
    color: #991b1b;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
}

/* -------------------------------
   Back Link
-------------------------------- */
.back-link {
    margin-top: 20px;
    text-align: center;
}

.btn-back {
    display: inline-block;
    padding: 10px 16px;
    font-size: 14px;
    text-decoration: none;
    border-radius: 8px;
    background: #f1f5f9;
    color: #111;
}

/* ===============================
   TABLET & DESKTOP
   =============================== */
@media (min-width: 768px) {
    .preview-container {
        max-width: 520px;
        padding: 20px;
    }

    .video-thumbnail {
        max-height: 260px;
    }

    .download-buttons {
        flex-direction: row;
    }

    .btn-download {
        flex: 1;
    }
}

/* ===============================
   ANDROID FIX – NO HORIZONTAL SCROLL
   =============================== */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}
