/* ==========================================================================
   Modern Minimalist YouTube Downloader CSS
   Responsive across Galaxy Fold (280px+), Flip, Duo, iPhone, Tablets & Desktops
   AdSense-ready responsive slots
   ========================================================================== */

:root {
    --primary: #ef4444;
    --primary-hover: #dc2626;
    --primary-light: #fee2e2;
    --primary-glow: rgba(239, 68, 68, 0.25);
    --secondary: #6366f1;
    --secondary-hover: #4f46e5;
    --accent: #8b5cf6;
    --bg-page: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --border-focus: #cbd5e1;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 30px -10px rgba(0, 0, 0, 0.1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-full: 9999px;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ==========================================================================
   Typography & Base Utilities
   ========================================================================== */
a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

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

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container-fluid {
    padding: 0 !important;
}

.site-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-container {
    width: 100%;
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ==========================================================================
   Modern Navbar
   ========================================================================== */
header.modern-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
}

.nav-inner {
    max-width: 1160px;
    margin: 0 auto;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #ef4444, #f43f5e);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 16px;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.35);
}

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

.nav-links a {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.925rem;
}

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

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

.lang-btn {
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    padding: 6px 14px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.lang-btn:hover {
    background: #e2e8f0;
    color: var(--text-primary);
}

.lang-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 140px;
    z-index: 1050;
    padding: 6px;
}

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

.lang-menu a {
    display: block;
    padding: 8px 12px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    border-radius: 6px;
}

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

/* ==========================================================================
   Hero & Search Section
   ========================================================================== */
.hero-section {
    background: radial-gradient(circle at 50% 20%, #ffffff 0%, #f1f5f9 100%);
    padding: 48px 16px 40px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    margin-bottom: 16px;
}

.hero-title {
    font-size: clamp(1.75rem, 5vw, 2.75rem);
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
    margin: 0 0 12px;
    letter-spacing: -0.03em;
}

.hero-subtitle {
    font-size: clamp(0.95rem, 2.5vw, 1.125rem);
    color: var(--text-secondary);
    max-width: 620px;
    margin: 0 auto 32px;
}

/* Modern Unified Search Form */
.search-form-container {
    max-width: 720px;
    margin: 0 auto;
}

.search-box-wrapper {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    transition: var(--transition);
}

.search-box-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow), var(--shadow-lg);
}

.search-input-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    padding-left: 14px;
}

.search-input-wrap i {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-right: 12px;
}

.search-input-wrap input[type="text"],
.modern-input {
    width: 100%;
    border: none !important;
    outline: none !important;
    background: transparent !important;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    padding: 12px 6px;
}

.search-input-wrap input::placeholder {
    color: var(--text-muted);
}

.btn-download-action {
    background: linear-gradient(135deg, var(--primary), #f43f5e);
    color: #ffffff !important;
    border: none;
    border-radius: var(--radius-md);
    padding: 13px 26px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
    transition: var(--transition);
    white-space: nowrap;
}

.btn-download-action:hover {
    background: linear-gradient(135deg, var(--primary-hover), #e11d48);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(239, 68, 68, 0.5);
}

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

/* Feature tags below search */
.feature-tags {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px 20px;
    margin-top: 24px;
}

.feature-tag-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.feature-tag-item i {
    color: var(--primary);
}

/* ==========================================================================
   AdSense Responsive Banners
   ========================================================================== */
.adsense-container {
    width: 100%;
    max-width: 970px;
    margin: 24px auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.adsense-container.ad-header {
    margin: 16px auto 8px;
}

.adsense-container.ad-mid {
    margin: 28px auto 16px;
}

.adsense-container.ad-results {
    margin: 24px auto 32px;
}

.adsense-container.ad-footer {
    margin: 36px auto 20px;
}

.adsense-box {
    width: 100%;
    min-height: 90px;
    background: #ffffff;
    border: 1px dashed #cbd5e1;
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 6px;
}

.adsense-label {
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 4px;
}

/* ==========================================================================
   Video Info & Result Card
   ========================================================================== */
.results-section {
    padding: 32px 0;
}

.video-detail-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 20px;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    align-items: center;
    margin-bottom: 28px;
}

.video-thumb-wrapper {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #000;
    aspect-ratio: 16 / 9;
    box-shadow: var(--shadow-sm);
}

.video-thumb-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-info-content h2.v-title {
    font-size: clamp(1.1rem, 2.5vw, 1.35rem);
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 12px;
    line-height: 1.35;
}

.video-meta-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.meta-pill {
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    padding: 5px 12px;
    font-size: 0.825rem;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.meta-pill b {
    color: var(--text-primary);
}

/* ==========================================================================
   Modern Download Tables
   ========================================================================== */
.downloads-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 24px;
    margin-bottom: 32px;
}

.table-section-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 16px;
}

.table-section-title i {
    color: var(--primary);
}

.table-responsive-box {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    margin-bottom: 24px;
}

table.modern-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    margin: 0;
}

table.modern-table thead th {
    background: #f8fafc;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

table.modern-table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.925rem;
    vertical-align: middle;
}

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

table.modern-table tbody tr:hover td {
    background: #fafafa;
}

.badge-res {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
    font-weight: 700;
    font-size: 0.8rem;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    display: inline-block;
}

.badge-res.audio-badge {
    background: #f0fdf4;
    color: #16a34a;
    border-color: #bbf7d0;
}

.badge-ext {
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.85rem;
}

.btn-table-download {
    background: var(--primary);
    color: #ffffff !important;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 8px 18px;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.25);
    white-space: nowrap;
}

.btn-table-download:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.35);
}

/* ==========================================================================
   Instruction / How-To Section
   ========================================================================== */
.instruction-section {
    padding: 40px 0 60px;
    border-top: 1px solid var(--border-color);
}

.instructions-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 32px 24px;
}

.instruction-section h2 {
    font-size: clamp(1.25rem, 3vw, 1.65rem);
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 20px;
    line-height: 1.3;
}

.instruction-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin: 24px 0 40px;
}

.step-card {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    position: relative;
    transition: var(--transition);
}

.step-card:hover {
    background: #ffffff;
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.step-number {
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: #ffffff;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.step-card p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.925rem;
    line-height: 1.5;
}

/* ==========================================================================
   Modern Minimalist Footer
   ========================================================================== */
footer.modern-footer {
    background: #ffffff;
    border-top: 1px solid var(--border-color);
    padding: 40px 0 24px;
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 32px;
    margin-bottom: 32px;
}

.footer-col h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 16px;
}

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

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

.footer-col ul li a {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.footer-col ul li a:hover {
    color: var(--primary);
}

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

/* ==========================================================================
   Responsive Breakpoints
   Galaxy Fold (280px), Flip, Duo, iPhone, Tablets & Desktops
   ========================================================================== */

/* Tablet (iPad, Surface Duo, Tablets) */
@media (max-width: 992px) {
    .video-detail-card {
        grid-template-columns: 240px 1fr;
        gap: 18px;
    }
}

/* Mobile & Fold devices */
@media (max-width: 768px) {
    .nav-inner {
        flex-wrap: wrap;
        padding: 10px 14px;
    }

    .brand-logo {
        font-size: 1.15rem;
    }

    .nav-links {
        gap: 12px;
    }

    .hero-section {
        padding: 32px 12px 28px;
    }

    .video-detail-card {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 16px;
    }

    .video-thumb-wrapper {
        max-width: 380px;
        margin: 0 auto;
    }

    .video-meta-pills {
        justify-content: center;
    }

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

    .instruction-steps {
        grid-template-columns: 1fr;
        gap: 14px;
    }
}

/* Small Phones & Samsung Galaxy Flip */
@media (max-width: 480px) {
    .search-box-wrapper {
        flex-direction: column;
        border-radius: var(--radius-md);
        padding: 6px;
        gap: 8px;
    }

    .search-input-wrap {
        width: 100%;
        padding-left: 8px;
    }

    .search-input-wrap input[type="text"] {
        font-size: 0.95rem;
        padding: 10px 4px;
    }

    .btn-download-action {
        width: 100%;
        border-radius: var(--radius-sm);
        padding: 12px 16px;
        justify-content: center;
    }

    .adsense-box {
        min-height: 60px;
    }

    .downloads-card {
        padding: 16px 12px;
    }

    table.modern-table thead th,
    table.modern-table tbody td {
        padding: 10px 10px;
        font-size: 0.85rem;
    }

    .btn-table-download {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}

/* Galaxy Fold Outer Cover Screen (< 320px) */
@media (max-width: 320px) {
    .main-container {
        padding: 0 8px;
    }

    .brand-logo {
        font-size: 1rem;
    }

    .brand-icon {
        width: 28px;
        height: 28px;
        font-size: 13px;
    }

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

    .hero-subtitle {
        font-size: 0.85rem;
    }

    .btn-download-action {
        font-size: 0.9rem;
        padding: 10px 12px;
    }

    .video-info-content h2.v-title {
        font-size: 1rem;
    }

    .meta-pill {
        font-size: 0.75rem;
        padding: 4px 8px;
    }

    table.modern-table thead th,
    table.modern-table tbody td {
        padding: 8px 6px;
        font-size: 0.78rem;
    }

    .badge-res {
        font-size: 0.7rem;
        padding: 2px 6px;
    }
}


/* ==========================================================================
   Preloader & Button Loading State Styles
   ========================================================================== */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulseGlow {
    from { box-shadow: 0 0 0 2px var(--primary-glow), var(--shadow-md); }
    to { box-shadow: 0 0 0 6px var(--primary-glow), var(--shadow-lg); }
}

.spinner-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2.5px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

.btn-download-action.is-loading {
    background: linear-gradient(135deg, #e11d48, #be123c) !important;
    cursor: wait !important;
    pointer-events: none;
    opacity: 0.92;
}

.btn-table-download.is-loading {
    background: #475569 !important;
    cursor: wait !important;
    pointer-events: none;
    opacity: 0.9;
    box-shadow: none;
}

.search-box-wrapper.is-loading {
    border-color: var(--primary) !important;
    animation: pulseGlow 1.2s infinite alternate !important;
}

.spinner-icon.spinner-only {
    margin: 0 !important;
    width: 18px;
    height: 18px;
    border-width: 2.5px;
    display: inline-block;
    vertical-align: middle;
}
