:root {
    --primary: #9d4edd;
    --secondary: #ff758c;
    --accent: #ff7eb3;
    --bg: #0f0c29;
    --glass: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text: #ffffff;
    --text-muted: #b3b3b3;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

.bg-shape {
    position: absolute;
    filter: blur(100px);
    z-index: -1;
    border-radius: 50%;
    animation: float 20s infinite ease-in-out alternate;
}

.shape1 {
    width: 400px;
    height: 400px;
    background: var(--primary);
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.shape2 {
    width: 300px;
    height: 300px;
    background: var(--secondary);
    bottom: -50px;
    right: -50px;
    animation-delay: -5s;
}

.shape3 {
    width: 250px;
    height: 250px;
    background: var(--accent);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -10s;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(50px, 30px) scale(1.1);
    }

    100% {
        transform: translate(-30px, 60px) scale(0.9);
    }
}

.container {
    width: 100%;
    max-width: 600px;
    padding: 40px;
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: 0 25px 45px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

header {
    text-align: center;
    margin-bottom: 40px;
}

.gradient-text {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}

header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.save-folder {
    margin-top: 10px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.35);
    font-family: monospace;
}

.search-box {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}

input {
    flex: 1;
    padding: 16px 24px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.2);
    color: var(--text);
    font-size: 1rem;
    outline: none;
    transition: 0.3s;
}

input:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 15px rgba(255, 117, 140, 0.3);
}

button {
    padding: 16px 32px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 120px;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(157, 78, 221, 0.4);
}

button:active {
    transform: translateY(0);
}

.error-box {
    background: rgba(255, 50, 50, 0.1);
    border: 1px solid rgba(255, 50, 50, 0.3);
    color: #ffb3b3;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 0.9rem;
}

.result-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    overflow: hidden;
    animation: slideUp 0.5s ease-out forwards;
    display: flex;
    flex-direction: column;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.media-preview {
    width: 100%;
    height: 250px;
    position: relative;
    background: #000;
}

.media-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
}

.platform-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.media-info {
    padding: 25px;
}

.media-info h2 {
    font-size: 1.2rem;
    font-weight: 400;
    margin-bottom: 15px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.stats {
    display: flex;
    gap: 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 25px;
}

.audio-toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
}

.audio-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.audio-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 24px;
    transition: 0.3s;
}

.toggle-slider::before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: #ffffff;
    border-radius: 50%;
    transition: 0.3s;
}

.audio-toggle input:checked+.toggle-slider {
    background: linear-gradient(135deg, #00f2fe, #4facfe);
    box-shadow: 0 0 12px rgba(79, 172, 254, 0.4);
}

.audio-toggle input:checked+.toggle-slider::before {
    transform: translateX(20px);
}

.audio-toggle-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    user-select: none;
}

.download-btn {
    width: 100%;
    background: linear-gradient(135deg, #00f2fe, #4facfe);
    font-size: 1.1rem;
    padding: 18px;
}

.download-btn:hover {
    box-shadow: 0 10px 20px rgba(79, 172, 254, 0.4);
}

.hide {
    display: none !important;
}

.spinner {
    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;
}

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

.carousel-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    padding: 15px 25px 25px;
    border-top: 1px solid var(--glass-border);
}

.carousel-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 1;
    background: rgba(0, 0, 0, 0.4);
}

.carousel-item img,
.carousel-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.carousel-download-btn {
    position: absolute;
    bottom: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    min-width: unset;
    padding: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, #00f2fe, #4facfe);
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.carousel-item:hover .carousel-download-btn {
    opacity: 1;
}

.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(0, 200, 100, 0.9);
    backdrop-filter: blur(12px);
    color: #fff;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 500;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
    max-width: 90vw;
    text-align: center;
}

.toast-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast-error {
    background: rgba(255, 60, 60, 0.9);
}

.queue-indicator {
    background: rgba(255, 200, 50, 0.12);
    border: 1px solid rgba(255, 200, 50, 0.25);
    color: #ffd966;
    padding: 10px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    text-align: center;
    font-size: 0.82rem;
    font-weight: 500;
    animation: fadeIn 0.3s ease-out;
}

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