/* =========================================
   TOOL HERO SECTION (Shared across all tool pages)
   ========================================= */

#tool-hero-section {
    /* background: linear-gradient(to right, #f83a5f, #ffc607); */
    background: linear-gradient(160deg, #E62E5C 0%, #FF7A47 50%, #FFB24A 100%);
    padding: 20px 8px 20px 8px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 0 0 16px 16px;
}

.hero-heading-h1 {
    color: white;
    font-size: 1.6rem;
    /* margin-bottom: 10px; */
    /* line-height: normal; */
    margin-bottom: 12px;
    line-height: 1.18;
    font-weight: 600 !important;
    letter-spacing: -0.01em;
}

.hero-para-tag {
    color: white;
    font-size: 0.95rem;
    margin-bottom: 16px;
    line-height: 1.55;
}

.hero-bottom-group {
    width: 100%;
}

/* Input Field and Paste Button (Mobile first design) */
.hero-input-group {
    position: relative;
    width: 100%;
    margin-bottom: 16px;
}

#url {
    width: 100%;
    height: 48px;
    border-radius: 7px;
    padding: 10px 20px;
    padding-right: 65px;
    /* Space for the paste button */
    font-size: 0.875rem;
    border: 1px solid transparent;
}

#url:focus {
    /* box-shadow: 0 0 3px 2px white; */
    box-shadow: 0 0 0 3px rgba(91, 42, 134, 0.25);
    outline: none;
    border: 1.5px solid #5B2A86;
}

/* Paste and Clear button inside input field */
#hero-pasteBtn,
#hero-clearBtn {
    position: absolute;
    right: 7px;
    top: 50%;
    transform: translateY(-50%);
    /* background-color: #ffdee8;
    color: #6e0012; */
    background-color: #F3F4F6;
    color: #5B5B6B;
    border: none;
    padding: 5px 10px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

#hero-pasteTxt,
#hero-clearTxt {
    display: none;
}

#hero-clearBtn {
    display: none;
    /* Clear button hidden by default */
}

/* Search button for mobile view */
#tool-trigger-Button {
    display: block;
    width: 100%;
    margin: 10px 0 10px 0;
    height: 48px;
    border-radius: 7px;
    background-color: #5B2A86;
    color: white;
    font-size: 1.2rem;
    border: none;
    cursor: pointer;
}

#tool-trigger-Button:disabled {
    background-color: #b3b3b3;
    cursor: not-allowed;
}

#tool-trigger-Button:hover:enabled {
    background-color: #4A2270;
}

#hero-pasteBtn:hover,
#hero-clearBtn:hover {
    /* background-color: #fec5d7; */
    background-color: #E5E7EB;
}

#hero-alert-row {
    margin-top: 10px;
}

#server-alert {
    display: none;
    /* Hidden by default */
    width: 90%;
    max-width: 500px;
    margin: 20px auto;
    padding: 15px 20px;
    text-align: center;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 255, 0.3), 0 0 20px rgba(0, 0, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #FF0000;
    font-size: 1rem;
    font-weight: bold;
}

/* SVG Loader (used on highlights-downloader page) */
#loader-section {
    display: none;
    text-align: center;
    margin-top: 20px;
    width: 100%;
}

.loader {
    margin: 20px auto;
    display: block;
}

.loader-text {
    font-size: 1.2rem;
    color: #333;
}

/* Larger screen (Tablet/Desktop) */
@media (min-width: 768px) {
    #tool-hero-section {
        padding: 40px 20px;
        border-radius: 20px;
        margin-left: 25px;
        margin-right: 25px;
    }

    .hero-heading-h1 {
        font-size: 2rem;
    }

    .hero-para-tag {
        font-size: 1.2rem;
    }

    .hero-bottom-group {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .hero-input-group {
        display: inline-flex;
        align-items: center;
        margin-right: 0;
        margin-bottom: 0;
        max-width: 500px;
    }

    #url {
        width: 100%;
        border-radius: 7px 0 0 7px;
        padding-right: 90px;
        font-size: 1rem;
    }

    #url:focus {
        border-right: none;
    }

    #hero-pasteBtn svg,
    #hero-clearBtn svg {
        margin-right: 5px;
    }

    #hero-pasteTxt,
    #hero-clearTxt {
        display: inline;
    }

    #tool-trigger-Button {
        width: auto;
        padding: 0 30px;
        border-radius: 0 7px 7px 0;
        margin: 0px;
        max-width: 500px;
        min-width: 201px;
    }

    #hero-alert-row {
        margin-top: 20px;
    }
}



/* ---------- 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-color: #f83a5f;
    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: #f83a5f;
    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 #e13d56;
}

/* 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-color: #f83a5f;
    color: #fff;
    padding: 10px;
    font-size: large;
    margin: 10px 30px 15px 30px;
    border-radius: 10px;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.story-download:hover {
    background-color: #c82c48;
}

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



/* =========================================
   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;
}

/* 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;
    }
}

#hero-alert-text {
    line-height: normal !important;
}