/* ─── Reset ──────────────────────────────────────────────────────────────── */
.ivd-form-block *,
.ivd-wrap * {
    box-sizing: border-box;
}
h1.ivd-page-title {
    display: none !important;
}
.ivd-form-block,
.ivd-wrap {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

/* ─── Hero / Form block ──────────────────────────────────────────────────── */
.ivd-form-block {
    background: linear-gradient(to top right, #2563eb, #db2777, #dc2626);
    padding: 30px 0 40px;
}
.ivd-form-block__wrapper {
    margin: 0 auto;
    max-width: 984px;
    padding: 0 20px;
}

/* ─── Tab bar ────────────────────────────────────────────────────────────── */
.ivd-pageTunerWrapper {
    align-items: center;
    display: flex;
    flex-direction: column;
    margin: 0 0 24px;
}
.ivd-pageTunerWrapper__items {
    background: hsla(0, 0%, 100%, .24);
    border-radius: 6px;
    display: flex;
}
.ivd-pageTunerWrapper__item {
    cursor: pointer;
    user-select: none;
}
.ivd-pageTunerWrapper__item p {
    align-items: center;
    display: flex;
    gap: 6px;
    margin: 0 auto;
    padding: 8px 18px;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    transition: background .2s;
    border-right: 1px solid rgba(255, 255, 255, .18);
}
.ivd-pageTunerWrapper__item:last-child p {
    border-right: none;
}
.ivd-pageTunerWrapper__item:hover p {
    background: rgba(255, 255, 255, .15);
}
.ivd-pageTunerWrapper__item.active p {
    background: rgba(255, 255, 255, .28);
    border-radius: 4px;
}
.ivd-pageTunerWrapper__item p span {
    color: #fff;
}

/* ─── Tab panels ─────────────────────────────────────────────────────────── */
.ivd-tab-panel {
    display: none;
}
.ivd-tab-panel.active {
    display: block;
}
.ivd-form-block__content {
    margin: 0 auto 24px;
    text-align: center;
}
.ivd-form-block__content-title {
    color: #fff;
    font-size: 36px;
    font-weight: 700;
    line-height: 44px;
    margin: 0 auto 10px;
}
.ivd-form-block__content-subtitle {
    color: rgba(255, 255, 255, .9);
    font-size: 18px;
    font-weight: 400;
    line-height: 28px;
    margin: 0 auto;
}

/* ─── Search form ────────────────────────────────────────────────────────── */
.ivd-search-form {
    max-width: 672px;
    display: grid;
    grid-template-columns: 1fr max-content;
    gap: 6px;
    background: #fff;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, .1), 0 1px 2px -1px rgba(0, 0, 0, .1);
    border-radius: 8px;
    padding: 8px;
    margin: 0 auto;
}
.ivd-search-form__field {
    display: grid;
    grid-template-columns: 1fr max-content;
    gap: 2px;
}
.ivd-search-form__label {
    display: flex;
    width: 100%;
}
.ivd-search-form__input {
    width: 100%;
    border: none;
    outline: none;
    font-size: 17px;
    font-weight: 400;
    color: #000;
    padding: 0 14px;
    background: transparent;
}
.ivd-search-form__input::placeholder {
    color: #bbb;
    font-size: 17px;
}
.ivd-search-form__clipboard {
    display: flex;
}
.ivd-search-form__clipboard button {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    font-size: 15px;
    font-weight: 500;
    color: #000;
    border-radius: 8px;
    border: 2px solid #E5E7EB;
    background: #F3F4F6;
    cursor: pointer;
    padding: 14px 12px;
    transition: background .15s;
    white-space: nowrap;
}
.ivd-search-form__clipboard button:hover {
    background: rgba(243, 244, 246, .7);
}
.ivd-search-form__button {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    border: none;
    border-radius: 8px;
    background: linear-gradient(315deg, #60A5FA 0%, #2563EB 100%);
    cursor: pointer;
    padding: 0 24px;
    transition: background .15s;
    white-space: nowrap;
}
.ivd-search-form__button:hover {
    background: linear-gradient(to top left, #60a5fa, #dc2626);
}
.ivd-search-form__button:disabled {
    opacity: .65;
    cursor: not-allowed;
}

/* ─── Alerts ─────────────────────────────────────────────────────────────── */
.ivd-alert-area {
    max-width: 672px;
    margin: 0 auto;
}
.ivd-alert {
    margin-top: 16px;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
}
.ivd-alert-error   { background: rgba(254, 226, 226, .95); color: #7f1d1d; border-left: 4px solid #ef4444; }
.ivd-alert-success { background: rgba(209, 250, 229, .95); color: #14532d; border-left: 4px solid #22c55e; }

/* ─── Loading state ──────────────────────────────────────────────────────── */
.ivd-data-fetching {
    text-align: center;
    padding: 28px 16px 10px;
    max-width: 672px;
    margin: 0 auto;
}
.ivd-loader-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.ivd-loader-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    animation: ivd-bounce 1.3s ease-in-out infinite;
}
.ivd-loader-dot:nth-child(1) { background: #bfdbfe; animation-delay: 0s; }
.ivd-loader-dot:nth-child(2) { background: #60a5fa; animation-delay: .2s; }
.ivd-loader-dot:nth-child(3) { background: #2563eb; animation-delay: .4s; }
@keyframes ivd-bounce {
    0%, 100% { transform: scale(.75); opacity: .5; }
    50%       { transform: scale(1.25); opacity: 1; }
}
.ivd-loader-text {
    color: rgba(255, 255, 255, .92);
    font-size: 15px;
    font-weight: 500;
    margin: 0;
}

/* ─── Results area ───────────────────────────────────────────────────────── */
.ivd-results-area {
    max-width: 60em;
    margin: 20px auto 0;
    text-align: center;
}
.ivd-result-heading {
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    margin: 0 0 14px;
    text-shadow: 0 1px 6px rgba(0, 0, 0, .18);
}
.ivd-result-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, .18);
    max-width: 360px;
    margin: 0 auto 18px;
}
.ivd-result-media {
    line-height: 0;
}
.ivd-result-media video,
.ivd-result-media img {
    width: 100%;
    display: block;
    max-height: 480px;
    object-fit: cover;
}

/* ─── Download button ────────────────────────────────────────────────────── */
.ivd-video-download-btn {
    display: block;
    width: 100%;
    background: linear-gradient(315deg, #60A5FA 0%, #2563EB 100%);
    border-radius: 0;
    color: #fff !important;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    padding: 16px 32px;
    text-decoration: none;
    text-align: center;
    transition: background .2s;
    border: none;
}
.ivd-video-download-btn:hover {
    background: linear-gradient(to top left, #60a5fa, #dc2626);
    color: #fff !important;
}
.ivd-video-download-btn:disabled {
    opacity: .65;
    cursor: not-allowed;
}
.ivd-down-loader {
    font-size: 13px;
    font-weight: 400;
    opacity: .8;
}

/* ─── Admin cards ────────────────────────────────────────────────────────── */
.ivd-body { padding: 26px 20px 12px; }
.ivd-settings-card {
    background: #fff;
    border: 1px solid #ebebeb;
    border-radius: 12px;
    padding: 22px 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, .05);
}
.ivd-settings-card h3 {
    font-size: .9rem;
    font-weight: 800;
    color: #1a1a2e;
    margin: 0 0 14px;
    display: flex;
    align-items: center;
    gap: 7px;
}
.ivd-api-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 20px;
    margin-left: 6px;
}
.ivd-badge-on  { background: #dcfce7; color: #15803d; }
.ivd-badge-off { background: #fee2e2; color: #b91c1c; }
.ivd-fields { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 14px; }
.ivd-field label { display: block; font-size: 12px; font-weight: 700; color: #555; margin-bottom: 4px; }
.ivd-field input {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid #ddd;
    border-radius: 7px;
    font-size: 13px;
    color: #333;
    transition: border-color .15s;
}
.ivd-field input:focus {
    border-color: #2563eb;
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .14);
}
.ivd-settings-save {
    background: linear-gradient(90deg, #2563eb, #db2777);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 22px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity .15s;
}
.ivd-settings-save:hover { opacity: .88; }
.ivd-api-hint {
    background: #eff6ff;
    border-left: 4px solid #2563eb;
    border-radius: 0 7px 7px 0;
    padding: 10px 12px;
    font-size: 12px;
    color: #1d4ed8;
    line-height: 1.6;
    margin-top: 12px;
}
.ivd-shortcode-wrap {
    background: #f7f7f7;
    border: 1.5px dashed #ccc;
    border-radius: 7px;
    padding: 10px 14px;
    font-family: monospace;
    font-size: 14px;
    color: #333;
    margin-top: 8px;
    word-break: break-all;
}
.ivd-note { font-size: 12px; color: #888; margin-top: 6px; }

/* ─── Mobile ─────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .ivd-search-form {
        grid-template-columns: 1fr;
        gap: 12px;
        background: transparent;
        box-shadow: none;
        padding: 0;
    }
    .ivd-search-form__field {
        background: #fff;
        border-radius: 8px;
        padding: 4px;
    }
    .ivd-search-form__input {
        padding: 14px;
        border-radius: 8px 0 0 8px;
        font-size: 16px;
    }
    .ivd-search-form__input::placeholder {
        font-size: 16px;
    }
    .ivd-search-form__clipboard button {
        border-radius: 0 8px 8px 0;
        border-left: none;
    }
    .ivd-search-form__button {
        padding: 16px 20px;
        border-radius: 8px;
        width: 100%;
        font-size: 17px;
    }
    .ivd-form-block__content-title {
        font-size: 26px;
        line-height: 34px;
    }
    .ivd-form-block__content-subtitle {
        font-size: 15px;
    }
    .ivd-pageTunerWrapper__item p span {
        display: none;
    }
    .ivd-pageTunerWrapper__item p {
        padding: 10px 12px;
    }
    .ivd-result-card {
        max-width: 100%;
    }
    .ivd-result-media video,
    .ivd-result-media img {
        max-height: 360px;
    }
    .ivd-body { padding: 16px 12px; }
    .ivd-settings-card { padding: 16px 14px; }
}
