/* ================================================
   IG Premium Downloader V2 — Vibrant Light Theme
   Prefix: igp2-
   ================================================ */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

.igp2-wrapper,
.igp2-wrapper *,
.igp2-wrapper *::before,
.igp2-wrapper *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.igp-hidden {
    display: none !important;
}

.igp2-wrapper {
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: 15px;
    background: transparent;
    color: #0f172a;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    max-width: 900px;
    margin: 0 auto;
}

/* -------- AD ZONES -------- */
.igp2-ad-zone {
    background: #ffffff;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    margin: 20px;
    padding: 10px;
    text-align: center;
    position: relative;
    min-height: 90px;
    /* standard ad banner height */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.igp2-ad-label {
    font-size: 10px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
    display: block;
}

.igp2-ad-content {
    width: 100%;
    overflow: hidden;
}

/* -------- HERO SECTION -------- */
.igp2-search-section {
    max-width: 800px;
    margin: 20px auto 40px auto;
}

.igp2-search-container {
    background: #ffffff;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    padding: 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    position: relative;
    transition: border-color 0.2s;
}

.igp2-search-container:focus-within {
    border-color: #8b5cf6;
}

.igp2-search-input-wrapper {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 6px;
}

.igp2-search-icon {
    font-size: 20px;
    color: #111827;
    margin-left: 12px;
    margin-right: 10px;
}

.igp2-search-input {
    flex: 1;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 16px;
    color: #1f2937;
    background: transparent;
    padding: 12px 0;
}

.igp2-search-input::placeholder {
    color: #9ca3af;
}

.igp2-search-btn {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    border: none;
    color: #ffffff;
    border-radius: 4px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

.igp2-search-btn:hover {
    opacity: 0.9;
}

/* -------- LOADERS & ERRORS -------- */
.igp2-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 25px;
    color: #6366f1;
    font-weight: 600;
    font-size: 15px;
}

.igp2-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(99, 102, 241, 0.2);
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: igp2Spin 1s linear infinite;
}

@keyframes igp2Spin {
    to {
        transform: rotate(360deg);
    }
}

.igp2-error {
    background: #fee2e2;
    color: #b91c1c;
    padding: 12px 20px;
    border-radius: 12px;
    margin-top: 20px;
    font-weight: 500;
    font-size: 14px;
    border: 1px solid #fecaca;
}

/* -------- RESULTS AREA -------- */
.igp2-results {
    background: #ffffff;
    padding: 30px;
}

/* Profile Card */
.igp2-profile-card {
    background: #ffffff;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    padding: 24px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
}

.igp2-profile-header {
    display: flex;
    gap: 24px;
    align-items: center;
}

.igp2-avatar-container {
    position: relative;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    flex-shrink: 0;
    cursor: pointer;
    background: linear-gradient(135deg, #f09433, #dc2743, #833ab4);
    padding: 4px;
}

.igp2-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #ffffff;
}

.igp2-avatar-overlay {
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.2s;
}

.igp2-avatar-container:hover .igp2-avatar-overlay {
    opacity: 1;
}

.igp2-profile-details {
    flex: 1;
}

.igp2-username-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.igp2-username {
    font-size: 24px;
    font-weight: 800;
    color: #0f172a;
}

.igp2-verified {
    color: #3b82f6;
    font-size: 18px;
}

.igp2-fullname {
    font-size: 15px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
}

.igp2-bio {
    font-size: 14px;
    color: #475569;
    line-height: 1.6;
    margin-bottom: 16px;
    white-space: pre-line;
}

.igp2-bio a {
    color: #6366f1;
    text-decoration: none;
    font-weight: 500;
}

.igp2-bio a:hover {
    text-decoration: underline;
}

.igp2-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #10b981;
    background: #ecfdf5;
    padding: 6px 12px;
    border-radius: 8px;
    text-decoration: none;
    margin-bottom: 16px;
    transition: background 0.2s;
}

.igp2-link:hover {
    background: #d1fae5;
}

.igp2-stats-row {
    display: flex;
    gap: 20px;
    background: #f8fafc;
    padding: 12px 20px;
    border-radius: 12px;
    border: 1px solid #f1f5f9;
}

.igp2-stat-box {
    display: flex;
    flex-direction: column;
}

.igp2-stat-val {
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
}

.igp2-stat-lbl {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
}

/* Tabs */
.igp2-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.igp2-tab {
    background: #f1f5f9;
    border: 1px solid transparent;
    color: #64748b;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    white-space: nowrap;
}

.igp2-tab:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.igp2-tab.active {
    background: #4f46e5;
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
}

/* Tab Content */
.igp2-tab-content {
    min-height: 200px;
}

/* Media Grid */
.igp2-media-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.igp2-grid-item {
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    background: #f1f5f9;
}

.igp2-stories-grid .igp2-grid-item,
.igp2-reels-grid .igp2-grid-item {
    aspect-ratio: 9/16;
}

.igp2-grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.igp2-grid-item:hover img {
    transform: scale(1.05);
}

.igp2-grid-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.igp2-grid-item:hover .igp2-grid-overlay {
    opacity: 1;
}

.igp2-grid-stats {
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    display: flex;
    gap: 12px;
}

.igp2-play-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

/* Toolbar & Buttons */
.igp2-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 16px;
}

.igp2-btn-primary {
    background: #6366f1;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-family: inherit;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

.igp2-btn-primary:hover {
    background: #4f46e5;
}

.igp2-btn-secondary {
    background: #e2e8f0;
    color: #475569;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-family: inherit;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

.igp2-btn-secondary:hover {
    background: #cbd5e1;
}

/* Load More */
.igp2-load-more,
.igp2-loading-text {
    text-align: center;
    padding: 30px;
    color: #64748b;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.igp2-spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(99, 102, 241, 0.2);
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: igp2Spin 1s linear infinite;
}

/* Highlights Tray */
.igp2-highlights-tray {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 15px;
}

.igp2-hl-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    flex-shrink: 0;
}

.igp2-hl-ring {
    width: 75px;
    height: 75px;
    border-radius: 50%;
    border: 2px solid #e2e8f0;
    padding: 3px;
    transition: border-color 0.2s;
}

.igp2-hl-item:hover .igp2-hl-ring {
    border-color: #6366f1;
}

.igp2-hl-ring img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.igp2-hl-title {
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    max-width: 75px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
}

/* Isolated Grid */
.igp2-isolated {
    padding: 30px;
    background: #fff;
}

.igp2-isolated-title {
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 24px;
}

/* Single View */
.igp2-single-view {
    padding: 30px;
    background: #fff;
}

.igp2-back-btn {
    background: #f1f5f9;
    border: none;
    color: #475569;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    margin-bottom: 20px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.igp2-back-btn:hover {
    background: #e2e8f0;
}

.igp2-single-card {
    max-width: 500px;
    margin: 0 auto;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.igp2-single-media-wrapper {
    background: #000;
    position: relative;
}

.igp2-single-media-wrapper img,
.igp2-single-media-wrapper video {
    width: 100%;
    display: block;
    max-height: 600px;
    object-fit: contain;
}

.igp2-single-meta {
    padding: 20px;
}

.igp2-single-author {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.igp2-single-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.igp2-single-username {
    font-weight: 700;
    color: #0f172a;
    font-size: 16px;
}

.igp2-single-caption {
    font-size: 14px;
    color: #475569;
    margin-bottom: 16px;
    line-height: 1.5;
}

.igp2-single-stats {
    font-size: 15px;
    font-weight: 700;
    color: #ef4444;
    margin-bottom: 16px;
}

.igp2-btn-download-large {
    width: 100%;
    background: #6366f1;
    color: #fff;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-family: inherit;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s;
}

.igp2-btn-download-large:hover {
    background: #4f46e5;
}

/* Modals */
.igp2-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s;
}

.igp2-modal-overlay.visible {
    opacity: 1;
}

.igp2-modal-content {
    background: #ffffff;
    border-radius: 20px;
    position: relative;
    max-width: 900px;
    width: 100%;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.igp2-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #f1f5f9;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #64748b;
    z-index: 10;
    transition: background 0.2s;
}

.igp2-close-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.igp2-dp-modal {
    max-width: 400px;
    text-align: center;
    padding: 30px;
}

.igp2-dp-modal img {
    width: 100%;
    border-radius: 50%;
    margin-bottom: 20px;
    border: 4px solid #f8fafc;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.igp2-post-modal {
    display: flex;
    max-height: 85vh;
}

.igp2-post-modal-media {
    flex: 2;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.igp2-post-modal-media img,
.igp2-post-modal-media video {
    max-width: 100%;
    max-height: 100%;
}

.igp2-post-modal-sidebar {
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    border-left: 1px solid #e2e8f0;
    background: #fff;
}

.igp2-sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
}

.igp2-sidebar-header img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.igp2-sidebar-body {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
    font-size: 14px;
    color: #475569;
    line-height: 1.5;
}

.igp2-sidebar-footer {
    padding: 20px;
    border-top: 1px solid #e2e8f0;
}

.igp2-post-stats {
    font-weight: 700;
    color: #ef4444;
    margin-bottom: 15px;
}

.igp2-sidebar-footer button {
    width: 100%;
}

.igp2-progress-modal {
    max-width: 350px;
    text-align: center;
    padding: 30px;
}

.igp2-progress-modal h3 {
    font-weight: 800;
    margin-bottom: 20px;
}

.igp2-progress-circle-wrap {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
}

.igp2-progress-circle-wrap svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.igp2-progress-bg {
    fill: none;
    stroke: #f1f5f9;
    stroke-width: 8;
}

.igp2-progress-fill {
    fill: none;
    stroke: #6366f1;
    stroke-width: 8;
    stroke-dasharray: 339.292;
    stroke-dashoffset: 339.292;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.3s;
}

#igp-downloadProgressText {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 20px;
    color: #0f172a;
}

#igp-downloadStatusText {
    font-weight: 600;
    color: #475569;
    margin-bottom: 5px;
}

#igp-downloadSubText {
    font-size: 13px;
    color: #94a3b8;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .igp2-profile-header {
        flex-direction: column;
        text-align: center;
    }

    .igp2-stats-row {
        justify-content: center;
    }

    .igp2-post-modal {
        flex-direction: column;
    }

    .igp2-post-modal-media {
        min-height: 300px;
    }
}