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

body {
    background: #0c0d14;
    color: #ffffff;
    font-family: Arial, sans-serif;
    min-height: 100vh;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 8%;
    border-bottom: 1px solid #242532;
}

.logo {
    font-size: 24px;
    font-weight: 800;
}

.logo span {
    color: #a78bfa;
}

.nav-label {
    color: #9293a5;
    font-size: 11px;
    letter-spacing: 2px;
}

.container {
    max-width: 1100px;
    margin: auto;
    padding: 70px 20px 30px;
}

.hero {
    text-align: center;
}

.tag {
    color: #a78bfa;
    font-size: 12px;
    letter-spacing: 3px;
    font-weight: bold;
    margin-bottom: 20px;
}

h1 {
    font-size: clamp(42px, 7vw, 76px);
    line-height: 1.1;
    font-weight: 800;
}

h1 span {
    color: #a78bfa;
}

.subtitle {
    color: #a4a5b5;
    max-width: 500px;
    margin: 20px auto 35px;
    line-height: 1.7;
}

/* Main card: label + input + button + status message */
.download-card {
    max-width: 650px;
    margin: 0 auto;
    padding: 30px;
    background: #171823;
    border: 1px solid #292a39;
    border-radius: 18px;
    text-align: left;
}

label {
    display: block;
    margin-bottom: 12px;
    font-size: 14px;
}

.input-wrapper {
    display: flex;
    background: #0e0f18;
    border: 1px solid #393a4b;
    border-radius: 10px;
    padding: 6px;
}

.input-wrapper:focus-within {
    border-color: #9875ed;
}

input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    outline: none;
    color: white;
    padding: 12px;
    font-size: 15px;
}

input::placeholder {
    color: #77798a;
}

.paste-btn {
    padding: 0 16px;
    border: none;
    border-radius: 7px;
    background: #292a3a;
    color: white;
    cursor: pointer;
}

.paste-btn:hover {
    background: #34354a;
}

.download-btn {
    width: 100%;
    margin-top: 18px;
    padding: 16px;
    border: none;
    border-radius: 9px;
    background: #8964e8;
    color: white;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
}

.download-btn:hover {
    background: #7650d6;
}

.download-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.paste-btn:focus-visible,
.download-btn:focus-visible {
    outline: 2px solid #a78bfa;
    outline-offset: 2px;
}

.message {
    margin-top: 15px;
    font-size: 14px;
    color: #a78bfa;
    line-height: 1.5;
}

.message:empty {
    display: none;
}

.message.error {
    color: #f87171;
}

.message.success {
    color: #34d399;
}

/* Result card: hidden by default, shown after a successful lookup */
.result-card {
    max-width: 650px;
    margin: 20px auto 0;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    text-align: left;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
}

.result-card[hidden] {
    display: none;
}

.result-card img {
    width: 112px;
    height: 112px;
    flex-shrink: 0;
    object-fit: cover;
    border-radius: 10px;
    background: #0e0f18;
}

.result-card img[hidden] {
    display: none;
}

.video-info {
    flex: 1;
    min-width: 0;
}

.video-info h3 {
    font-size: 16px;
    line-height: 1.4;
    margin-bottom: 8px;
    overflow: hidden;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.video-meta {
    font-size: 14px;
    color: #9ca3af;
    margin-bottom: 4px;
}

.result-card .download-btn {
    margin-top: 14px;
    padding: 12px 16px;
    font-size: 14px;
}

.features {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 30px;
    margin-top: 35px;
    color: #a4a5b5;
    font-size: 13px;
}

footer {
    text-align: center;
    color: #77798a;
    font-size: 12px;
    margin-top: 90px;
}

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

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: spin 0.8s ease infinite;
    margin-left: 8px;
    vertical-align: middle;
}

/* Mobile */
@media (max-width: 600px) {
    .navbar {
        padding: 20px;
    }

    .nav-label {
        font-size: 9px;
    }

    .container {
        padding: 55px 16px 25px;
    }

    .download-card {
        padding: 20px 16px;
    }

    .input-wrapper {
        flex-wrap: wrap;
    }

    input {
        width: 100%;
        flex-basis: 100%;
        padding: 14px 10px;
    }

    .paste-btn {
        width: 100%;
        padding: 12px;
    }

    .result-card {
        flex-direction: column;
        align-items: stretch;
        padding: 16px;
        gap: 16px;
    }

    .result-card img {
        width: 100%;
        height: 200px;
    }

    .features {
        flex-direction: column;
        gap: 15px;
    }

    footer {
        margin-top: 65px;
        line-height: 1.6;
    }
}


/* MediaFetch V1 — Instagram gradient theme */

body {
    background: linear-gradient(
        120deg,
        #7138ff 0%,
        #b52ad1 48%,
        #f12678 100%
    );
    background-attachment: fixed;
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont,
                 "Segoe UI", Arial, sans-serif;
}

.navbar {
    background: #fff;
    border-bottom: none;
    padding: 20px max(24px, calc((100% - 1100px) / 2));
}

.logo {
    color: #7138ff;
}

.logo span {
    color: #e82c88;
}

.nav-label {
    color: #666;
}

.container {
    padding-top: 85px;
}

.tag {
    color: #fff;
    opacity: 0.85;
}

h1 {
    font-size: clamp(38px, 6vw, 68px);
}

h1 span {
    color: #fff;
}

.subtitle {
    color: rgba(255,255,255,0.92);
    font-size: 17px;
    max-width: 650px;
}

.download-card {
    max-width: 760px;
    background: #fff;
    border: none;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 20px 60px rgba(50,0,90,0.15);
    color: #222;
}

.download-card label {
    font-weight: 600;
}

.input-wrapper {
    background: #f7f7fa;
    border: 1px solid #ddd;
}

.input-wrapper input {
    color: #222;
    font-size: 16px;
}

.input-wrapper input::placeholder {
    color: #888;
}

.paste-btn {
    background: #ededf4;
    color: #222;
}

.download-btn {
    background: #367bf5;
    color: #fff;
    min-height: 52px;
    border-radius: 10px;
    font-size: 16px;
}

.download-btn:hover {
    background: #2468dd;
}

.download-btn:disabled {
    opacity: 0.65;
    cursor: wait;
}

.message {
    color: #5a3ca0;
}

.features, footer {
    color: rgba(255,255,255,0.9);
}

.result-card {
    max-width: 760px;
    margin: 24px auto;
}

/* Mobile layout */
@media (max-width: 600px) {
    .navbar {
        padding: 16px 20px;
    }

    .container {
        padding: 55px 16px 24px;
    }

    .subtitle {
        font-size: 15px;
    }

    .download-card {
        padding: 18px;
    }

    .input-wrapper {
        flex-direction: column;
    }

    .input-wrapper input {
        width: 100%;
        min-height: 52px;
    }

    .paste-btn {
        width: 100%;
        min-height: 44px;
    }

    .download-btn {
        width: 100%;
        min-height: 54px;
    }
}

/* Carousel gallery */

.carousel-gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.carousel-item {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 16px;
    padding: 14px;
    min-width: 0;
}

.carousel-item img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border-radius: 12px;
}

.carousel-item-label {
    color: white;
    font-size: 15px;
    font-weight: 600;
    margin: 12px 0;
}

.carousel-download-btn {
    width: 100%;
    margin-top: 8px;
}

[hidden] {
    display: none !important;
}

@media (max-width: 600px) {
    .carousel-gallery {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}
