/* ==========================================================================
   Instagram Video & Reel Downloader - Ultra-Rich UI Design System
   Compatible with Gutenberg, Kadence, Elementor, and all WordPress Themes
   ========================================================================== */

:root {
    --iv-bg: #09090b;
    --iv-border: rgba(255, 255, 255, 0.12);
    --iv-radius: 18px;
    --iv-title: #ffffff;
    --iv-text: #94a3b8;
    --iv-input-bg: rgba(255, 255, 255, 0.05);
    --iv-input-text: #ffffff;
    --iv-btn-bg: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
    --iv-btn-text: #ffffff;
    --iv-max-width: 680px;
    --iv-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 30px rgba(236, 72, 153, 0.15);
    --iv-blur: 16px;
    --iv-padding: 32px;
}

.insta-video-wrapper {
    width: 100%;
    max-width: var(--iv-max-width, 680px);
    margin: 28px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    box-sizing: border-box;
    position: relative;
}

.insta-video-wrapper * {
    box-sizing: border-box;
}

/* Main Container Card */
.insta-video-card {
    background: var(--iv-bg, #09090b);
    border: 1px solid var(--iv-border, rgba(255, 255, 255, 0.12));
    border-radius: var(--iv-radius, 18px);
    padding: var(--iv-padding, 32px);
    box-shadow: var(--iv-shadow);
    backdrop-filter: blur(var(--iv-blur, 16px));
    -webkit-backdrop-filter: blur(var(--iv-blur, 16px));
    color: var(--iv-text, #94a3b8);
    position: relative;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.insta-video-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #ec4899, #8b5cf6, #06b6d4, #ec4899);
    background-size: 300% 100%;
    animation: ivGradientFlow 8s linear infinite;
}

@keyframes ivGradientFlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Header Elements */
.insta-header {
    text-align: center;
    margin-bottom: 24px;
}

.insta-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(236, 72, 153, 0.12);
    color: #f472b6;
    border: 1px solid rgba(236, 72, 153, 0.3);
    padding: 5px 14px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 12px;
    box-shadow: 0 0 15px rgba(236, 72, 153, 0.2);
}

.insta-badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ec4899;
    box-shadow: 0 0 8px #ec4899;
    animation: ivPulse 2s infinite;
}

@keyframes ivPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.8); }
}

.insta-title {
    font-size: clamp(22px, 4vw, 30px);
    font-weight: 900;
    color: var(--iv-title, #ffffff);
    margin: 0 0 8px 0;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.insta-subtitle {
    font-size: 14px;
    color: var(--iv-text, #94a3b8);
    margin: 0;
    line-height: 1.55;
}

/* Form & Input Group */
.insta-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.insta-input-box {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.insta-input-icon {
    position: absolute;
    left: 14px;
    color: #ec4899;
    display: flex;
    align-items: center;
    pointer-events: none;
    z-index: 2;
}

.insta-input {
    width: 100%;
    background: var(--iv-input-bg, rgba(255, 255, 255, 0.05));
    color: var(--iv-input-text, #ffffff);
    border: 1.5px solid var(--iv-border, rgba(255, 255, 255, 0.15));
    border-radius: 12px;
    padding: 15px 95px 15px 44px;
    font-size: 14px;
    outline: none;
    transition: all 0.25s ease;
}

.insta-input::placeholder {
    color: rgba(148, 163, 184, 0.6);
}

.insta-input:focus {
    border-color: #ec4899;
    box-shadow: 0 0 0 4px rgba(236, 72, 153, 0.25), 0 0 20px rgba(236, 72, 153, 0.15);
    background: rgba(255, 255, 255, 0.08);
}

/* Input Action Buttons: Paste & Clear */
.insta-input-actions {
    position: absolute;
    right: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 2;
}

.insta-paste-btn {
    background: rgba(236, 72, 153, 0.15);
    color: #f472b6;
    border: 1px solid rgba(236, 72, 153, 0.3);
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
}

.insta-paste-btn:hover {
    background: rgba(236, 72, 153, 0.3);
    color: #ffffff;
    transform: translateY(-1px);
}

.insta-clear-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    border: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.insta-clear-btn:hover {
    background: rgba(239, 68, 68, 0.25);
    color: #ef4444;
}

/* Submit Action Button */
.insta-submit-btn {
    width: 100%;
    background: #F9A8D4;
    color: #FFFFFF;
    border: none;
    border-radius: 12px;
    padding: 15px 24px;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.02em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    box-shadow: 0 10px 25px rgba(244, 114, 182, 0.25);
    transition: all 0.25s ease;
}

/* Hover */
.insta-submit-btn:hover:not(:disabled) {
    background: #707070;
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(244, 114, 182, 0.30);
}

/* Active / Click */
.insta-submit-btn:active:not(:disabled) {
    background: #d92b81;
    transform: translateY(0);
}

/* Disabled */
.insta-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.insta-spin {
    animation: ivSpin 0.9s linear infinite;
}
}

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

/* Status Alerts */
.insta-alert {
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 13px;
    margin-top: 18px;
    display: none;
    line-height: 1.5;
    animation: ivFadeIn 0.3s ease;
}

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

.insta-alert.error {
    display: block;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.insta-alert.success {
    display: block;
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #86efac;
}

/* Results & Media Display */
.insta-results {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: none;
    animation: ivFadeIn 0.4s ease;
}

.insta-media-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    margin-bottom: 20px;
}

.insta-media-preview {
    position: relative;
    width: 100%;
    max-height: 480px;
    background: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.insta-media-preview video,
.insta-media-preview img {
    max-width: 100%;
    max-height: 480px;
    object-fit: contain;
    display: block;
}

.insta-media-header-badges {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    gap: 8px;
    z-index: 10;
}

.insta-quality-badge {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    color: #f472b6;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.06em;
    border: 1px solid rgba(236, 72, 153, 0.3);
}

.insta-actions-row {
    padding: 16px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    background: rgba(0, 0, 0, 0.5);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.insta-dl-btn {
    flex: 1;
    min-width: 150px;
    padding: 12px 18px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 800;
    text-decoration: none;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.25s ease;
    cursor: pointer;
}

.insta-dl-video {
    background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
    color: #ffffff;
    box-shadow: 0 6px 18px rgba(236, 72, 153, 0.35);
}

.insta-dl-video:hover {
    filter: brightness(1.12);
    transform: translateY(-2px);
    color: #ffffff;
    box-shadow: 0 10px 25px rgba(236, 72, 153, 0.5);
}

.insta-dl-audio {
    background: rgba(255, 255, 255, 0.08);
    color: #f472b6;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.insta-dl-audio:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
    border-color: #ec4899;
    transform: translateY(-2px);
}

.insta-copy-link-btn {
    background: rgba(255, 255, 255, 0.05);
    color: #94a3b8;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 14px;
    border-radius: 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.insta-copy-link-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

/* Light Theme Preset */
.insta-theme-light {
    --iv-bg: #ffffff;
    --iv-border: #e2e8f0;
    --iv-title: #0f172a;
    --iv-text: #64748b;
    --iv-input-bg: #f8fafc;
    --iv-input-text: #0f172a;
    --iv-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

.insta-theme-light .insta-media-card {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.insta-theme-light .insta-actions-row {
    background: #f1f5f9;
    border-color: #e2e8f0;
}

.insta-theme-light .insta-dl-audio {
    background: #e2e8f0;
    color: #db2777;
    border-color: #cbd5e1;
}