@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* CSS Variables for Light Mode (Default) */
:root, [data-theme="light"] {
    --bg-main: #F8FAFC;
    --bg-card: #FFFFFF;
    --bg-subtle: #F1F5F9;
    --bg-hover: #E2E8F0;
    --border-color: #E2E8F0;
    --border-active: #CBD5E1;
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #64748B;
    --navbar-bg: rgba(255, 255, 255, 0.9);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 25px -5px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 20px 35px -10px rgba(15, 23, 42, 0.12);
    --tab-bg: #FFFFFF;
    --tab-border: #E2E8F0;
    --tab-active-bg: #0F172A;
    --tab-active-text: #FFFFFF;
    --input-bg: #FFFFFF;
    --result-bg: #FFFFFF;
    --modal-overlay: rgba(15, 23, 42, 0.6);
}

/* CSS Variables for Dark Mode Override */
[data-theme="dark"] {
    --bg-main: #0B0F19;
    --bg-card: #1E293B;
    --bg-subtle: #0F172A;
    --bg-hover: #334155;
    --border-color: rgba(255, 255, 255, 0.1);
    --border-active: rgba(255, 255, 255, 0.2);
    --text-primary: #F8FAFC;
    --text-secondary: #CBD5E1;
    --text-muted: #94A3B8;
    --navbar-bg: rgba(15, 23, 42, 0.9);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.5);
    --tab-bg: rgba(30, 41, 59, 0.6);
    --tab-border: rgba(255, 255, 255, 0.1);
    --tab-active-bg: linear-gradient(135deg, #E11D48 0%, #9333EA 100%);
    --tab-active-text: #FFFFFF;
    --input-bg: rgba(15, 23, 42, 0.9);
    --result-bg: rgba(30, 41, 59, 0.8);
    --modal-overlay: rgba(0, 0, 0, 0.8);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

/* Navbar */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--navbar-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 20px;
    transition: all 0.3s ease;
}

.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-text {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.logo-accent {
    color: #E11D48;
}

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

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    transition: color 0.2s ease;
}

.nav-links a:hover, .nav-links a.active {
    color: #E11D48;
}

.theme-toggle-btn {
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-weight: 700;
    font-size: 13px;
    padding: 8px 14px;
    border-radius: 20px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    min-height: 38px;
}

.theme-toggle-btn:hover {
    background: var(--bg-hover);
}

/* Main Content */
.main-content {
    flex: 1;
    max-width: 1000px;
    width: 100%;
    margin: 0 auto;
    padding: 30px 16px;
}

/* Hero & Search */
.hero-section {
    text-align: center;
    margin-bottom: 50px;
}

.hero-badge {
    display: inline-block;
    background: linear-gradient(135deg, rgba(225, 29, 72, 0.1), rgba(147, 51, 234, 0.1));
    border: 1px solid rgba(225, 29, 72, 0.2);
    color: #E11D48;
    font-size: 11px;
    font-weight: 800;
    padding: 6px 14px;
    border-radius: 20px;
    margin-bottom: 20px;
    letter-spacing: 0.5px;
}

/* Category Tabs */
.category-tabs {
    display: flex;
    justify-content: flex-start;
    gap: 8px;
    overflow-x: auto;
    white-space: nowrap;
    padding: 4px 2px 12px 2px;
    margin-bottom: 24px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar {
    display: none;
}

@media (min-width: 640px) {
    .category-tabs {
        justify-content: center;
    }
}

.tab-btn {
    background: var(--tab-bg);
    border: 1px solid var(--tab-border);
    color: var(--text-secondary);
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    flex-shrink: 0;
    min-height: 42px;
}

.tab-btn:hover {
    border-color: #E11D48;
    color: #E11D48;
}

.tab-btn.active {
    background: var(--tab-active-bg);
    color: var(--tab-active-text);
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(225, 29, 72, 0.25);
}

.hero-section h1 {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.8px;
    margin-bottom: 10px;
    color: var(--text-primary);
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 15px;
    color: var(--text-muted);
    max-width: 580px;
    margin: 0 auto 28px auto;
    line-height: 1.5;
    font-weight: 500;
}

/* Search Card */
.search-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 10px;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 720px;
    margin: 0 auto;
    transition: all 0.3s ease;
}

@media (min-width: 640px) {
    .search-card {
        flex-direction: row;
    }
}

.input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper input {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 16px 90px 16px 16px;
    font-size: 15px;
    color: var(--text-primary);
    outline: none;
    transition: all 0.2s ease;
    min-height: 52px;
}

.input-wrapper input:focus {
    border-color: #E11D48;
    box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.15);
}

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

.clear-btn {
    position: absolute;
    right: 84px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    transition: color 0.2s ease;
}

.clear-btn:hover {
    color: #EF4444;
}

.paste-btn {
    position: absolute;
    right: 8px;
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-weight: 700;
    font-size: 13px;
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    min-height: 36px;
}

.paste-btn:hover {
    background: var(--bg-hover);
}

.download-btn {
    background: linear-gradient(135deg, #E11D48 0%, #9333EA 100%);
    color: white;
    border: none;
    border-radius: 14px;
    padding: 16px 28px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 6px 20px rgba(225, 29, 72, 0.3);
    transition: all 0.2s ease;
    white-space: nowrap;
    min-height: 52px;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(225, 29, 72, 0.45);
}

.download-btn:active {
    transform: scale(0.98);
}

/* Status & Loader */
.status-msg {
    margin-top: 16px;
    font-size: 14px;
    font-weight: 600;
    min-height: 20px;
}

.loader-container {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border-color);
    border-top: 3px solid #E11D48;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.hidden {
    display: none !important;
}

/* Result Card */
.result-card {
    background: var(--result-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 20px;
    max-width: 680px;
    margin: 24px auto 0 auto;
    box-shadow: var(--shadow-lg);
    text-align: left;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.result-media-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
}

.result-video {
    width: 100%;
    max-height: 420px;
    border-radius: 14px;
    background: #000;
    outline: none;
    box-shadow: var(--shadow-md);
}

.thumb-wrapper img {
    width: 100%;
    max-height: 360px;
    object-fit: contain;
    border-radius: 14px;
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
}

.result-details {
    flex: 1;
}

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

.badge-hd {
    background: #10B981;
    color: white;
    font-size: 10px;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 6px;
}

.badge-type {
    background: var(--bg-subtle);
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 6px;
    text-transform: uppercase;
}

.result-details h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.4;
}

.meta-creator {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 600;
}

.result-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

@media (min-width: 520px) {
    .result-actions {
        flex-direction: row;
        flex-wrap: wrap;
    }
}

.btn-primary-dl {
    flex: 1.5;
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: white;
    border: none;
    font-weight: 700;
    font-size: 14px;
    padding: 14px 20px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 48px;
}

.btn-primary-dl:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

.btn-secondary-action {
    flex: 1;
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-weight: 700;
    font-size: 13px;
    padding: 14px 16px;
    border-radius: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    min-height: 48px;
}

.btn-secondary-action:hover {
    background: var(--bg-hover);
}

.caption-container label {
    font-size: 11px;
    font-weight: 800;
    color: var(--text-muted);
    display: block;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.caption-container textarea {
    width: 100%;
    height: 85px;
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 10px;
    padding: 12px;
    font-size: 13px;
    resize: none;
    outline: none;
}

/* Modal Rewarded Ad Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    background: var(--modal-overlay);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.modal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    width: 100%;
    max-width: 480px;
    padding: 28px 24px;
    position: relative;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.modal-close {
    position: absolute;
    top: 18px;
    right: 18px;
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-close:hover {
    color: #EF4444;
    background: var(--bg-hover);
}

.modal-badge {
    display: inline-block;
    background: rgba(16, 185, 129, 0.1);
    color: #10B981;
    font-size: 11px;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 14px;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.modal-header p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 20px;
}

.timer-box {
    margin-bottom: 20px;
}

.progress-bar-container {
    width: 100%;
    height: 10px;
    background: var(--bg-subtle);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 8px;
    border: 1px solid var(--border-color);
}

.progress-bar-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #E11D48 0%, #10B981 100%);
    transition: width 0.8s linear;
}

.timer-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
}

.timer-seconds {
    color: #E11D48;
}

.modal-ad-box {
    background: var(--bg-subtle);
    border: 1px dashed var(--border-color);
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 20px;
    position: relative;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.ad-sponsor-tag {
    position: absolute;
    top: -10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 10px;
    letter-spacing: 0.5px;
}

.ad-content-placeholder p {
    font-size: 13px;
    color: var(--text-primary);
}

.ad-subtext {
    font-size: 11px !important;
    color: var(--text-muted) !important;
    margin-top: 4px;
}

.modal-action-btn.disabled {
    background: var(--bg-subtle) !important;
    color: var(--text-muted) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: none !important;
    cursor: not-allowed !important;
}

/* Footer */
.site-footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    margin-top: 80px;
    padding: 50px 20px 24px 20px;
}

.footer-container {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

@media (min-width: 768px) {
    .footer-container {
        grid-template-columns: 2fr 1fr 1fr;
    }
}

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

.footer-col h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 14px;
}

.footer-col ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-col ul a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 13px;
    transition: color 0.2s ease;
}

.footer-col ul a:hover {
    color: #E11D48;
}

.footer-bottom {
    max-width: 1100px;
    margin: 0 auto;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    text-align: center;
}

.disclaimer {
    font-size: 11px;
    color: var(--text-muted);
    max-width: 800px;
    margin: 0 auto 10px auto;
    line-height: 1.5;
}

.copyright {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
}
