:root {
    --primary: #ff3e3e;
    --secondary: #2a2a2a;
    --accent: #6c5ce7;
    --bg: #0f0f0f;
    --glass: rgba(255, 255, 255, 0.05);
    --text: #ffffff;
    --success: #00b894;
}

* {
    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;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    background: radial-gradient(circle at top right, #1a1a2e, #0f0f0f);
}

.container {
    width: 100%;
    max-width: 850px;
    z-index: 1;
}

header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 0.8s ease-out;
    position: relative;
}

.lang-switch {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    gap: 0.5rem;
}

.lang-btn {
    background: var(--glass);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 8px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: 0.3s;
}

.lang-btn.active {
    background: var(--accent);
    border-color: var(--accent);
}

h1 {
    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(to right, #ff3e3e, #6c5ce7, #00d2ff);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
}

.search-box {
    background: var(--glass);
    backdrop-filter: blur(15px);
    padding: 1.5rem;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.search-box:focus-within {
    transform: translateY(-5px);
    border-color: var(--accent);
    box-shadow: 0 25px 50px rgba(108, 92, 231, 0.2);
}

input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: white;
    font-size: 1.15rem;
    padding: 0.5rem;
}

button {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    border: none;
    padding: 0.8rem 1.8rem;
    border-radius: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    box-shadow: 0 4px 15px rgba(255, 62, 62, 0.3);
}

button:hover {
    filter: brightness(1.2);
    transform: scale(1.03);
    box-shadow: 0 6px 20px rgba(255, 62, 62, 0.4);
}

button:active {
    transform: scale(0.98);
}

button:disabled {
    filter: grayscale(1);
    cursor: not-allowed;
    transform: none;
    opacity: 0.6;
}

.list-container {
    margin-top: 2rem;
    display: none;
    animation: fadeIn 0.5s ease-in;
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 0 1rem;
}

.video-item {
    background: var(--glass);
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 1.2rem;
    border-radius: 20px;
    padding: 1.2rem;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.video-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.video-thumb {
    width: 130px;
    height: 73px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.video-info {
    flex: 1;
}

.video-title {
    font-weight: 700;
    margin-bottom: 0.3rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
    font-size: 1.05rem;
}

.video-meta {
    font-size: 0.9rem;
    color: #aaa;
    display: flex;
    gap: 1rem;
}

.progress-wrapper {
    margin-top: 0.8rem;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    display: none;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(to right, var(--accent), var(--success));
    transition: width 0.3s ease;
}

.download-action {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
    min-width: 120px;
}

.status {
    font-size: 0.85rem;
    font-weight: 600;
}

.loading-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.legal {
    margin-top: 5rem;
    text-align: center;
    font-size: 0.8rem;
    color: #666;
    max-width: 650px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 1.5rem;
}

.timer {
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: bold;
}

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

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Mobile adjustments */
@media (max-width: 600px) {
    .search-box {
        flex-direction: column;
    }

    .video-item {
        flex-direction: column;
        text-align: center;
    }

    .video-thumb {
        width: 100%;
        height: auto;
    }

    .download-action {
        align-items: center;
        width: 100%;
    }

    button {
        width: 100%;
    }

    h1 {
        font-size: 2.2rem;
    }

    .lang-switch {
        position: relative;
        justify-content: center;
        margin-bottom: 1rem;
    }
}