/* Premium Dark Theme — TikTok Default */
:root {
    --primary-color: #00f2ea;
    --secondary-color: #ff0050;
    --accent-glow: 255, 0, 80;
    --bg-color: #0a0a0a;
    /* Dark background */
    --surface-color: #1a1a1a;
    /* Dark surface */
    --text-color: #ffffff;
    --text-muted: #a0a0a0;

    /* Vibrant Gradients — TikTok Red */
    --gradient-primary: linear-gradient(135deg, #00f2ea 0%, #ff0050 100%);
    --gradient-hover: linear-gradient(135deg, #00c7c0 0%, #d60043 100%);

    /* Dark Glassmorphism */
    --glass-bg: rgba(20, 20, 20, 0.7);
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);

    /* Soft Premium Shadows (Dark Mode) */
    --shadow-premium: 0 10px 40px rgba(0, 0, 0, 0.5);
    --shadow-hover: 0 15px 50px rgba(0, 0, 0, 0.6);

    --radius-lg: 20px;
    --radius-md: 12px;
    --radius-full: 50px;
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    background-color: var(--bg-color);
    /* Prevents white overscroll boxes on mobile */
}

body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    /* Standard Normal Helvetica */
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    /* Full Rich Gradient (Deep Dark Charcoal) */
    background: linear-gradient(#1a1a1a 0%, #050505 100%);
    background-size: cover;
    background-attachment: fixed;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.3s;
}

ul {
    list-style: none;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Gradient Text */
.gradient-text {
    background: var(--gradient-primary);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.highlight {
    color: var(--secondary-color);
}

/* Navigation */
.navbar {
    padding: 15px 0;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    background: rgba(18, 18, 18, 0.85);
    /* Semi-transparent dark background */
    backdrop-filter: blur(12px);
    /* Premium glass blur effect */
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    /* Subtle separator line */
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    /* Soft drop shadow */
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 26px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0;
    color: var(--text-color);
}

.logo i {
    color: var(--text-color);
}

.nav-links {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-item {
    font-weight: 500;
    color: var(--text-color);
    position: relative;
}

.nav-item:hover {
    color: var(--secondary-color);
}

.btn-primary-sm {
    background: var(--gradient-primary);
    padding: 10px 24px;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 14px;
    color: white;
    box-shadow: 0 4px 15px rgba(0, 242, 234, 0.3);
}

.btn-primary-sm:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 242, 234, 0.4);
}

/* Ad Containers */
.ad-container {
    margin: 20px auto;
    width: 100%;
    max-width: 970px;
    display: flex;
    justify-content: center;
}

.ad-placeholder {
    width: 100%;
    height: 90px;
    background: #1e1e1e;
    /* Dark placeholder */
    border: 1px dashed #333;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    border-radius: var(--radius-md);
}

.top-ad {
    margin-top: 30px;
    margin-bottom: 20px;
}

/* Hero Section */
.hero {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 120px 0 60px;
    position: relative;
    width: 100%;
}

.hero-content {
    max-width: 1000px;
    /* Increased to fit one-line title */
    width: 100%;
}

.hero-title {
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: 5px;
    color: var(--text-color);
    font-weight: 800;
    text-align: center;
    white-space: nowrap;
    /* Force one line */
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 1.8rem;
        white-space: normal;
    }
}

.hero-subtitle {
    font-size: 1.20rem;
    color: var(--text-muted);
    margin-bottom: 35px;
    font-weight: 400;
}

/* Output Area */

/* Platform Switcher */
.platform-switch {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.switch-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    padding: 10px 24px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(5px);
}

.switch-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    transform: translateY(-2px);
}

.switch-btn.active {
    background: var(--gradient-primary);
    color: #fff;
    border: none;
    padding: 11px 25px;
    /* Offset to prevent size jump from removed border */
    margin: -1px;
    /* Keep alignment */
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.switch-btn i {
    font-size: 1.1rem;
}

/* Instagram Theme Override — Orange Gradient */
body.instagram-theme {
    --primary-color: #FF8C00;
    --secondary-color: #FF6B00;
    --accent-glow: 255, 140, 0;
    --gradient-primary: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    --gradient-hover: linear-gradient(45deg, #e6683c 0%, #dc2743 50%, #bc1888 100%);
}

/* Input Area - Prominent Input Box */
.input-wrapper {
    background: #222;
    padding: 12px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(var(--accent-glow), 0.15);
    border: 1px solid rgba(var(--accent-glow), 0.25);
    flex-wrap: wrap;
    position: relative;
    max-width: 750px;
    margin: 0 auto;
}

.input-group {
    flex: 1;
    display: flex;
    align-items: center;
    background: #181818;
    /* Visible but still dark */
    border-radius: var(--radius-full);
    padding: 0 24px;
    height: 64px;
    position: relative;
    transition: 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.input-group:focus-within {
    background: #1e1e1e;
    border-color: rgba(var(--accent-glow), 0.4);
    box-shadow: 0 0 0 3px rgba(var(--accent-glow), 0.1), 0 10px 30px rgba(0, 0, 0, 0.5);
}

.input-icon {
    color: var(--text-muted);
    margin-right: 15px;
    font-size: 20px;
}

input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-color);
    font-size: 18px;
    flex: 1;
    width: 100%;
    height: 100%;
    font-family: inherit;
}

input::placeholder {
    color: #555;
}

.paste-btn,
.clear-btn {
    background: rgba(255, 0, 80, 0.1);
    border: none;
    color: var(--secondary-color);
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    transition: 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 10px;
}

.paste-btn:hover,
.clear-btn:hover {
    background: rgba(255, 0, 80, 0.2);
}

.hidden {
    display: none !important;
}

/* Supported Content Type Badges */
.supported-types {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.type-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: 0.3s;
}

.type-badge i {
    font-size: 0.75rem;
    opacity: 0.8;
}

.type-badge:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-primary {
    background: #ffffff;
    /* Solid White for Dark Theme Contrast */
    border: none;
    color: #000;
    /* Black text on white btn */
    padding: 0 45px;
    height: 64px;
    border-radius: var(--radius-full);
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.btn-primary:hover {
    box-shadow: 0 10px 25px rgba(255, 255, 255, 0.2);
    transform: scale(1.02);
    background: #f0f0f0;
}

/* Loader */
.loader {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.spinner {
    width: 45px;
    height: 45px;
    border: 5px solid rgba(255, 255, 255, 0.1);
    border-top: 5px solid var(--secondary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Result Area */
.result-area {
    margin-top: 60px;
    width: 100%;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.video-card {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    padding: 30px;
    border: 1px solid #333;
    box-shadow: var(--shadow-premium);
    display: flex;
    gap: 30px;
    text-align: left;
    max-width: 800px;
    margin: 0 auto;
    align-items: center;
}

.video-thumb {
    width: 130px;
    flex-shrink: 0;
}

.video-thumb img {
    width: 100%;
    border-radius: var(--radius-md);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.video-info h3 {
    margin-bottom: 5px;
    font-size: 1.2rem;
}

.download-options {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-download {
    background: #00be63;
    /* Snaptik Green */
    color: white;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: 0.2s;
    box-shadow: 0 4px 10px rgba(0, 190, 99, 0.2);
    border: none;
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
}

.btn-download:hover {
    background: #00a053;
    transform: translateY(-1px);
}

.btn-download.btn-secondary {
    background: #2a2a2a;
    /* Dark secondary button */
    color: var(--text-color);
    box-shadow: none;
}

.btn-download.btn-secondary:hover {
    background: #333;
}

.result-ad {
    margin-top: 30px;
    border-radius: var(--radius-lg);
}

/* Features */
.features {
    padding: 100px 0;
    background: #0f0f0f;
    /* Dark bg for features */
    margin-top: 50px;
}

.section-header {
    text-align: center;
    margin-bottom: 70px;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.section-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 40px;
}

.feature-card {
    background: #1a1a1a;
    padding: 40px 30px;
    border-radius: var(--radius-lg);
    text-align: center;
    transition: 0.3s;
    border: 1px solid transparent;
}

.feature-card:hover {
    transform: translateY(-10px);
    background: #222;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    border-color: #333;
}

.icon-box {
    width: 80px;
    height: 80px;
    background: #2a2a2a;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    color: var(--secondary-color);
    font-size: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin: 0 auto 25px;
}

.feature-card h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.feature-card p {
    color: var(--text-muted);
    font-size: 1rem;
}

/* FAQ */
.faq-grid {
    display: grid;
    gap: 24px;
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: #1a1a1a;
    padding: 30px;
    border-radius: var(--radius-lg);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid #333;
}

.faq-item h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--text-color);
}

.faq-item p {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.6;
}

.faq-note {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 40px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
    opacity: 0.8;
}

/* Footer */
.footer {
    padding: 60px 0 40px;
    border-top: 1px solid #222;
    margin-top: 80px;
    background: #0f0f0f;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
}

.footer-logo {
    font-size: 28px;
    font-weight: 700;
}

.footer-links {
    display: flex;
    gap: 25px;
}

.footer-links a {
    color: var(--text-muted);
    font-weight: 500;
}

.footer-links a:hover {
    color: var(--text-color);
}

/* Sticky Ad */
.sticky-ad {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(15, 15, 15, 0.95);
    /* Dark sticky ad bg */
    backdrop-filter: blur(10px);
    padding: 15px;
    z-index: 1000;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: center;
    border-top: 1px solid #333;
}

.sticky-placeholder {
    width: 100%;
    max-width: 728px;
    height: 90px;
    margin: 0 auto;
    background: #1e1e1e;
    border: 1px dashed #333;
}

.close-ad {
    position: absolute;
    top: -35px;
    right: 20px;
    background: #1e1e1e;
    color: #fff;
    border: none;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

/* Responsive */
/* Responsive Design & Cross-Device Optimization */
@media (max-width: 1024px) {

    /* Tablet & Small Laptops */
    .container {
        width: 95%;
    }

    .hero-title {
        font-size: 2.2rem;
        white-space: normal;
        /* Allow wrapping on tablet if needed */
    }

    /* Make input box wider on tablet */
    .input-wrapper {
        max-width: 90%;
    }
}

@media (max-width: 768px) {

    /* Mobile Devices */
    .hero {
        padding: 100px 0 40px;
        min-height: auto;
    }

    .hero-title {
        font-size: 1.8rem;
        line-height: 1.3;
        white-space: normal;
        /* Wrap text on mobile */
    }

    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 30px;
        padding: 0 10px;
    }

    .nav-container {
        flex-direction: row;
        /* Keep logo and links inline */
        justify-content: space-between;
        align-items: center;
        /* Vertically center them */
        gap: 15px;
    }

    .nav-links {
        display: flex;
        gap: 15px;
        /* Slightly tighter gap so it fits */
        font-size: 14px;
        width: auto;
        /* Don't force 100% width */
        justify-content: flex-end;
        /* Align right */
        flex-wrap: nowrap;
        /* Prevent wrapping */
    }

    /* Retain Strict Desktop Layout Array, just shrunk to fit screen */
    .input-wrapper {
        flex-wrap: nowrap;
        /* Force desktop single-row layout without breaking */
        padding: 6px;
        /* Shrink padding to fit tightly */
        gap: 6px;
        width: 100%;
        max-width: 100%;
        /* No margins on left/right edges */
        border-radius: var(--radius-full);
    }

    .input-group {
        padding: 0 12px;
        height: 50px;
        /* Scale down height */
    }

    .input-icon {
        font-size: 18px;
        margin-right: 8px;
    }

    .input-group input {
        font-size: 16px;
        /* Increased for readability */
    }

    .type-badge {
        padding: 8px 8px;
        /* Much smaller padding so they don't look like buttons */
        font-size: 0.7rem;
        /* Smaller text */
    }

    .type-badge i {
        font-size: 0.65rem;
        /* Smaller icon */
    }

    .btn-primary {
        padding: 0 16px;
        height: 50px;
        font-size: 16px;
        /* Increased for readability */
        min-width: 0;
        margin: 0;
    }

    /* Result Card Mobile */
    .video-card {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }

    .video-thumb {
        width: 100%;
        max-width: 250px;
        margin: 0 auto 15px;
    }

    .download-options {
        width: 100%;
    }

    .btn-download {
        width: 100%;
        justify-content: center;
    }

    /* Footer Mobile */
    .footer {
        padding: 40px 0 120px;
        /* More space for sticky ad */
    }

    .footer-links {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}

@media (max-width: 480px) {

    /* Small Phones */
    .hero-title {
        font-size: 1.6rem;
    }

    .hero-subtitle {
        font-size: 0.85rem;
        margin: 15px 20px;
        /* Smaller subtitle text on mobile */
    }

    .logo {
        font-size: 22px;
        margin-left: 10px;
    }

    .section-header h2 {
        font-size: 1.5rem;
        /* Make section headers like "Why Choose fypsave?" and FAQ smaller */
    }

    .section-header p {
        font-size: 0.9rem;
        margin: 0 20px;
        /* Add margin to section subtitle on mobile */
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        margin: 0 15px;
        /* Add margin on mobile so it doesn't touch the edges */
    }

    .feature-card {
        padding: 25px 15px;
        /* Less padding so they fit side-by-side */
    }

    .feature-card h3 {
        font-size: 0.85rem;
    }

    .feature-card p {
        font-size: 0.85rem;
    }

    .icon-box {
        width: 60px;
        height: 60px;
        font-size: 20px;
        margin-bottom: 20px;
    }

    .faq-grid {
        margin: 0 40px;
        /* Add margin on mobile so it doesn't touch the edges */
    }

    .faq-item h3 {
        font-size: 1rem;
    }

    .faq-item p {
        font-size: 0.85rem;
    }

    .faq-note {
        margin: 50px 50px 0;
        /* Add margin on mobile so it doesn't touch the edges */
    }

    .contact-form {
        padding: 20px;
    }

    .text-content {
        margin: 0 30px;
        /* Add margin to legal pages text on mobile */
    }

    .contact-info {
        margin: 40px 30px !important;
        /* Force side margin on mobile */
        padding: 30px !important;
        /* Reduce padding slightly */
    }

    /* Footer Mobile Centering and Layout */
    .footer {
        padding: 30px 0 20px;
        /* Reduce massive bottom space */
    }

    .footer-logo {
        font-size: 24px;
        /* Slightly smaller logo in footer */
    }

    .footer-links {
        flex-direction: row;
        /* Keep them inline instead of stacking */
        flex-wrap: wrap;
        /* Allow wrapping if they don't fit */
        justify-content: center;
        gap: 13px;
        /* Tighter gap */
    }

    .footer-links a {
        font-size: 1rem;
        /* Smaller footer links on mobile */
    }

    .footer p {
        text-align: center;
        margin: 10px 15px 0;
        /* Add margin to copyright text */
        line-height: 1.5;
        font-size: 0.8rem;
        /* Smaller copyright text on mobile */
    }
}

/* Format Selector Dropdown */
.format-dropdown {
    position: relative;
    margin-left: 10px;
}

.format-selected {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.3s;
    font-family: inherit;
}

.format-selected:hover {
    background: rgba(255, 255, 255, 0.1);
}

.format-selected i:last-child {
    font-size: 12px;
    margin-left: 4px;
    opacity: 0.7;
}

.format-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 6px;
    min-width: 140px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 50;
    animation: fadeIn 0.2s ease;
}

.format-option {
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    font-size: 14px;
    transition: 0.2s;
}

.format-option:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-color);
}

.format-option.active {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}


/* Contact Page */
.contact-form {
    max-width: 600px;
    margin: 0 auto;
    background: var(--surface-color);
    padding: 40px;
    border-radius: var(--radius-lg);
    border: 1px solid #333;
    box-shadow: var(--shadow-premium);
}

.form-group {
    margin-bottom: 25px;
}

.form-label {
    display: block;
    margin-bottom: 10px;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
}

.contact-input,
.contact-textarea {
    width: 100%;
    background: #0f0f0f;
    border: 1px solid #333;
    padding: 15px;
    border-radius: var(--radius-md);
    color: var(--text-color);
    font-size: 1rem;
    font-family: inherit;
    transition: 0.3s;
    height: auto;
    /* Override generic input height */
}

.contact-input:focus,
.contact-textarea:focus {
    border-color: var(--primary-color);
    outline: none;
    background: #151515;
    box-shadow: 0 0 0 4px rgba(0, 242, 234, 0.1);
}

.contact-textarea {
    min-height: 180px;
    resize: vertical;
}

.contact-btn {
    width: 100%;
    background: linear-gradient(135deg, #6e8efb, #a777e3);
    color: white;
    padding: 16px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
    box-shadow: 0 4px 15px rgba(167, 119, 227, 0.3);
}

.contact-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(167, 119, 227, 0.4);
}