/* ---------- Instagram user Profile Section ---------------- */

.profile-img-container {
    position: relative;
    display: inline-block;
    padding: 3px;
    border-radius: 50%;
    background: transparent;
}

/* Instagram Gradient Ring for Active Story */
.has-story {
    background: conic-gradient(from 0deg,
            #f58529, #dd2a7b, #8134af, #515bd4, #405de6, #5851db, #833ab4, #c13584, #e1306c, #fd1d1d, #f56040, #f58529);

    padding: 3px;
}

/* Profile Picture Style */
.profile-img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #fff;
    /* White border to create gap between image and gradient */
    cursor: pointer;
}

.profile-pic-enlarge {
    position: absolute;
    bottom: 0;
    right: 0;
    background-color: white;
    border-radius: 50%;
    padding: 5px;
    border: 2px solid #ddd;
    cursor: pointer;
    transition: transform 0.3s ease, background-color 0.3s ease;
    /* Smooth hover effect */
    transform-origin: center;
    /* Ensure scaling happens from the center */

    display: flex;
    /* Use flexbox for centering */
    align-items: center;
    /* Center the content vertically */
    justify-content: center;
    /* Center the content horizontally */
}

.profile-pic-enlarge:hover {
    transform: scale(1.2);
    /* Increase size on hover */
    background-color: #f0f0f0;
    /* Slight color change on hover */
}

.profile-pic-enlarge svg {
    width: 24px;
    /* Adjust size to match the icon’s proportions */
    height: 24px;
    margin: 0;
    /* Remove any margin or padding */
    vertical-align: middle;
    /* Align the SVG properly */
}

/* Username and Verified Icon */
.username {
    margin-top: 10px;
    font-weight: bold;
    font-size: 1.2rem;
}

.verified-icon {
    width: 20px;
    height: 20px;
    margin-left: 5px;
    vertical-align: middle;
    position: relative;
    top: -2px;
    display: inline-block;
}

/* Full Name Style */
.full-name {
    color: #666;
    font-size: 1.5rem;
    margin-top: 10px;
}

/* Stats Section */
.stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    font-weight: bold;
}

.stats .stat-text {
    font-weight: 500;
    font-size: 0.9rem;
    color: #888;
}

/* Bio Section */
.bio {
    margin-top: 10px;
    text-align: left;
    font-size: 1rem;
}


/* Popup Styles */
.dp-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.dp-popup-content {
    border-radius: 10px;
    text-align: center;
    position: relative;
    width: 100%;
    animation: popup-fade-in 0.3s ease-out;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 90vh;
    padding: 10px;
}

@keyframes popup-fade-in {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.dp-popup-content img {
    width: auto;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 10px;
    margin-bottom: 10px;
}

.dp-popup-download-button {
    background: var(--iz-gradient-main);
    color: white;
    padding: 12px 40px;
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease;
    margin-top: 15px;
    font-size: 16px;
    line-height: 1;
}

.dp-popup-download-button svg {
    margin-right: 5px;
}

.dp-popup-download-button:hover {
    background-color: #c82c48;
}

/* Close Button Styles */
.close-dp-popup {
    position: absolute;
    top: -10px;
    /* Positioned closer to the image */
    right: 10px;
    cursor: pointer;
    background: none;
    border: none;
    z-index: 1001;
}

.close-dp-popup svg {
    width: 24px;
    height: 24px;
    fill: #fff;
}






/* ---------- Instagram Stories List Display Section ---------------- */

/* Stories Tab styling */
.stories-tab {
    background: #E1306C;
    color: #fff;
    text-align: center;
    padding: 10px 20px;
    font-size: 24px;
    font-weight: bold;
    margin: 20px auto;
    width: 90%;
    max-width: 500px;
    border-radius: 0;
    box-shadow: none;
    border-bottom: 3px solid #c72957;
}

/* Stories Grid */
.stories-grid {
    display: grid;
    gap: 20px;
    padding: 20px;
    grid-template-columns: 1fr;
}

/* Story Card */
.story-card {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    position: relative;
}

.media-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    aspect-ratio: 9 / 16;
}

.media-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../assets/medialoader.gif');
    background-repeat: no-repeat;
    background-position: center;
}

/* Video wrapper */
.video-wrapper {
    position: relative;
    /* Reference point for the video-play-icon */
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
}


.story-thumbnail {
    position: absolute;
    /* Aligns with placeholder */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 10px;
    object-fit: cover;
    z-index: 1;
    /* Ensure it is above the placeholder */
}

.story-video {
    width: 100%;
    border-radius: 10px;
    object-fit: cover;
    display: block;
}


/* Video play icon */
.video-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.6);
    padding: 10px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 1;
    /* Ensure it is above the video */
}

.video-play-icon:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

/* Upload time section */
.story-upload-time {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin: 10px 30px 0 0;
    color: #333;
    font-size: 16px;
}

.story-upload-time svg {
    margin-right: 5px;
    width: 20px;
    height: 20px;
}

/* Download Button */
.story-download {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #E1306C 0%, #9333EA 100%);
    color: #fff;
    padding: 10px;
    font-size: large;
    margin: 10px 30px 15px 30px;
    border-radius: 10px;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 10px rgba(225, 48, 108, 0.25);
}

.story-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(225, 48, 108, 0.35);
}

.story-download svg {
    margin-right: 5px;
}

/* Top-right icon styling */
.top-right-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 20%;
    padding: 5px;
    display: flex;
    /* Enable flexbox */
    justify-content: center;
    /* Center horizontally */
    align-items: center;
    cursor: pointer;
    transition: transform 0.3s ease;
    z-index: 2;
}

.top-right-icon svg {
    width: 30px;
    height: 30px;
    fill: #fff;
    /* White color to make it stand out on the dark background */
}

.top-right-icon:hover {
    transform: scale(1.1);
    /* Scale up on hover */
    background-color: rgba(0, 0, 0, 0.7);
}

.no-stories-message {
    text-align: center;
    padding: 15px;
    font-size: 18px;
    color: #666;
    border: 1.5px solid #FF0000;
    border-radius: 8px;
    margin: 20px auto;
    width: 90%;
    max-width: 500px;
    background-color: #f9f9f9;
}

.story-download-text {
    color: #fff;
}


/* ---------- Instagram Stories Viewing Overlay Section ---------------- */

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease-in-out, visibility 0s 0.3s;
}

.overlay.visible {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
}





/* Overlay Top Section */
.overlay-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0px 20px;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    background: transparent;
}

/* User Info Section */
.user-info-story-overlay {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-profile-img-story-overlay {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.user-details-story-overlay {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 5px;
}

.username-story-overlay {
    font-size: 14px;
    font-weight: bold;
    color: #fff;
}

/* .verified-icon-story-overlay{
    transform: translateY(2px);
} */

.verified-icon-story-overlay img {
    width: 14px;
    height: 14px;
}


.upload-time-overlay {
    font-size: 14px;
    color: #ccc;
    margin-left: 10px;
}

/* Close Button */
.close-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
}







/* Progress Bars Section */

.progress-bars {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 4px;
    margin: 0px auto;
    width: 100%;
    max-width: 500px;
    padding: 0 10px;
}

.progress-bars div {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 2px;
    transition: all 0.3s ease-in-out;
}

.progress-bars .active {
    background: #fff;
}





/* Media Section */
.story-media {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
    max-width: 500px;
    margin: 8px auto 0;
    overflow: hidden;
}

#media-container-story-overlay {
    width: 100%;
    height: 100%;

    display: flex;
    justify-content: center;
    align-items: flex-start;
}

#media-container-story-overlay img,
#media-container-story-overlay video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    /* Maintain aspect ratio and ensure full visibility */
    object-position: center;
}

/* Download Button */
.download-btn-story-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    /* Enable flexbox */
    align-items: center;
    /* Vertically center the content */
    justify-content: center;
    /* Horizontally center the content */
    padding: 8px;
    border-radius: 50%;
    z-index: 2;
    cursor: pointer;
    text-decoration: none;
}

.download-btn-story-overlay:hover {
    background-color: rgba(0, 0, 0, 0.7);
}


.download-btn-story-overlay svg {
    fill: #fff;
    width: 24px;
    height: 24px;
    margin: 0;
    /* Remove potential margins */
    vertical-align: middle;
    /* Ensure vertical alignment */
}

/* Navigation Buttons */
.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    /* Ensure content inside button is centered */
    align-items: center;
    /* Vertically center */
    justify-content: center;
    /* Horizontally center */
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: #fff;
    font-size: 20px;
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 2;
}

.nav-btn:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

.nav-btn svg {
    width: 20px;
    /* Ensure consistent width */
    height: 20px;
    /* Ensure consistent height */
    transform: none;
    /* Remove any translation applied */
    margin: 0;
    /* Remove potential margins applied by WordPress styles */
    vertical-align: middle;
    /* Ensure proper vertical alignment */
}

.nav-btn.left {
    left: 2px;
}

.nav-btn.right {
    right: 2px;
}



@media (min-width: 768px) {

    /* ---------- Instagram user Profile Section ---------------- */
    .bio {
        text-align: center;
    }

    .dp-popup-content {
        max-width: 90%;
        width: 400px;
        padding: 20px;
    }

    .dp-popup-content img {
        max-height: 70vh;
        margin-bottom: 20px;
        max-width: 100%;
    }

    .dp-popup-download-button {
        padding: 12px 40px;
        font-size: 16px;
    }


    /* ---------- Stories Section ---------------- */

    .stories-grid {
        grid-template-columns: repeat(2, 1fr);
        max-width: min(70vw, 1200px);
        margin: 0 auto;
    }
}



@media (min-width: 1080px) {
    /* ---------- Stories Section ---------------- */

    .stories-grid {
        grid-template-columns: repeat(3, 1fr);
        max-width: min(70vw, 1200px);
        margin: 0 auto;
    }
}


/* =========================================
   PROFILE VIEWER SECTION
   ========================================= */

/* Overall Result Container (Below Hero) */
#profile-result {
    width: 100%;
    max-width: 800px;
    margin: 15px auto 15px;
    /* Overlap hero slightly */
    padding: 0 7px;
    position: relative;
    z-index: 20;
}

/* Skeleton Loader Container */
#skeleton-loader {
    width: 100%;
    max-width: 800px;
    margin: 15px auto 15px;
    padding: 0 20px;
    position: relative;
    z-index: 20;
}

/* Skeleton Card */
.iz-profile-skeleton-card {
    background: #fff;
    border-radius: var(--iz-border-radius);
    padding: 20px;
    width: 100%;
    box-shadow: var(--iz-card-shadow);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.iz-profile-sk-pulse {
    animation: izProfilePulse 1.5s infinite ease-in-out;
    background: #e5e7eb;
    border-radius: 8px;
}

.iz-profile-sk-img {
    width: 100%;
    padding-top: 100%;
    /* Square aspect ratio */
    border-radius: 12px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    background: #f3f4f6;
}

.iz-profile-sk-text-center {
    height: 24px;
    width: 50%;
    margin: 0 auto 20px;
}

.iz-profile-sk-grid {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.iz-profile-sk-col {
    height: 40px;
    flex: 1;
}

.iz-profile-sk-line {
    height: 16px;
    width: 100%;
    margin-bottom: 10px;
}

.iz-profile-sk-line.short {
    width: 60%;
}

.iz-profile-sk-btn {
    height: 50px;
    width: 100%;
    margin-top: 20px;
    border-radius: 12px;
}

@keyframes izProfilePulse {
    0% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.6;
    }
}

/* Profile Result Card */
.iz-profile-result-card {
    background: #fff;
    border-radius: var(--iz-border-radius);
    box-shadow: var(--iz-card-shadow);
    border: 1px solid rgba(0, 0, 0, 0.06);
    overflow: hidden;
    animation: izProfileSlideUp 0.5s ease-out forwards;
    text-align: left;
    width: 100%;
}

@keyframes izProfileSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Profile Image Area */
.iz-profile-image-container {
    position: relative;
    background: #f3f4f6;
    width: 100%;
    padding-top: 100%;
    /* 1:1 Aspect Ratio */
    overflow: hidden;
    cursor: pointer;
}

.iz-profile-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.iz-profile-image-container:hover .iz-profile-img {
    transform: scale(1.03);
}

/* Overlay Buttons (Corner positioned) */
.iz-profile-overlay-btn {
    position: absolute;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(4px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    border: none;
    transition: 0.2s;
    color: #333;
    z-index: 10;
    padding: 0 !important;
}

.iz-profile-overlay-btn:hover {
    transform: scale(1.1);
    color: var(--iz-primary);
    background: #fff;
}

.iz-profile-overlay-btn svg {
    width: 22px;
    height: 22px;
}

.iz-profile-btn-dl-float {
    top: 12px;
    right: 12px;
}

.iz-profile-btn-expand {
    bottom: 12px;
    right: 12px;
}

/* Spinner for Image Loading */
.iz-profile-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--iz-primary);
    border-radius: 50%;
    animation: izProfileSpin 1s linear infinite;
    z-index: 5;
    display: none;
}

.iz-profile-spinner.is-active {
    display: block;
}

@keyframes izProfileSpin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Profile Info Section */
.iz-profile-info {
    padding: 24px;
    text-align: center;
}

.iz-profile-username-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 20px;
}

.iz-profile-username {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--iz-text-main);
}

.iz-profile-verified-badge {
    color: #1DA1F2;
    width: 22px;
    height: 22px;
    display: none;
}

.iz-profile-verified-badge.is-active {
    display: block;
}

/* Stats Grid */
.iz-profile-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    border-top: 1px solid #f3f4f6;
    border-bottom: 1px solid #f3f4f6;
    padding: 15px 0;
    margin-bottom: 20px;
}

.iz-profile-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    border-right: 1px solid #f3f4f6;
}

.iz-profile-stat-item:last-child {
    border-right: none;
}

.iz-profile-stat-num {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--iz-text-main);
}

.iz-profile-stat-label {
    font-size: 0.75rem;
    color: var(--iz-text-sub);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

/* Bio Section */
.iz-profile-bio-section {
    margin-bottom: 24px;
    text-align: left;
}

.iz-profile-real-name {
    font-weight: 700;
    color: #374151;
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.iz-profile-bio-text {
    font-size: 0.95rem;
    color: #6b7280;
    line-height: 1.5;
    white-space: pre-line;
}

/* Action Buttons */
.iz-profile-actions-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.iz-profile-btn-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    border: none;
}

.iz-profile-btn-action svg {
    width: 20px;
    height: 20px;
}

/* Primary Download Button */
.iz-profile-btn-primary {
    background: var(--iz-gradient-main);
    color: #fff;
    box-shadow: 0 4px 10px rgba(225, 48, 108, 0.25);
}

.iz-profile-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(225, 48, 108, 0.35);
    color: #fff;
}

/* Secondary Zoom Button */
.iz-profile-btn-secondary {
    background: #fff;
    color: var(--iz-secondary);
    border: 2px solid #e9d5ff;
}

.iz-profile-btn-secondary:hover {
    background: #faf5ff;
    border-color: var(--iz-secondary);
    color: var(--iz-secondary);
}

/* Tertiary Stories Button (Full Width) */
.iz-profile-btn-tertiary {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.95rem;
    background: #fff;
    color: var(--iz-primary);
    border: 2px solid #f3f4f6;
    cursor: pointer;
}

.iz-profile-btn-tertiary:hover {
    background: #f9fafb;
    border-color: var(--iz-primary);
    color: var(--iz-primary);
}

.iz-profile-btn-tertiary svg {
    width: 20px;
    height: 20px;
}

/* View Stories Button - Disabled State */
.iz-profile-btn-tertiary:disabled {
    background: #f3f4f6;
    color: #9ca3af;
    border-color: #e5e7eb;
    cursor: not-allowed;
    opacity: 0.6;
}

.iz-profile-btn-tertiary:disabled:hover {
    background: #f3f4f6;
    border-color: #e5e7eb;
    transform: none;
}

/* =========================================
   STORIES SKELETON LOADER (Instagram Style)
   ========================================= */

/* Stories Skeleton Container */
#stories-skeleton-loader {
    width: 100%;
    max-width: 500px;
    margin: 20px auto;
    padding: 0 20px;
    display: none;
}

#stories-skeleton-loader.is-visible {
    display: block;
}

/* Shared class for all pulsing skeleton elements */
.iz-stories-skeleton-pulse {
    background-color: #e5e7eb;
    animation: izStoriesPulse 1.5s infinite ease-in-out;
}

/* ============ TOP BAR (User Info) ============ */

.iz-stories-sk-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding-top: 10px;
}

/* Left side: Profile + Name */
.iz-stories-sk-user-info {
    display: flex;
    align-items: center;
}

/* Profile Image: 32px circle */
.iz-stories-sk-profile-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Text Container */
.iz-stories-sk-details {
    display: flex;
    flex-direction: column;
    margin-left: 10px;
    justify-content: center;
    height: 32px;
    /* Matches profile img height for vertical centering */
}

/* Username + Badge Row */
.iz-stories-sk-name-row {
    display: flex;
    align-items: center;
}

/* Username: 80px x 14px */
.iz-stories-sk-username {
    width: 80px;
    height: 14px;
    border-radius: 4px;
}

/* Verified Badge: 14px circle, 5px gap */
.iz-stories-sk-verified {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    margin-left: 5px;
}

/* Menu Icon (Right Side) */
.iz-stories-sk-menu {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

/* ============ PROGRESS BARS ============ */

.iz-stories-sk-progress {
    display: flex;
    width: 100%;
    gap: 8px;
    margin-top: 12px;
    margin-bottom: 8px;
}

.iz-stories-sk-progress-bar {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background-color: rgba(229, 231, 235, 0.8);
}

/* ============ SINGLE STORY ============ */

.iz-stories-sk-story {
    width: 100%;
    aspect-ratio: 9 / 16;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    position: relative;
}

.iz-stories-sk-media {
    width: 100%;
    height: 100%;
    display: block;
}

/* Pulse Animation */
@keyframes izStoriesPulse {
    0% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.6;
    }
}

/* =========================================
   PROFILE MODAL (Fullscreen View)
   ========================================= */

.iz-profile-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 2px;
}

.iz-profile-modal.is-open {
    display: flex;
    opacity: 1;
}

.iz-profile-modal-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    width: fit-content;
    max-width: 100%;
    max-height: 100vh;
}

/* Modal Header */
.iz-profile-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 5px;
    color: #fff;
    width: 100%;
}

.iz-profile-modal-user {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1.1rem;
}

.iz-profile-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
    padding: 0px !important;
}

.iz-profile-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.iz-profile-modal-close svg {
    width: 24px;
    height: 24px;
}

/* Modal Body */
.iz-profile-modal-body {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 8px;
}

.iz-profile-modal-img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    display: block;
}

/* Modal Footer */
.iz-profile-modal-footer {
    padding: 15px 5px;
    display: flex;
    justify-content: center;
}

.iz-profile-modal-btn {
    background: var(--iz-gradient-main);
    color: #fff;
    padding: 12px 40px;
    border-radius: 30px;
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    transition: 0.2s;
    width: 100%;
    justify-content: center;
}

.iz-profile-modal-btn:hover {
    transform: scale(1.02);
    color: #fff;
}

.iz-profile-modal-btn svg {
    width: 20px;
    height: 20px;
}

/* =========================================
   RESPONSIVE ADJUSTMENTS - PROFILE
   ========================================= */

@media (min-width: 768px) {

    /* Desktop Profile Card - Constrained Width */
    #profile-result,
    #skeleton-loader {
        max-width: 600px;
        margin-top: 20px;
    }

    .iz-profile-modal-img {
        max-height: 80vh;
    }

    .iz-profile-modal-btn {
        width: auto;
    }

    /* Desktop - Show buttons side by side */
    .iz-profile-actions-row {
        grid-template-columns: 1fr 1fr;
    }
}


/* ===============================================================================
   HERO SECTION - PROFILE VIEWER TEMPLATE (InstaZoom Design)
   =============================================================================== */

/* ---------- 1. CORE VARIABLES & RESET ---------------- */
:root {
    /* Brand Colors: Pink-Purple Scheme */
    --iz-primary: #E1306C;
    /* Primary Pink */
    --iz-secondary: #9333EA;
    /* Secondary Purple */

    /* Backgrounds */
    --iz-bg-hero: #f8f9fa;
    /* Light Gray Neutral Background */
    --iz-bg-card: #ffffff;
    /* Pure White for Cards */
    --iz-bg-history: #fafafa;
    /* Very light gray for history inner */

    /* Accent Color (Solid - used for Borders) */
    --iz-accent-solid: #E1306C;

    /* Gradients */
    /* Main Gradient: Pink -> Purple */
    --iz-gradient-main: linear-gradient(135deg, #E1306C 0%, #9333EA 100%);

    /* Hero Background: Professional Neutral Fade (White -> Light Gray) */
    --iz-gradient-hero-bg: linear-gradient(to bottom, #ffffff 0%, #f3f4f6 100%);

    /* Bottom Boundary Fade */
    --iz-gradient-bottom: linear-gradient(to top, #f3f4f6 0%, rgba(243, 244, 246, 0) 100%);

    /* Text & UI */
    --iz-text-main: #111827;
    /* Nearly Black */
    --iz-text-sub: #4b5563;
    /* Slate Gray */
    --iz-card-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
    --iz-border-radius: 16px;

    /* Focus Ring (Purple tint to match end of gradient) */
    --iz-focus-ring: rgba(147, 51, 234, 0.15);
}

/* Scoped Reset for the Tool Area */
.iz-wrapper,
.iz-wrapper * {
    box-sizing: border-box;
}

.iz-wrapper *::before,
.iz-wrapper *::after {
    box-sizing: border-box;
}


/* ---------- 2. HERO SECTION LAYOUT ---------------- */
.iz-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    position: relative;
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
    /* Top Gradient Background: Neutral Professional Look */
    background: var(--iz-gradient-hero-bg);
    padding: 40px 20px 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* Bottom Gradient Boundary */
.iz-wrapper::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: var(--iz-gradient-bottom);
    pointer-events: none;
    z-index: 0;
}

.iz-container {
    width: 100%;
    max-width: 800px;
    position: relative;
    z-index: 10;
}


/* ---------- 3. TYPOGRAPHY & SEO ---------------- */
.iz-title {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--iz-text-main);
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
    margin-top: 0;
}

/* InstaZoom brand text in gradient color */
.iz-brand-text {
    background: var(--iz-gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

.iz-subtitle {
    font-size: 1.1rem;
    color: var(--iz-text-sub);
    line-height: 1.6;
    margin-bottom: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.iz-subtitle strong {
    color: var(--iz-primary);
    font-weight: 600;
}


/* ---------- 4. MAIN TOOL CARD ---------------- */
.iz-card {
    background: var(--iz-bg-card);
    border-radius: var(--iz-border-radius);
    box-shadow: var(--iz-card-shadow);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.06);
    /* Border Top: Solid Pink Accent */
    border-top: 4px solid var(--iz-accent-solid);
    margin-bottom: 20px;
    width: 100%;
}

.iz-card-body {
    padding: 20px 20px;
}


/* ---------- 5. INPUT AREA ---------------- */
.iz-input-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 16px;
    text-align: left;
}

.iz-input-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 10px;
    margin-left: 2px;
}

.iz-label-icon {
    width: 18px;
    height: 18px;
}

/* This applies the SVG gradient ID we added in HTML Step 1 */
.iz-label-icon path {
    fill: url(#brand-gradient);
}

.iz-input {
    width: 100%;
    height: 60px;
    padding: 0 110px 0 20px !important;
    /* Room for icons */
    border: 2px solid #e5e7eb !important;
    border-radius: 12px !important;
    font-size: 16px;
    color: var(--iz-text-main) !important;
    outline: none;
    background: #fff !important;
    transition: all 0.2s ease;
    appearance: none !important;
}

.iz-input:focus {
    border-color: var(--iz-secondary) !important;
    box-shadow: 0 0 0 4px var(--iz-focus-ring) !important;
}

.iz-input::placeholder {
    color: #9ca3af;
}



/* ---------- 6. INPUT TOOLS (Paste/history - Fixed Alignment) ---------------- */
.iz-input-tools {
    position: absolute;
    right: 12px;

    /* FIX: We anchor to the bottom because the Input is always at the bottom. */
    /* Input Height (60px) - Button Height (36px) = 24px space. */
    /* 24px / 2 = 12px bottom spacing for perfect center. */
    bottom: 12px;
    top: auto;
    transform: none;

    display: flex;
    gap: 8px;
    z-index: 5;
    /* Ensures buttons stay on top of text */
}

.iz-tool-icon {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #6b7280;
    transition: 0.2s;
    padding: 0;
}

.iz-tool-icon:hover {
    background: #faf5ff;
    color: var(--iz-secondary);
    border-color: #d8b4fe;
}

/* Ensure SVGs inside buttons scale correctly */
.iz-tool-icon svg {
    width: 18px;
    height: 18px;
}

/* Specific fix for filled SVGs (Paste & Clear) */
#iz-btn-paste svg path,
#iz-btn-clear-input svg path {
    fill: currentColor;
}

/* Hidden class for toggling */
.iz-hidden {
    display: none !important;
}


/* ---------- 7. SUBMIT BUTTON ---------------- */
.iz-btn-submit {
    width: 100%;
    height: 60px;
    background: var(--iz-gradient-main);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(147, 51, 234, 0.25);
    transition: transform 0.1s, box-shadow 0.2s;
}


.iz-btn-submit:hover {
    box-shadow: 0 8px 16px rgba(147, 51, 234, 0.35) !important;
    transform: translateY(-2px);
    background: var(--iz-gradient-main) !important;
    color: #fff !important;
    border: none !important;
}

.iz-btn-submit:active {
    transform: translateY(0);
    background: var(--iz-gradient-main) !important;
    color: #fff !important;
    border: none !important;
}

.iz-btn-submit:focus {
    outline: none !important;
    background: var(--iz-gradient-main) !important;
    color: #fff !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(147, 51, 234, 0.25) !important;
}

/* New Card Footer Styles */
.iz-card-footer {
    background-color: #fafafa;
    border-top: 1px solid #f3f4f6;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    border-bottom-left-radius: 16px;
    /* Matches card radius */
    border-bottom-right-radius: 16px;
}

.iz-feature {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #4b5563;
    letter-spacing: 0.01em;
}

.iz-feature svg {
    width: 18px;
    height: 18px;
    color: #9333EA;
    /* Fallback purple if variable fails */
    color: var(--iz-secondary);
    opacity: 0.9;
}

/* ---------- 8. HISTORY CARD ---------------- */
.iz-history-card {
    background: var(--iz-bg-card);
    border-radius: var(--iz-border-radius);
    border: 1px solid rgba(0, 0, 0, 0.06);
    /* Border Top: Solid Pink Accent */
    border-top: 2px solid var(--iz-accent-solid);
    box-shadow: var(--iz-card-shadow);
    overflow: hidden;
    margin-top: 0;
    display: none;
    /* Hidden by default */
    animation: izSlideDown 0.3s ease-out forwards;
    position: relative;
    width: 100%;
}

.iz-history-card.is-visible {
    display: block;
}

@keyframes izSlideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ---------- 9. HISTORY HEADER ---------------- */
.iz-history-header {
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f3f4f6;
    flex-wrap: wrap;
    gap: 10px;
    background: var(--iz-bg-history);
}


/* ---------- 10. TOGGLE SWITCH DESIGN ---------------- */
.iz-toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--iz-text-sub);
    cursor: pointer;
}

.iz-switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.iz-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.iz-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .4s;
    border-radius: 34px;
}

.iz-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.iz-switch input:checked+.iz-slider {
    background: var(--iz-gradient-main);
}

.iz-switch input:checked+.iz-slider:before {
    transform: translateX(20px);
}


/* ---------- 11. CLEAR HISTORY BUTTON ---------------- */
.iz-btn-clear {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    color: #ef4444;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 14px;
    border-radius: 8px;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
}

.iz-btn-clear:hover {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}


/* ---------- 12. HISTORY LIST (Horizontal Tags) ---------------- */
.iz-history-list {
    list-style: none;
    padding: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    background: #fff;
    min-height: 60px;
    margin: 0;
}


/* ---------- 13. INDIVIDUAL HISTORY TAG ---------------- */
.iz-history-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid #e5e7eb;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.iz-history-tag:hover {
    border-color: var(--iz-secondary);
    color: var(--iz-secondary);
    background: #faf5ff;
}

/* Tag Icon (@) */
.iz-tag-icon {
    font-size: 12px;
    color: var(--iz-secondary);
    opacity: 0.8;
    font-weight: bold;
}

/* Delete X Button */
.iz-tag-delete {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #f3f4f6;
    color: #9ca3af;
    margin-left: 4px;
    font-size: 12px;
    transition: 0.2s;
}

.iz-tag-delete:hover {
    background: #ef4444;
    color: #fff;
}


/* ---------- 14. LOADER SECTION VISIBILITY ANIMATIONS ---------------- */
/* #profile-result,
#stories-container {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s, transform 0.3s;
}

#profile-result.visible,
#stories-container.visible {
    opacity: 1;
    transform: translateY(0);
} */


/* ---------- 15. RESPONSIVE DESIGN (Tablet & Desktop) ---------------- */
@media (min-width: 768px) {
    .iz-wrapper {
        padding-top: 60px;
        padding-bottom: 100px;
    }

    .iz-title {
        font-size: 2rem;
        margin-bottom: 20px;
    }

    .iz-subtitle {
        font-size: 1.2rem;
    }

    .iz-card-body form {
        display: flex;
        flex-direction: row;
        gap: 12px;
        flex-wrap: wrap !important;
        align-items: flex-end !important;
    }

    .iz-input-wrapper {
        margin-bottom: 0;
        width: auto !important;
        flex-basis: auto !important;
        flex-grow: 1 !important;
    }

    .iz-btn-submit {
        width: auto;
        min-width: 225px;
        margin-top: 0;
    }


    .iz-error-inline {
        width: 100% !important;
        flex-basis: 100% !important;
        margin-top: 15px !important;
        order: 99 !important;
        /* Forces it to the very end */
    }
}


/* Large Desktops (1080px+) */
@media (min-width: 1080px) {
    .iz-container {
        max-width: 900px;
    }
}


/* === ERROR SECTIONS STYLES === */

:root {
    /* Error Variables */
    --iz-error-bg: #fff1f2;
    --iz-error-text: #be123c;
    --iz-error-border: #fda4af;
}

/* 1. User Input Error (Inline) */
.iz-error-inline {
    background-color: var(--iz-error-bg);
    border: 1px solid var(--iz-error-border);
    color: var(--iz-error-text);
    padding: 12px 16px;
    border-radius: 12px;
    margin-top: 16px;
    display: none;
    /* Hidden by default */
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    text-align: left;
    animation: izSlideDownFade 0.3s ease-out forwards;
}

.iz-error-inline.is-visible {
    display: flex;
}

.iz-error-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: var(--iz-error-text);
}

/* Input Error State Style */
.iz-input.iz-input-error-state {
    border-color: var(--iz-error-text) !important;
    background: #fffafa !important;
}

/* 2. Server/Result Error (Section) */
.iz-error-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(225, 48, 108, 0.15);
    padding: 20px 24px;
    margin: 15px 10px;
    width: 95%;
    display: none;
    /* Hidden by default */
    animation: izSlideUp 0.5s ease-out forwards;
    position: relative;
    overflow: hidden;
}

.iz-error-card.is-visible {
    display: block;
}

/* Decorative gradient line on left */
.iz-error-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background: linear-gradient(135deg, #E1306C 0%, #9333EA 100%);
}

.iz-error-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.iz-error-icon-large {
    width: 28px;
    height: 28px;
    color: var(--iz-primary);
    flex-shrink: 0;
}

.iz-error-text {
    font-size: 1.1rem;
    color: var(--iz-text-main);
    font-weight: 500;
    text-align: left;
}

/* Animations */
@keyframes izSlideDownFade {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes izSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Button Loading State */
.iz-btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.iz-btn-submit.is-loading {
    position: relative;
}

.iz-btn-submit.is-loading::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: izButtonSpin 0.8s linear infinite;
    right: 20px;
}

@keyframes izButtonSpin {
    to {
        transform: rotate(360deg);
    }
}