/* ============================================================
   Instagram Profile Analytics — profile-analytics.css
   ============================================================ */

/* ── CSS Variables ── */
:root {
    --ig-grad: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
}

/* ── Base ── */
body {
    background: #f0f2f5;
    font-family: 'Inter', system-ui, sans-serif;
}

/* ── Page Container ── */
.ig-page-container {
    max-width: 1100px;
}

/* ── Profile Header Card ── */
.profile-header {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .07);
    padding: 28px 32px;
    margin-bottom: 20px;
}

.profile-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.profile-avatar {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 0 0 3px #e1e4e8, 0 4px 12px rgba(0, 0, 0, .15);
}

.ig-badge {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 26px;
    height: 26px;
    background: var(--ig-grad);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}

.ig-badge i {
    color: #fff;
    font-size: .65rem;
}

.profile-username {
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f1419;
    margin: 0 0 2px;
}

.profile-verified-icon {
    font-size: .9rem;
}

.profile-handle {
    color: #6c757d;
    font-size: .85rem;
    margin: 0 0 8px;
}

.profile-bio {
    color: #444;
    font-size: .85rem;
    line-height: 1.5;
    margin-bottom: 8px;
}

.profile-meta {
    color: #8899a6;
    font-size: .78rem;
}

/* ── Topic Badges ── */
.topic-badge {
    display: inline-block;
    background: #e8f0fe;
    color: #1a73e8;
    border: 1px solid #c5d8fd;
    border-radius: 20px;
    padding: 2px 10px;
    font-size: .72rem;
    font-weight: 500;
    margin: 2px 2px 0 0;
}

/* ── Stat Pills ── */
.stat-block {
    text-align: center;
    min-width: 90px;
}

.stat-block-eng {
    min-width: 110px;
}

.stat-number {
    font-size: 1.45rem;
    font-weight: 800;
    color: #0f1419;
    line-height: 1;
    letter-spacing: -.5px;
}

.stat-label {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: #8899a6;
    margin-top: 3px;
}

.stat-divider {
    width: 1px;
    background: #e9ecef;
    align-self: stretch;
    margin: 0 16px;
}

/* ── Engagement Bar ── */
.eng-bar-wrap {
    background: #f0f2f5;
    border-radius: 8px;
    height: 8px;
    overflow: hidden;
    margin: 6px 0 2px;
}

.eng-bar-fill {
    height: 8px;
    border-radius: 8px;
    background: linear-gradient(90deg, #4facfe, #00c6fb);
    /* width is set inline — dynamic PHP value */
}

.eng-label {
    font-size: .72rem;
    color: #6c757d;
}

/* ── Tab Card ── */
.tab-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .07);
    overflow: hidden;
}

.nav-tabs {
    border-bottom: 1px solid #f0f2f5;
    padding: 0 20px;
}

.nav-tabs .nav-link {
    border: none;
    color: #6c757d;
    font-weight: 500;
    padding: .85rem 1.25rem;
    border-bottom: 3px solid transparent;
    font-size: .9rem;
}

.nav-tabs .nav-link.active {
    color: #0d6efd;
    border-bottom: 3px solid #0d6efd;
    background: transparent;
}

.nav-tabs .nav-link:hover {
    border-bottom: 3px solid #dee2e6;
}

/* ── Tab Count Badge ── */
.tab-count-badge {
    font-size: .65rem;
    vertical-align: middle;
}

/* ── Section Label (h2 inside panes) ── */
.section-label {
    letter-spacing: .6px;
    font-size: .72rem;
}

/* ── Post Grid ── */
.post-thumb-wrap {
    position: relative;
    padding-top: 100%;
    overflow: hidden;
    background: #f0f2f5;
    border-radius: 10px 10px 0 0;
}

.post-thumb-wrap img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px 10px 0 0;
    transition: transform .25s ease;
}

.post-card:hover .post-thumb-wrap img {
    transform: scale(1.04);
}

.post-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, .08);
    overflow: hidden;
    transition: box-shadow .2s ease;
}

.post-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, .14);
}

.media-badge {
    position: absolute;
    top: 7px;
    right: 7px;
    font-size: .65rem;
    padding: 2px 7px;
    border-radius: 20px;
    font-weight: 600;
    letter-spacing: .3px;
}

/* ── Post Card Footer ── */
.post-card-footer {
    border-radius: 0 0 12px 12px;
}

.post-card-stats {
    font-size: .78rem;
    color: #6c757d;
}

.post-view-btn {
    background: #f0f2f5;
    color: #0f1419;
    font-size: .78rem;
    border-radius: 8px;
}

.post-view-btn:hover {
    background: #e2e5e9;
    color: #0f1419;
}

/* ── Empty State Icons ── */
.empty-state-icon {
    font-size: 3rem;
    opacity: .3;
}

/* ── Analytics Metrics ── */
.metric-card {
    background: #f8f9fb;
    border: none;
    border-radius: 12px;
    text-align: center;
    padding: 18px 10px;
}

.metric-val {
    font-size: 1.25rem;
    font-weight: 800;
    color: #0f1419;
    letter-spacing: -.3px;
}

.metric-lbl {
    font-size: .65rem;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: #8899a6;
    margin-top: 4px;
}

.metric-card.highlight {
    background: #e8f4ff;
}

.metric-card.highlight .metric-val {
    color: #0d6efd;
}

/* ── Responsive ── */
@media (max-width: 767px) {
    .profile-header {
        padding: 20px 16px;
    }

    .stat-number {
        font-size: 1.1rem;
    }

    .stat-divider {
        margin: 0 10px;
    }

    .profile-avatar {
        width: 68px;
        height: 68px;
    }
}

/* ── Search Bar ── */
.search-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 0 30px;
}

.filter-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-top: -30px;
    position: relative;
    z-index: 10;
}

.filter-header {
    font-size: 0.9rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 15px;
}

.advanced-toggle-btn {
    background: white;
    border: 2px solid #667eea;
    color: #667eea;
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 600;
    font-size: 0.95rem;
    width: 100%;
    transition: all 0.3s ease;
}

.advanced-toggle-btn:hover {
    background: #667eea;
    color: white;
}

.search-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 600;
    font-size: 0.95rem;
    width: 100%;
}

.search-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 0 30px;
}

.filter-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-top: -30px;
    position: relative;
    z-index: 10;
}

.filter-header {
    font-size: 0.9rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 15px;
}

.advanced-toggle-btn {
    background: white;
    border: 2px solid #667eea;
    color: #667eea;
    border-radius: 8px;
    height: 38px;
    padding: 0 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.95rem;
    width: 100%;
    transition: all 0.3s ease;
}

.advanced-toggle-btn:hover {
    background: #667eea;
    color: white;
}

.search-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    border-radius: 8px;
    height: 38px;
    padding: 0 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.95rem;
    width: 100%;
}

.select2-container--default .select2-selection--single {
    height: 38px;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 36px;
    color: #495057;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px;
}