:root {
    --bg-color: #0f172a;
    --text-color: #f8fafc;
    --accent-color: #38bdf8;
    --accent-hover: #0ea5e9;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --blob-1: #7c3aed;
    --blob-2: #db2777;
    --blob-3: #2563eb;
}

.effect-select {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--text-color);
    /* Changed from --text-main to --text-color to match existing variables */
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
}

.effect-select:focus {
    border-color: var(--accent-color);
    /* Changed from --primary to --accent-color to match existing variables */
    background-color: rgba(255, 255, 255, 0.1);
}

.effect-select option {
    background: #1e293b;
    color: white;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    filter: blur(80px);
    opacity: 0.6;
}

.blob {
    position: absolute;
    border-radius: 50%;
    animation: float 20s infinite alternate;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: var(--blob-1);
    top: -100px;
    left: -100px;
}

.blob-2 {
    width: 300px;
    height: 300px;
    background: var(--blob-2);
    bottom: -50px;
    right: -50px;
    animation-delay: -5s;
}

.blob-3 {
    width: 350px;
    height: 350px;
    background: var(--blob-3);
    top: 40%;
    left: 40%;
    animation-delay: -10s;
}

@keyframes float {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }

    100% {
        transform: translate(30px, 50px) rotate(20deg);
    }
}

.container {
    width: 100%;
    max-width: 600px;
    padding: 2rem;
    text-align: center;
    z-index: 1;
}

header {
    margin-bottom: 3rem;
}

h1 {
    font-size: 3.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #fff, #94a3b8);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    color: #94a3b8;
    font-size: 1.2rem;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease;
}

.icon-container {
    margin-bottom: 2rem;
    color: var(--accent-color);
}

.status-area {
    margin-bottom: 2rem;
    min-height: 1.5rem;
}

.status-text {
    font-size: 1.1rem;
    color: #e2e8f0;
}

.filter-section {
    margin-bottom: 2rem;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.filter-header {
    margin-bottom: 1rem;
}

.filter-toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
}

.filter-toggle:hover {
    transform: scale(1.02);
}

/* Filter Header Layout - iOS Style */
.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 0.5rem;
}

/* Toggle Switch Styles */
.switch-input {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 48px;
    height: 26px;
    background: rgba(148, 163, 184, 0.2);
    border-radius: 50px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid rgba(148, 163, 184, 0.3);
    flex-shrink: 0;
}

.switch-input:checked {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    border-color: var(--accent-color);
}

.switch-input::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    top: 2px;
    left: 2px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.switch-input:checked::before {
    transform: translateX(22px);
}

.toggle-text {
    font-size: 1rem;
    font-weight: 600;
    color: #f1f5f9;
}

.filter-inputs {
    display: none;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.input-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

.input-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    color: #cbd5e1;
    font-size: 0.95rem;
    font-weight: 500;
}

.input-group label svg {
    color: var(--accent-color);
}

.input-group input[type="number"] {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #f8fafc;
    font-size: 1rem;
    font-family: 'Outfit', sans-serif;
    transition: all 0.3s ease;
    outline: none;
}

.input-group input[type="number"]:hover {
    border-color: rgba(56, 189, 248, 0.3);
}

.input-group input[type="number"]:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.1);
    background: rgba(15, 23, 42, 0.9);
}

/* Chrome, Safari, Edge, Opera - убираем стрелочки */
.input-group input[type="number"]::-webkit-outer-spin-button,
.input-group input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

/* Firefox - убираем стрелочки */
.input-group input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.cta-button {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 15px -3px rgba(14, 165, 233, 0.3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 200px;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(14, 165, 233, 0.4);
}

.cta-button:active {
    transform: translateY(0);
}

.cta-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.loader {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin-left: 10px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.result-area {
    margin-top: 2rem;
    padding: 2rem;
}

.hidden {
    display: none;
}

.video-wrapper {
    margin: 1.5rem 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

video {
    width: 100%;
    display: block;
}

.secondary-button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.secondary-button:hover {
    background: rgba(255, 255, 255, 0.2);
}

#video-title {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: #f1f5f9;
}

/* Navigation */
.nav-links {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 40px;
}

.nav-link {
    color: #94a3b8;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    padding: 8px 16px;
    border-radius: 12px;
}

.nav-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
    color: var(--accent-color);
    background: rgba(56, 189, 248, 0.1);
}

/* --- Mobile Compact Mode --- */
@media (max-width: 600px) {
    html {
        font-size: 14px;
        /* Base font scaling */
    }

    body {
        padding: 10px 0;
        align-items: flex-start;
    }

    .container {
        padding: 1rem;
        width: 100%;
        max-width: 100%;
        margin-top: 0;
    }

    h1 {
        font-size: 2rem;
    }

    header {
        margin-bottom: 1.5rem;
    }

    .nav-links {
        gap: 8px;
        margin-bottom: 20px;
        flex-wrap: wrap;
    }

    .nav-link {
        padding: 6px 10px;
        font-size: 0.9rem;
        background: rgba(255, 255, 255, 0.05);
        /* Slight box to separate buttons */
    }

    .glass-panel {
        padding: 1.5rem;
    }

    .icon-container {
        margin-bottom: 1rem;
    }

    .icon-container svg {
        width: 48px;
        height: 48px;
    }

    .filter-section {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .cta-button {
        width: 100%;
        padding: 1rem;
    }


}

/* --- Bottom Navigation --- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background: rgba(15, 23, 42, 0.85);
    /* Slightly darker for better contrast */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0 10px;
    z-index: 1000;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #64748b;
    text-decoration: none;
    font-size: 0.75rem;
    gap: 4px;
    transition: all 0.3s ease;
    flex: 1;
    padding-bottom: 10px;
    /* Offset for safe area */
}

.nav-item svg {
    width: 24px;
    height: 24px;
    stroke-width: 2px;
    transition: all 0.3s ease;
}

.nav-item.active {
    color: var(--accent-color);
}

.nav-item.active svg {
    stroke: var(--accent-color);
    filter: drop-shadow(0 0 5px rgba(56, 189, 248, 0.5));
}

.nav-center-wrapper {
    position: relative;
    top: -25px;
    /* Float above */
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.nav-fab {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    border: 4px solid #0f172a;
    /* Match body bg to create cutout effect */
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.4);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.nav-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(56, 189, 248, 0.6);
}

.nav-fab svg {
    width: 28px;
    height: 28px;
    stroke: white;
}

.nav-fab-label {
    margin-top: 4px;
    font-size: 0.75rem;
    color: var(--accent-color);
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.nav-center-wrapper:hover .nav-fab-label {
    opacity: 1;
    transform: translateY(0);
}

/* Adjust main container to not be hidden by nav */
body {
    padding-bottom: 100px;
    /* Space for navbar */
}

/* --- Compact Navbar Overrides --- */
.bottom-nav.compact {
    height: 60px;
    padding: 0 10px;
    backdrop-filter: blur(20px);
    background: rgba(15, 23, 42, 0.9);
}

.bottom-nav.compact .nav-item {
    padding-bottom: 0;
    gap: 0;
}

.bottom-nav.compact .nav-item.center-action {
    transform: translateY(-5px);
    /* Slight lift */
}

.bottom-nav.compact .nav-item.center-action:active {
    transform: translateY(-2px);
}

/* --- Effect Preview System --- */
#effect-preview-wrapper {
    animation: fadeIn 0.3s ease;
}

.preview-stage {
    width: 100%;
    aspect-ratio: 9/16;
    /* TikTok format */
    background: #000;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* The "Video" content */
.preview-video-dummy {
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #FF6B6B, #4ECDC4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.dummy-subject {
    font-size: 3rem;
    transition: all 0.5s ease;
}

/* --- Simulation Classes --- */

/* Gradient Border: Squeeze content + Animated Border */
.preview-stage.sim-gradient_border {
    padding: 3%;
    background: linear-gradient(135deg, #ff00cc, #333399);
    /* Example gradient */
}

.preview-stage.sim-gradient_border .preview-video-dummy {
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

/* Blur Border: Squeeze content + Blurred BG */
.preview-stage.sim-blur_border {
    /* Use pseudo-element for blur bg in real implementation, simplified here */
    background: #4ECDC4;
    /* Dominant color */
}

.preview-stage.sim-blur_border .preview-video-dummy {
    width: 85%;
    height: 85%;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    background: linear-gradient(45deg, #FF6B6B, #4ECDC4);
    /* Reset bg */
}

/* Mirror: Flip Horizontal */
.preview-stage.sim-mirror .preview-video-dummy {
    transform: scaleX(-1);
}

/* Zoom: Scale Up */
.preview-stage.sim-zoom .preview-video-dummy {
    transform: scale(1.4);
}

/* --- Category Tag Cloud --- */
.category-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px 0;
    margin-bottom: 8px;
}

.category-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    /* Pill shape */
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    color: rgba(255, 255, 255, 0.7);
    /* Prevent shrinking */
    flex-shrink: 0;
}

.category-tag:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
    color: rgba(255, 255, 255, 0.9);
}

.category-tag.active {
    background: linear-gradient(135deg, #6e8efb, #a777e3);
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 15px rgba(110, 142, 251, 0.35);
    transform: translateY(-1px);
}

.category-tag input {
    display: none;
    /* Hide checkbox */
}