/* ============================================
   TikStalker - Premium Dark Glassmorphism Theme
   ============================================ */

/* --- CSS Variables --- */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-card-hover: rgba(255, 255, 255, 0.07);
    --bg-glass: rgba(255, 255, 255, 0.06);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);

    --text-primary: #f0f0f5;
    --text-secondary: #a0a0b8;
    --text-muted: #9c9caf;

    --accent: #7c3aed;
    --accent-light: #a78bfa;
    --accent-glow: rgba(124, 58, 237, 0.3);
    --accent-gradient: linear-gradient(135deg, #7c3aed 0%, #ec4899 50%, #f97316 100%);

    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-full: 999px;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 64px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px var(--accent-glow);

    --font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Background mesh gradient */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse 80% 50% at 20% 40%, rgba(124, 58, 237, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 80% 20%, rgba(236, 72, 153, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse 50% 30% at 50% 80%, rgba(249, 115, 22, 0.04) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

a {
    color: var(--accent-light);
    text-decoration: none;
    transition: color var(--transition);
}

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

/* --- Header --- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 118px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
}

.logo-icon {
    font-size: 24px;
}

.logo-text {
    font-size: 20px;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

/* --- Language Switcher --- */
.lang-switcher {
    position: relative;
}

.lang-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 8px 14px;
    min-width: 118px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 13px;
    font-family: var(--font-family);
    cursor: pointer;
    transition: all var(--transition);
}

.lang-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.lang-globe {
    font-size: 16px;
}

.lang-arrow {
    font-size: 10px;
    transition: transform var(--transition);
}

.lang-switcher.open .lang-arrow {
    transform: rotate(180deg);
}

.lang-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    max-height: 320px;
    overflow-y: auto;
    background: rgba(18, 18, 26, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 200;
}

.lang-switcher.open .lang-dropdown {
    display: block;
}

.lang-option {
    display: block;
    padding: 10px 16px;
    color: var(--text-secondary);
    font-size: 13px;
    text-decoration: none;
    transition: all var(--transition);
    white-space: nowrap;
}

.lang-option:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.lang-option.active {
    color: var(--accent-light);
    font-weight: 600;
}

.lang-dropdown::-webkit-scrollbar {
    width: 4px;
}

.lang-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.lang-dropdown::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

/* --- Hero --- */
.hero {
    padding: 80px 0 40px;
    text-align: center;
    position: relative;
    overflow: clip;
    min-height: 320px;
}

.hero-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    opacity: 0.42;
}

.hero-title {
    font-size: clamp(32px, 6vw, 56px);
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 16px;
    min-height: 2.25em;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -1px;
}

.hero-subtitle {
    font-size: clamp(16px, 2.5vw, 20px);
    color: var(--text-secondary);
    max-width: 560px;
    margin: 0 auto 40px;
    line-height: 1.6;
    min-height: 3.2em;
}

/* --- Search Box --- */
.search-box {
    display: flex;
    align-items: center;
    max-width: 600px;
    margin: 0 auto;
    min-height: 64px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 6px;
    transition: all var(--transition);
    box-shadow: var(--shadow-sm);
}

.search-box:focus-within {
    border-color: var(--accent);
    box-shadow: var(--shadow-glow);
}

.search-input-wrap {
    display: flex;
    align-items: center;
    flex: 1;
    padding: 0 4px 0 16px;
    gap: 10px;
}

.search-icon {
    font-size: 18px;
    opacity: 0.5;
    flex-shrink: 0;
}

.search-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 16px;
    padding: 14px 0;
    min-width: 0;
}

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

.search-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: var(--accent-gradient);
    border: none;
    border-radius: var(--radius-lg);
    color: #fff;
    font-family: var(--font-family);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    flex-shrink: 0;
}

.search-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow);
}

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

.search-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-arrow {
    transition: transform var(--transition);
}

.search-btn:hover .btn-arrow {
    transform: translateX(3px);
}

/* --- Results --- */
.results-section {
    padding: 0 0 40px;
}

/* Message */
.tsv-message {
    text-align: center;
    padding: 32px 24px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    font-size: 15px;
}

/* Loading spinner */
.tsv-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 48px 24px;
}

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

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

/* Tabs */
.tsv-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 20px;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.tsv-tabs::-webkit-scrollbar {
    height: 4px;
}

.tsv-tabs::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.tsv-tab {
    flex-shrink: 0;
    padding: 10px 18px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-family: var(--font-family);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.tsv-tab:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.tsv-tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    font-weight: 600;
}

/* Panels */
.tsv-panel {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tsv-panel.active {
    display: block;
}

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

/* Card */
.tsv-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition);
}

.tsv-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}

.tsv-media {
    background: #000;
    position: relative;
}

.tsv-video,
.tsv-cover {
    display: block;
    width: 100%;
    max-height: 70vh;
    object-fit: contain;
    background: #000;
}

.tsv-body {
    padding: 24px;
}

.tsv-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
    color: var(--accent-light);
    margin-bottom: 12px;
}

.tsv-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.tsv-caption {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 12px;
    line-height: 1.6;
}

.tsv-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 16px;
}

.tsv-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
}

.tsv-meta-icon {
    font-size: 14px;
}

.tsv-audio {
    width: 100%;
    margin-top: 12px;
    border-radius: var(--radius-sm);
}

.tsv-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.tsv-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    transition: all var(--transition);
    text-decoration: none;
}

.tsv-link:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
    color: var(--accent-light);
    transform: translateY(-1px);
}

/* --- How It Works --- */
.how-section {
    padding: 80px 0;
    min-height: 520px;
}

.section-title {
    text-align: center;
    font-size: clamp(24px, 4vw, 36px);
    font-weight: 800;
    margin-bottom: 48px;
    min-height: 1.3em;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.step-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    text-align: center;
    transition: all var(--transition);
}

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

.step-number {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    width: 28px;
    height: 28px;
    background: var(--accent-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
}

.step-icon {
    font-size: 36px;
    margin-bottom: 16px;
}

.step-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.step-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* --- SEO Copy --- */
.seo-copy-section {
    padding: 0 0 72px;
}

.seo-copy-card {
    max-width: 860px;
    margin: 0 auto;
    padding: 30px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.025));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
}

.seo-copy-card .section-title {
    margin-bottom: 18px;
}

.seo-copy-text {
    display: grid;
    gap: 14px;
}

.seo-copy-text p {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.85;
}

.seo-copy-rich {
    gap: 16px;
}

.seo-copy-rich > *:first-child {
    margin-top: 0;
}

.seo-copy-rich h3 {
    margin-top: 14px;
    color: var(--text-primary);
    font-size: 22px;
    line-height: 1.25;
    font-weight: 700;
}

.seo-copy-rich p,
.seo-copy-rich li {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.85;
}

.seo-copy-rich ul,
.seo-copy-rich ol {
    padding-inline-start: 22px;
    display: grid;
    gap: 6px;
}

.seo-copy-rich ul {
    list-style: disc;
}

.seo-copy-rich ol {
    list-style: decimal;
}

.seo-copy-rich strong {
    color: var(--text-primary);
}

/* --- FAQ --- */
.faq-section {
    padding: 0 0 80px;
}

.legal-page {
    padding: 64px 0 80px;
}

.legal-card {
    max-width: 820px;
    margin: 0 auto;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 36px 32px;
    box-shadow: var(--shadow-md);
}

.legal-back {
    display: inline-flex;
    align-items: center;
    margin-bottom: 18px;
    font-size: 13px;
    color: var(--text-secondary);
}

.legal-title {
    font-size: clamp(28px, 5vw, 42px);
    line-height: 1.1;
    margin-bottom: 14px;
    font-weight: 800;
    color: var(--text-primary);
}

.legal-intro {
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 28px;
}

.legal-block + .legal-block {
    margin-top: 24px;
}

.legal-block h2 {
    font-size: 20px;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.legal-block p {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.8;
}

.faq-list {
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all var(--transition);
}

.faq-item:hover {
    border-color: var(--border-hover);
}

.faq-item[open] {
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.1);
}

.faq-question {
    padding: 18px 24px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    color: var(--text-primary);
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: color var(--transition);
}

.faq-question::-webkit-details-marker {
    display: none;
}

.faq-question::after {
    content: '+';
    font-size: 20px;
    font-weight: 300;
    color: var(--text-muted);
    transition: transform var(--transition);
    flex-shrink: 0;
    margin-left: 16px;
}

.faq-item[open] .faq-question::after {
    content: '−';
    color: var(--accent-light);
}

.faq-answer {
    padding: 0 24px 18px;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    animation: fadeIn 0.3s ease;
}

/* --- Footer --- */
.site-footer {
    border-top: 1px solid var(--border-color);
    padding: 32px 0;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-copy {
    font-size: 13px;
    color: #c4c4d8;
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-links a {
    font-size: 13px;
    color: #c4c4d8;
    transition: color var(--transition);
}

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

/* --- RTL Support --- */
[dir="rtl"] .search-input-wrap {
    padding: 0 16px 0 4px;
}

[dir="rtl"] .btn-arrow {
    transform: rotate(180deg);
}

[dir="rtl"] .search-btn:hover .btn-arrow {
    transform: rotate(180deg) translateX(3px);
}

[dir="rtl"] .lang-dropdown {
    right: auto;
    left: 0;
}

/* --- Responsive --- */
@media (max-width: 640px) {
    .header-inner {
        height: 56px;
    }

    .logo-text {
        font-size: 17px;
    }

    .lang-current {
        display: none;
    }

    .header-actions,
    .lang-btn {
        min-width: auto;
    }

    .hero {
        padding: 48px 0 24px;
        min-height: 300px;
    }

    .hero-title {
        min-height: 2.5em;
    }

    .legal-page {
        padding: 40px 0 56px;
    }

    .legal-card {
        padding: 24px 20px;
    }

    .hero-subtitle {
        min-height: 3.2em;
        margin-bottom: 28px;
    }

    .hero-glow {
        width: 380px;
        height: 380px;
        opacity: 0.34;
    }

    .search-box {
        flex-direction: column;
        border-radius: var(--radius-lg);
        padding: 8px;
        min-height: 122px;
    }

    .search-input-wrap {
        width: 100%;
        padding: 0 12px;
    }

    .search-btn {
        width: 100%;
        justify-content: center;
        border-radius: var(--radius-md);
    }

    .how-section {
        min-height: 0;
    }

    .footer-inner {
        flex-direction: column;
        text-align: center;
    }

    .tsv-meta {
        gap: 10px;
    }

    .tsv-actions {
        flex-direction: column;
    }

    .tsv-link {
        justify-content: center;
    }
}
