html {
    scroll-behavior: smooth;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #000;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start; /*center;*/
    padding: 90px 10px 90px 10px;
    /*padding: 20px;*/
    color: #f1f1f1;
}


.container {
    width: 100%;
    max-width: 800px;
    display: flex;
    justify-content: center;
    align-items: center;
}


.card {
    width: 100%;
    background: #111;
    border-radius: 20px;
    padding: 32px;
    border: 1px solid #1c1c1c;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.7);
}

.card .header {
    text-align: center;
    margin-bottom: 22px;
}

.card .header h1 {
    font-size: 2.6rem;
    margin-bottom: 8px;
    color: #fff;
    line-height: 1;
    text-shadow: 0 0 10px rgba(120, 90, 255, 0.25);
}

.card .header .subtitle {
    font-size: 1.05rem;
    opacity: 0.72;
    color: rgba(255,255,255,0.9);
}


.form {
    margin-top: 20px;
    margin-bottom: 30px;
}

.input-group {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

input[type="url"] {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #222;
    background: #0d0d0d;
    color: #fff;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.22s cubic-bezier(.2,.8,.2,1);
}

input[type="url"]::placeholder {
    color: rgba(255, 255, 255, 0.38);
}

input[type="url"]:focus {
    outline: none;
    border-color: #764ba2;
    box-shadow: 0 0 0 4px rgba(118, 75, 162, 0.08);
}

button {
    padding: 15px 30px;
    min-width: 120px;
    background: linear-gradient(135deg, #764ba2, #4a1e7a);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(118, 75, 162, 0.18);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}


.loading {
    text-align: center;
    padding: 32px 0;
}

.spinner {
    border: 4px solid rgba(255,255,255,0.06);
    border-top: 4px solid #764ba2;
    border-radius: 50%;
    width: 46px;
    height: 46px;
    animation: spin 1s linear infinite;
    margin: 0 auto 18px;
}

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


.result {
    animation: fadeIn 0.38s ease;
}

.video-info h3 {
    margin-bottom: 14px;
    color: #fff;
    font-size: 0.7rem;
}

.media-container {
    margin: 18px 0;
}

.video-preview video {
    width: 100%;
    max-height: 420px;
    border-radius: 12px;
    background: #000;
    display: block;
}

.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
}

.image-gallery img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #222;
}


.actions {
    margin-top: 18px;
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    background: linear-gradient(135deg, #4CAF50, #2e7d32);
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(76, 175, 80, 0.18);
}


.error {
    background: #1b0006;
    color: #ff7b7b;
    padding: 16px;
    border-radius: 10px;
    text-align: center;
    border: 1px solid #601010;
}


.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    margin-top: 26px;
}

.feature {
    text-align: center;
    color: white;
    padding: 24px;
    background: #0f0f0f;
    border-radius: 14px;
    border: 1px solid #1c1c1c;
}

.feature i {
    font-size: 2.2rem;
    margin-bottom: 12px;
    color: #764ba2;
}


.hidden {
    display: none !important;
}


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


@media (max-width: 768px) {
    .input-group {
        flex-direction: column;
    }

    .card {
        padding: 20px;
    }

    .card .header h1 {
        font-size: 1.8rem;
    }

    .image-gallery img {
        height: 120px;
    }
}


footer {
    margin-top: 18px;
    font-size: 0.85rem;
    color: #777;
    display: flex;
    justify-content: center;
    text-align: center;
}

.footer-link {
    color: #1E90FF;
    text-decoration: none;
}

.footer-link:hover,
.footer-link:focus {
    text-decoration: none;
}
