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

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

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

.insta-story-card {
    background: var(--is-bg, #09090b);
    border: 1px solid var(--is-border, rgba(255, 255, 255, 0.12));
    border-radius: var(--is-radius, 18px);
    padding: var(--is-padding, 32px);
    box-shadow: var(--is-shadow);
    backdrop-filter: blur(var(--is-blur, 16px));
    -webkit-backdrop-filter: blur(var(--is-blur, 16px));
    color: var(--is-text, #94a3b8);
    position: relative;
    overflow: hidden;
}

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

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

.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: isPulse 2s infinite;
}

@keyframes isPulse {
    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(--is-title, #ffffff);
    margin: 0 0 8px 0;
    line-height: 1.25;
}

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

.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;
}

.insta-input {
    width: 100%;
    background: var(--is-input-bg, rgba(255, 255, 255, 0.05));
    color: var(--is-input-text, #ffffff);
    border: 1.5px solid var(--is-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: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);
}

.insta-input-actions {
    position: absolute;
    right: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.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;
}

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

.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;
}

.insta-submit-btn {
    width: 100%;
    background: var(--is-btn-bg, linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%));
    color: var(--is-btn-text, #ffffff);
    border: none;
    border-radius: 12px;
    padding: 15px 24px;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 10px 25px rgba(236, 72, 153, 0.35);
    transition: all 0.25s ease;
}

.insta-submit-btn:hover:not(:disabled) {
    filter: brightness(1.12);
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(236, 72, 153, 0.45);
}

.insta-alert {
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 13px;
    margin-top: 18px;
    display: none;
}

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

.insta-results {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: none;
}

.insta-stories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.insta-story-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.insta-story-preview {
    position: relative;
    aspect-ratio: 9/16;
    background: #000;
    overflow: hidden;
}

.insta-story-preview video,
.insta-story-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.insta-story-actions {
    padding: 12px;
    background: rgba(0, 0, 0, 0.5);
}

.insta-story-dl-btn {
    width: 100%;
    background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
    color: #ffffff;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    display: block;
    transition: all 0.2s;
}

.insta-story-dl-btn:hover {
    filter: brightness(1.12);
    color: #ffffff;
}

.insta-theme-light {
    --is-bg: #ffffff;
    --is-border: #e2e8f0;
    --is-title: #0f172a;
    --is-text: #64748b;
    --is-input-bg: #f8fafc;
    --is-input-text: #0f172a;
}
