.ig-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    max-width: 100%;
    padding: 15px;
}

.ig-search {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
}

form.ig-search-form {
    display: flex;
    align-items: center;
    outline: none;
    color: #e6eef6;
    font-size: 1.02rem;
    padding: .6rem .8rem;
    max-width: 720px !important;
    margin: 1.5rem auto 0;
    position: relative;
    box-shadow: 0 8px 30px rgba(2, 6, 23, 0.6);
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
    border: 1px solid rgba(255, 255, 255, 0.03);
}

#ig-username {
    background: transparent !important;
    border: none;
    outline: none;
    color: #e6eef6;
    font-size: 1.02rem;
    padding: .6rem .8rem;
    flex: 1;
}

#ig-username:focus {
    outline: none;
    border-color: #a8a8a8;
}

#ig-search-btn {
    padding: 10px 19px;
    background: linear-gradient(135deg, #6D28D9, #3B82F6) !important;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

#ig-search-btn:hover {
    background: #0087e6;
}

#ig-search-btn:disabled {
    background: #b2dffc;
    cursor: not-allowed;
}

.ig-error {
    background: #fee;
    color: #c33;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid #c33;
    display: none;
}

.ig-profile-card {
    display: flex;
    gap: 20px;
    align-items: center;
    border: 1px solid #dbdbdb;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    background-color: white;
    flex-direction: column;
    width: 350px;
    margin: auto;
    border-radius: 10px;
    text-align: center;
}

.ig-profile-card h3,
.ig-profile-card p {
    color: #000 !important;
}

.ig-download-link {
    background: linear-gradient(135deg, #6a11cb, #2575fc);
    color: #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
    padding: 8px 20px;
    border-radius: 5px;
    margin-top: 18px;
    display: inline-block;
    text-decoration: none !important;
    transition: all ease 0.3s;
}

.ig-stats {
    padding: 3px;
    border: 1px solid #6931dc91;
    border-radius: 5px;
    background-color: white;
    box-shadow: rgb(104 48 219) 0px 2px 8px 0px;
}

.ig-download-link:hover {
    color: white;
    transform: scale(1.1);
}

.ig-profile-pic {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #efefef;
}

.ig-profile-info h3 {
    margin: 0 0 5px 0;
    color: #262626;
    font-size: 20px;
}

.ig-profile-info p {
    margin: 4px 0;
    color: #8e8e8e;
}

.ig-fullname {
    font-weight: 600;
    color: #262626 !important;
}

.ig-stats {
    font-weight: 600;
    color: #262626 !important;
    margin-top: 10px !important;
}

.ig-tabs {
    list-style: none;
    padding: 0;
    display: flex;
    gap: 0;
    margin-top: 50px !important;
    border-bottom: 1px solid #dbdbdb;
    justify-content: center;
}

.ig-tabs li {
    margin: 0;
}

.ig-tabs .ig-tab {
    padding: 12px 20px;
    display: inline-block;
    text-decoration: none;
    color: #8e8e8e;
    cursor: pointer;
    border-bottom: 1px solid transparent;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 1px;
    transition: color 0.2s;
}

.ig-tabs .ig-tab.active {
    color: #262626;
    border-color: #262626;
}

.ig-tabs .ig-tab:hover {
    color: #262626;
}

.ig-tab-content {
    margin-top: 20px;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px !important;
}

@media (max-width: 768px) {
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.ig-post-thumb {
    overflow: hidden;
    position: relative;
    cursor: pointer;
    background: #fafafa;
    display: flex;
    align-items: center;
    justify-content: end;
    aspect-ratio: 1 / 1;
    background-size: cover;
    background-position: center;
    border-radius: 4px;
    flex-direction: column;
    color: #fff !important;
    margin-bottom: 20px;
}

.ig-post-caption {
    padding: 0px 25px;
    width: 300px;
    text-align: center;
}

.ig-post-caption p {
    overflow: hidden;
    text-overflow: clip !important;
    display: -webkit-box !important;
    line-clamp: 3 !important;
    -webkit-line-clamp: 3 !important;
    -webkit-box-orient: vertical !important;
    color: white;
    font-weight: 700;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.8), 0 0 10px rgba(0, 0, 0, 0.6);
}

.ig-post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ig-thumb-video {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
}

.ig-video-icon {
    width: 30px;
    height: 30px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    position: relative;
}

.ig-video-icon:after {
    content: "";
    position: absolute;
    top: 50%;
    left: 55%;
    transform: translate(-50%, -50%);
    border-style: solid;
    border-width: 6px 0 6px 12px;
    border-color: transparent transparent transparent white;
}

.ig-carousel-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
}

.ig-carousel-indicator {
    width: 20px;
    height: 20px;
    display: block;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    position: relative;
}

.ig-carousel-indicator:after {
    content: "";
    position: absolute;
    top: 50%;
    left: 55%;
    transform: translate(-50%, -50%);
    border-style: solid;
    border-width: 4px 0 4px 8px;
    border-color: transparent transparent transparent white;
}

.stories-grid,
.highlights-grid {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.ig-story-thumb,
.ig-highlight-thumb {
    text-align: center;
    cursor: pointer;
    width: 80px;
}

.ig-story-thumb img,
.ig-highlight-thumb img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #e1306c;
}

.ig-story-date {
    font-size: 11px;
    color: #8e8e8e;
    margin-top: 5px;
}

.ig-hl-title {
    font-size: 12px;
    color: #262626;
    margin-top: 5px;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.ig-hl-count,
.ig-hl-date {
    font-size: 11px;
    color: #8e8e8e;
    margin-top: 2px;
}

.ig-loadmore {
    padding: 12px 20px;
    border-radius: 8px;
    border: 0;
    background: linear-gradient(135deg, #6D28D9, #3B82F6) !important;
    color: #fff;
    cursor: pointer;
    font-weight: 600;
    margin: 20px auto;
    display: block;
    transition: all ease 0.3s;
}

.ig-loadmore:hover {
    opacity: 0.9 !important;
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.18);
}

.ig-loadmore:disabled {
    background: #b2dffc;
    cursor: not-allowed;
}

.ig-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.ig-modal-inner {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    background: #111;
    padding: 20px;
    border-radius: 8px;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ig-modal-content {
    max-width: 100%;
    max-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ig-modal-img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 4px;
}

.ig-modal-video {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 4px;
}

.ig-modal-close,
.ig-modal-prev,
.ig-modal-next {
    position: absolute;
    background: rgba(0, 0, 0, 0.5);
    border: 0;
    color: #fff;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    z-index: 10;
    transition: background 0.2s;
}

.ig-modal-close:hover,
.ig-modal-prev:hover,
.ig-modal-next:hover {
    background: rgba(0, 0, 0, 0.7);
}

.ig-modal-close {
    top: 10px;
    right: 10px;
}

.ig-modal-prev {
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
}

.ig-modal-next {
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}

.ig-modal-caption {
    margin-top: 15px;
    color: #ddd;
    max-width: 90%;
    text-align: center;
    padding: 10px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    font-size: 14px;
}

.ig-modal-counter {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(0, 0, 0, 0.5);
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
}

/* Stories Modal */
.ig-stories-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

.ig-stories-modal-inner {
    position: relative;
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.ig-stories-progress-container {
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    display: flex;
    gap: 5px;
    z-index: 10002;
}

.ig-stories-progress {
    flex: 1;
    height: 3px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 3px;
    overflow: hidden;
}

.ig-stories-progress-bar {
    height: 100%;
    background: #fff;
    width: 0%;
    transition: width 0.1s linear;
}

.ig-stories-close {
    position: absolute;
    top: 25px;
    right: 25px;
    background: rgba(0, 0, 0, 0.5);
    border: 0;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10002;
    font-size: 20px;
    transition: background 0.2s;
}

.ig-stories-close:hover {
    background: rgba(0, 0, 0, 0.7);
}

.ig-stories-prev,
.ig-stories-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    border: 0;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10002;
    font-size: 24px;
    transition: background 0.2s;
}

.ig-stories-prev:hover,
.ig-stories-next:hover {
    background: rgba(0, 0, 0, 0.7);
}

.ig-stories-prev {
    left: 25px;
}

.ig-stories-next {
    right: 25px;
}

.ig-stories-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ig-stories-img,
.ig-stories-video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.ig-stories-username {
    position: absolute;
    top: 25px;
    left: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    z-index: 10002;
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 12px;
    border-radius: 20px;
}

.ig-stories-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
}

.ig-stories-username-text {
    font-weight: 600;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .ig-profile-card {
        flex-direction: column;
        text-align: center;
    }

    .ig-tabs .ig-tab {
        padding: 10px 12px;
        font-size: 11px;
    }

    .ig-modal-prev,
    .ig-modal-next {
        width: 35px;
        height: 35px;
    }

    .ig-stories-prev,
    .ig-stories-next {
        width: 35px;
        height: 35px;
    }
}

/* Loading state for highlights */
.ig-highlight-thumb.loading {
    opacity: 0.7;
    position: relative;
}

.ig-highlight-thumb.loading:after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0095f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Video error message */
.ig-video-error {
    padding: 20px;
    text-align: center;
    color: #fff;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 8px;
}

.ig-modal-content video {
    pointer-events: auto;
    z-index: 2;
}

.ig-modal-content {
    pointer-events: none;
    /* so wrapper doesn't block clicks */
}

.ig-modal-content>* {
    pointer-events: auto;
    /* but child (video or img) is clickable */
}

/* Video controls enhancement */
.ig-modal-video {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 4px;
    background: #000;
}

.ig-stories-video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    background: #000;
}

/* Modal controls */
.ig-modal-controls {
    position: absolute;
    bottom: 15px;
    right: 15px;
    display: flex;
    gap: 10px;
    z-index: 10;
}

.ig-modal-controls button {
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    padding:0 !important;
}

.ig-modal-controls button:hover {
    background: rgba(0, 0, 0, 0.7);
}

/* Stories controls */
.ig-stories-controls {
    position: absolute;
    bottom: 25px;
    right: 25px;
    display: flex;
    gap: 10px;
    z-index: 10002;
}

.ig-stories-controls button {
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    padding: 0 !important;
    font-size: 60px !important;
}

.ig-stories-controls button:hover {
    background: rgba(0, 0, 0, 0.7);
}

/* Loading state for highlights */
.ig-highlight-thumb.loading {
    opacity: 0.7;
    position: relative;
}

.ig-highlight-thumb.loading:after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0095f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Fullscreen styles */
:-webkit-full-screen .ig-modal-content {
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

:-webkit-full-screen .ig-modal-video,
:-webkit-full-screen .ig-modal-img {
    max-width: 100vw;
    max-height: 100vh;
    width: auto;
    height: auto;
}

:-ms-fullscreen .ig-modal-content {
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

:-ms-fullscreen .ig-modal-video,
:-ms-fullscreen .ig-modal-img {
    max-width: 100vw;
    max-height: 100vh;
    width: auto;
    height: auto;
}

:fullscreen .ig-modal-content {
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

:fullscreen .ig-modal-video,
:fullscreen .ig-modal-img {
    max-width: 100vw;
    max-height: 100vh;
    width: auto;
    height: auto;
}

/* Download button styles for stories modal */
.ig-stories-controls {
    position: absolute;
    bottom: 25px;
    right: 25px;
    display: flex;
    gap: 10px;
    z-index: 10002;
}

.ig-stories-download {
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
}

.ig-stories-download:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

.ig-stories-download:active {
    transform: scale(0.95);
}

/* Download button styles for post modal */
.ig-modal-controls {
    position: absolute;
    bottom: 15px;
    right: 15px;
    display: flex;
    gap: 10px;
    z-index: 10;
}

.ig-modal-download {
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
}

.ig-modal-download:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

.ig-modal-download:active {
    transform: scale(0.95);
}

/* Download confirmation message */
.ig-download-confirmation {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    z-index: 10003;
    animation: fadeInOut 2s ease-in-out;
}

@keyframes fadeInOut {
    0% {
        opacity: 0;
    }

    20% {
        opacity: 1;
    }

    80% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

/* Comments Section */
.ig-modal-comments {
    margin-top: 15px;
    border-top: 1px solid #e1e1e1;
    padding-top: 10px;
    max-height: 300px;
    /* adjust height as needed */
    overflow-y: auto;
    font-family: Arial, sans-serif;
    background: #fafafa;
    border-radius: 8px;
}

.ig-comments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 10px;
    font-weight: bold;
    font-size: 14px;
    color: #333;
    border-bottom: 1px solid #ddd;
}

.ig-comments-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

.ig-comments-load-more {
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 12px;
    cursor: pointer;
}

.ig-comments-list {
    padding: 10px;
}

.ig-comment {
    display: flex;
    align-items: flex-start;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
}

.ig-comment:last-child {
    border-bottom: none;
}

.ig-comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 8px;
    flex-shrink: 0;
}

.ig-comment-content {
    flex: 1;
}

.ig-comment-header {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #555;
    margin-bottom: 2px;
}

.ig-comment-username {
    font-weight: 600;
    color: #333;
    margin-right: 5px;
}

.ig-comment-date {
    color: #999;
    font-size: 10px;
}

.ig-comment-text {
    font-size: 13px;
    color: #444;
    line-height: 1.3;
}

.ig-comments-loading {
    font-size: 13px;
    text-align: center;
    padding: 8px;
    color: #666;
}

.ig-no-comments {
    text-align: center;
    font-size: 13px;
    color: #999;
    padding: 10px 0;
}

/* open story from profile*/
.ig-profile-pic-wrapper {
    display: inline-block;
    border-radius: 50%;
    padding: 3px;
}

.ig-profile-pic-wrapper.ig-has-stories {
    border: 3px solid #28a745;
    /* green ring */
    cursor: pointer;
    transition: transform 0.2s ease;
}

.ig-profile-pic-wrapper.ig-has-stories:hover {
    transform: scale(1.05);
}

.ig-profile-pic {
    border-radius: 50%;
    width: 80px;
    height: 80px;
    object-fit: cover;
}

/* Loade */
#loader {
    display: none;
    position: fixed;
    top: 27%;
    left: 50%;
    transform: translate(-50%, -73%);
    z-index: 9999;
}

#loader p {
    font-size: 24px;
    color: White;
    letter-spacing: 2px;
}

#loader:before {
    content: '';
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 2s linear infinite;
    display: block !important;
}

/* Tabs container */
/* Tabs container */
.ig-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    list-style: none;
    padding: 0.5rem;
    margin-top: 50px !important;
    border-radius: 12px;
    background: #141d28 !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
    text-decoration: none !important;
}

/* Individual tabs */
.ig-tabs .ig-tab {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: #d1d5db;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(8px);
}

/* Hover effect */
.ig-tabs .ig-tab:hover {
    color: #fff;
    background: linear-gradient(135deg, #3a7bd5, #3a6073);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

/* Active tab */
.ig-tabs .ig-tab.active {
    color: #fff;
    background: linear-gradient(135deg, #6a11cb, #2575fc);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
}

.ig-tabs li a {
    text-decoration: none !important;
}

.btn.show-comments-btn {
    color: white;
    background: linear-gradient(135deg, #6a11cb, #2575fc) !important;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}