/* User Profile Page Styles - Professional Native App Design */

/* ====================================
   COLOR VARIABLES & BASE STYLING
   ==================================== */
:root {
    --bg-primary: #0f0f0f;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #252525;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --border-color: #333333;
    --primary-color: #8240FF;
    --secondary-color: #8b5cf6;
    --accent-color: #a855f7;
    --primary-gradient: linear-gradient(135deg, #8240FF 0%, #9d5cff 50%, #b87dff 100%);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.7);
}

/* ====================================
   PROFILE CONTAINER
   ==================================== */
.profile-container {
    max-width: 100vw;
    margin: 0;
    padding: 0;
    background: var(--bg-primary);
    min-height: 100vh;
}

/* Ensure body has dark background */
body:has(.profile-container) {
    background-color: var(--bg-primary) !important;
}

/* ====================================
   PROFILE HEADER SECTION
   ==================================== */
.profile-header {
    position: relative;
    background: var(--primary-gradient);
    color: white;
    padding: 0;
    margin: 0;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.profile-cover {
    position: relative;
    height: 35vh;
    min-height: 280px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.profile-cover::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(255,255,255,0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255,255,255,0.05) 0%, transparent 50%);
    z-index: 1;
}

.profile-cover::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%),
        linear-gradient(135deg, transparent 30%, rgba(255,255,255,0.05) 50%, transparent 70%);
    animation: shimmerBg 6s ease-in-out infinite;
    z-index: 1;
}

@keyframes shimmerBg {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

.profile-avatar-container {
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 10px 25px rgba(0, 0, 0, 0.3));
    animation: avatarFloat 3s ease-in-out infinite;
}

@keyframes avatarFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 5px solid white;
    object-fit: cover;
    object-position: top;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
    cursor: pointer;
}

.profile-avatar:hover {
    transform: scale(1.08);
}

.profile-avatar-overlay {
    position: absolute;
    bottom: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    padding: 8px 10px;
    color: white;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.profile-avatar-overlay:hover {
    background: rgba(0, 0, 0, 0.8);
}

/* Show overlay on hover of avatar container */
.profile-avatar-container:hover .profile-avatar-overlay.d-none {
    display: flex !important;
}

.profile-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.3) 60%, transparent 100%);
    padding: 80px 20px 30px;
    text-align: center;
    z-index: 2;
}

.profile-name {
    font-size: 2rem;
    font-weight: 800;
    margin: 15px 0 10px;
    text-shadow: 0 3px 8px rgba(0,0,0,0.4);
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Creator Badge Icon */
.creator-badge-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #8240FF 0%, #6a30d9 100%);
    color: #fff;
    font-size: 0.55em;
    padding: 4px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(130, 64, 255, 0.4);
}

/* Verified Badge Icon */
.verified-badge-icon {
    display: inline-flex;
    align-items: center;
    color: #1DA1F2;
    font-size: 0.6em;
}

.profile-intro {
    font-size: 0.95rem;
    opacity: 0.95;
    margin: 0 0 10px;
    line-height: 1.5;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* ====================================
   STATS SECTION
   ==================================== */
.profile-stats {
    display: flex;
    padding: 30px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    gap: 0;
}

.stat-item {
    flex: 1;
    text-align: center;
    position: relative;
    padding: 0 20px;
}

.stat-item:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 50%;
    background: var(--border-color);
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: block;
    margin-bottom: 6px;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ====================================
   ACTION BUTTONS
   ==================================== */
.profile-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    padding: 25px 20px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.action-btn {
    flex: 1;
    max-width: 200px;
    padding: 13px 24px;
    border-radius: 28px;
    font-weight: 700;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.95rem;
    min-height: 48px;
}

.action-btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.3);
}

.action-btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.4);
    color: white;
}

.action-btn-primary:active {
    transform: translateY(-1px);
}

.action-btn-secondary {
    background: var(--bg-secondary);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    font-weight: 600;
}

.action-btn-secondary:hover {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.3);
}

/* Premium action button */
.action-btn-premium {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #1a1a2e;
    font-weight: 700;
}

.action-btn-premium:hover {
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
    transform: translateY(-2px);
    color: #1a1a2e;
}

/* Success action button (Earnings) */
.action-btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    font-weight: 600;
}

.action-btn-success:hover {
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
    transform: translateY(-2px);
    color: white;
}

/* Info action button (Analytics) */
.action-btn-info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    font-weight: 600;
}

.action-btn-info:hover {
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
    transform: translateY(-2px);
    color: white;
}

/* Creator quick actions container */
.creator-quick-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.creator-quick-actions .action-btn {
    min-width: auto;
    padding: 12px 16px;
}

@media (max-width: 768px) {
    .creator-quick-actions {
        gap: 8px;
    }
    
    .creator-quick-actions .action-btn {
        padding: 10px 14px;
        font-size: 0.9rem;
    }
}

/* ====================================
   CONTENT TABS
   ==================================== */
.content-tabs {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.tab-nav {
    display: flex;
    padding: 0;
}

.tab-btn {
    flex: 1;
    padding: 16px 12px;
    border: none;
    background: none;
    color: var(--text-secondary);
    font-weight: 700;
    cursor: pointer;
    position: relative;
    transition: color 0.3s ease;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.tab-btn:hover {
    color: var(--primary-color);
}

.tab-btn.active {
    color: var(--primary-color);
    background: linear-gradient(to right, transparent, rgba(99, 102, 241, 0.05), transparent);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px 2px 0 0;
}

/* ====================================
   PROFILE DETAILS SECTION
   ==================================== */
.profile-details {
    padding: 25px;
    background: var(--bg-primary);
    max-width: 900px;
    margin: 0 auto;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.detail-card {
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 24px;
    border-left: 4px solid var(--secondary-color);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.detail-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.detail-card-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.detail-card-icon {
    font-size: 1.5rem;
    color: var(--secondary-color);
    margin-right: 12px;
}

.detail-card-label {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.detail-card-value {
    margin: 0;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
}

/* ====================================
   BIO SECTION
   ==================================== */
.profile-bio-section {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 30px;
    border: 1px solid var(--border-color);
    margin-bottom: 40px;
    box-shadow: var(--shadow-sm);
}

.profile-bio-section h4 {
    margin: 0 0 16px 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.profile-bio-section p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: 0.95rem;
}

/* ====================================
   IMAGE MODERATION ALERT
   ==================================== */
.moderation-alert {
    margin: 20px 0;
    padding: 16px;
    background-color: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: 8px;
    color: #92400e;
    font-weight: 500;
}

/* ====================================
   MEDIA GALLERY GRID
   ==================================== */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    padding: 20px;
    background: var(--bg-primary);
}

.media-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--bg-tertiary);
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.media-item:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.media-item img,
.media-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    aspect-ratio: 1;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 1rem;
    margin: 0;
}

/* ====================================
   FILE INPUT STYLING
   ==================================== */
#profileImageInput {
    display: none;
}

.thumbnail-input-container {
    display: none;
    margin: 20px 0;
}

/* ====================================
   TAGS
   ==================================== */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.profile-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid var(--border-color);
    cursor: pointer;
}

.profile-tag:hover {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
    text-decoration: none;
}

.profile-tag i {
    margin-right: 4px;
    font-size: 0.8rem;
}

/* ====================================
   LOADING STATES
   ==================================== */
.spinner-border {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    vertical-align: text-bottom;
    border: 0.25em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ====================================
   SIMILAR CHARACTERS SECTION
   ==================================== */
.similar-section {
    padding: 40px 20px;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
}

.similar-section h5 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.similar-section .text-muted {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 25px;
}

.similar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.similar-card {
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease;
}

.similar-card:hover {
    transform: translateY(-5px);
}

.similar-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 12px;
    display: block;
    border: 3px solid var(--border-color);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.similar-card:hover .similar-avatar {
    transform: scale(1.1);
    border-color: var(--primary-color);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.2);
}

.similar-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}

/* ====================================
   RESPONSIVE DESIGN
   ==================================== */
@media (max-width: 1024px) {
    .profile-cover {
        height: 32vh;
        min-height: 250px;
    }

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

    .profile-name {
        font-size: 1.75rem;
    }

    .stat-item {
        padding: 0 10px;
    }

    .details-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .profile-cover {
        height: 30vh;
        min-height: 220px;
    }

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

    .profile-name {
        font-size: 1.5rem;
    }

    .profile-intro {
        font-size: 0.9rem;
    }

    .profile-stats {
        padding: 20px 15px;
    }

    .stat-item {
        padding: 0 8px;
    }

    .profile-actions {
        padding: 18px 15px;
        gap: 8px;
    }

    .action-btn {
        max-width: 100%;
        padding: 11px 18px;
        font-size: 0.9rem;
    }

    .tab-btn {
        padding: 14px 10px;
        font-size: 0.85rem;
    }

    .details-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .profile-details {
        padding: 20px;
    }

    .media-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
        padding: 15px;
    }

    .similar-grid {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    }
}

@media (max-width: 480px) {
    .profile-cover {
        height: 28vh;
        min-height: 200px;
    }

    .profile-avatar {
        width: 80px;
        height: 80px;
        border-width: 4px;
    }

    .profile-name {
        font-size: 1.3rem;
        margin: 12px 0 8px;
    }

    .profile-intro {
        font-size: 0.85rem;
    }

    .profile-info {
        padding: 60px 15px 20px;
    }

    .profile-stats {
        padding: 18px 12px;
        flex-direction: row;
    }

    .stat-item {
        padding: 0 6px;
    }

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

    .stat-label {
        font-size: 0.75rem;
    }

    .stat-item:not(:last-child)::after {
        height: 40%;
    }

    .profile-actions {
        flex-direction: column;
        padding: 15px 12px;
    }

    .action-btn {
        max-width: 100%;
    }

    .tab-nav {
        overflow-x: auto;
    }

    .tab-btn {
        padding: 12px 8px;
        font-size: 0.8rem;
        min-width: 80px;
        white-space: nowrap;
    }

    .details-grid {
        grid-template-columns: 1fr;
    }

    .detail-card {
        padding: 18px;
    }

    .profile-details {
        padding: 15px 12px;
    }

    .profile-bio-section {
        padding: 20px;
    }

    .media-grid {
        grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
        gap: 8px;
        padding: 12px;
    }

    .similar-grid {
        grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
        gap: 12px;
    }

    .similar-section {
        padding: 30px 15px;
    }

    .similar-section h5 {
        font-size: 1.1rem;
    }
}

/* ====================================
   UTILITY CLASSES
   ==================================== */
.text-muted {
    color: var(--text-secondary) !important;
}

.d-none {
    display: none !important;
}

.d-flex {
    display: flex;
}

.align-items-center {
    align-items: center;
}

.justify-content-center {
    justify-content: center;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

.my-3 {
    margin: 1rem 0;
}

.p-3 {
    padding: 1rem;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 1rem;
}

.fw-bold {
    font-weight: 700;
}

.text-center {
    text-align: center;
}

.rounded-circle {
    border-radius: 50%;
}

.position-relative {
    position: relative;
}

.position-absolute {
    position: absolute;
}

.button-text {
    display: inline-block;
}

.button-spinner {
    display: none;
}

.button-spinner.active {
    display: inline-block;
}

/* ====================================
   INSTAGRAM-STYLE PROFILE DESIGN
   ==================================== */

/* Hide legacy profile elements when using Instagram style */
body.user-profile-page .profile-header,
body.user-profile-page .profile-cover,
body.user-profile-page .profile-actions,
body.user-profile-page .profile-stats,
body.user-profile-page .content-tabs {
    display: none !important;
}

/* Instagram Profile Header */
.ig-profile-header {
    background: var(--bg-primary);
    padding-bottom: 8px;
}

.ig-profile-info {
    display: flex;
    align-items: center;
    padding: 16px;
    gap: 20px;
}

.ig-avatar-section {
    flex-shrink: 0;
    position: relative;
}

.ig-avatar-ring {
    width: 86px;
    height: 86px;
    border-radius: 50%;
    padding: 3px;
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.ig-avatar-ring.creator-ring {
    background: linear-gradient(45deg, #8240FF, #a855f7, #ec4899, #8240FF);
}

.ig-avatar {
    width: 78px;
    height: 78px;
    border-radius: 50%;
    border: 3px solid var(--bg-primary);
    object-fit: cover;
    object-position: top;
}

.ig-avatar-edit {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 28px;
    height: 28px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.75rem;
    cursor: pointer;
    border: 2px solid var(--bg-primary);
    transition: all 0.2s ease;
    z-index: 10;
}

.ig-avatar-edit:hover {
    background: var(--secondary-color);
    transform: scale(1.1);
}

.ig-verified-badge {
    position: absolute;
    bottom: -5px;
    right: -5px;
    background: #4CAF50;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    border: 2px solid var(--bg-primary);
}

.ig-stats-row {
    display: flex;
    flex: 1;
    justify-content: space-around;
    align-items: center;
}

.ig-settings-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    flex-shrink: 0;
}

.ig-settings-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border-color: var(--text-primary);
}

.ig-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: opacity 0.2s ease;
}

.ig-stat:hover {
    opacity: 0.7;
}

.ig-stat-number {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.ig-stat-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Bio Section */
.ig-bio-section {
    padding: 0 16px 12px;
}

.ig-display-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 4px 0;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.ig-username {
    font-weight: 400;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.ig-creator-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #8240FF, #a855f7);
    color: white;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    font-size: 0.65rem;
}

.ig-verified-icon {
    color: #1DA1F2;
    font-size: 0.9rem;
}

.ig-category-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, rgba(130, 64, 255, 0.15), rgba(168, 85, 247, 0.15));
    color: var(--primary-color);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.ig-bio {
    font-size: 0.85rem;
    color: var(--text-primary);
    margin: 6px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ig-membership-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 8px;
}

.ig-membership-badge.premium {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(245, 158, 11, 0.2));
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.ig-membership-badge.free {
    background: rgba(107, 114, 128, 0.15);
    color: var(--text-secondary);
    border: 1px solid rgba(107, 114, 128, 0.3);
}

/* ── User Badges Section ── */
.ig-badges-section {
    margin-top: 12px;
    width: 100%;
}

.ig-badges-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.ig-badges-count {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary, #e5e7eb);
    display: flex;
    align-items: center;
    gap: 5px;
}

.ig-badges-count i {
    color: #fbbf24;
}

.ig-badges-see-more {
    font-size: 0.75rem;
    color: var(--primary, #8b5cf6);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 3px;
    transition: opacity 0.2s;
}

.ig-badges-see-more:hover {
    opacity: 0.8;
}

.ig-badges-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 6px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
    -webkit-overflow-scrolling: touch;
}

.ig-badges-scroll::-webkit-scrollbar {
    height: 4px;
}

.ig-badges-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.ig-badges-scroll::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 2px;
}

.ig-badge-item {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, border-color 0.2s;
}

.ig-badge-item:hover {
    transform: scale(1.1);
    border-color: rgba(251, 191, 36, 0.4);
}

.ig-badge-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.ig-social-links {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.ig-social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s ease;
}

.ig-social-link:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* Action Row */
.ig-action-row {
    display: flex;
    padding: 12px 16px;
    gap: 8px;
}

.ig-chat-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #8240FF 0%, #a855f7 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(130, 64, 255, 0.3);
}

.ig-chat-btn:hover {
    background: linear-gradient(135deg, #9555FF 0%, #b366f7 100%);
    color: white;
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(130, 64, 255, 0.4);
}

.ig-chat-btn:active {
    transform: scale(0.98);
}

.ig-chat-btn.ig-premium-btn {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #1a1a1a;
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.3);
}

.ig-chat-btn.ig-premium-btn:hover {
    box-shadow: 0 6px 20px rgba(251, 191, 36, 0.4);
}

.ig-chat-btn.ig-follow-btn {
    background: linear-gradient(135deg, #8240FF 0%, #a855f7 100%);
}

.ig-chat-btn.ig-follow-btn.following {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    box-shadow: none;
}

.ig-chat-btn.ig-follow-btn.following:hover {
    border-color: #ef4444;
    color: #ef4444;
}

.ig-secondary-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.ig-secondary-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.ig-secondary-btn:active {
    background: rgba(255, 255, 255, 0.1);
}

.ig-secondary-btn.ig-success-btn {
    border-color: #10b981;
    color: #10b981;
}

.ig-secondary-btn.ig-success-btn:hover {
    background: rgba(16, 185, 129, 0.1);
}

.ig-secondary-btn.ig-info-btn {
    border-color: #3b82f6;
    color: #3b82f6;
}

.ig-secondary-btn.ig-info-btn:hover {
    background: rgba(59, 130, 246, 0.1);
}

.ig-secondary-btn.ig-subscribe-btn {
    border-color: #fbbf24;
    color: #fbbf24;
}

.ig-secondary-btn.ig-subscribe-btn:hover {
    background: rgba(251, 191, 36, 0.1);
}

.ig-secondary-btn.ig-small-btn {
    width: 36px;
    height: 36px;
    font-size: 0.9rem;
}

/* Instagram Tab Navigation */
.ig-tab-nav {
    display: flex;
    border-top: 1px solid var(--border-color);
    background: var(--bg-primary);
}

.ig-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 0;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.35rem;
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
}

.ig-tab.active {
    color: var(--text-primary);
}

.ig-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--text-primary);
}

.ig-tab:active {
    opacity: 0.7;
}

/* Tab Content */
.tab-content {
    background: var(--bg-primary);
    min-height: 200px;
}

.tab-pane {
    background: var(--bg-primary);
}

/* Media Grid Updates for Instagram Style */
body.user-profile-page .media-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    padding: 0;
    background: var(--bg-primary);
}

body.user-profile-page .media-grid.characters-grid {
    gap: 2px;
    padding: 0;
}

body.user-profile-page .media-item {
    border-radius: 0;
    aspect-ratio: 1;
}

body.user-profile-page .media-item:hover {
    transform: none;
    opacity: 0.85;
}

/* ====================================
   INSTAGRAM-STYLE USER IMAGE GALLERY
   ==================================== */

/* Instagram Grid Container */
body.user-profile-page #user-images-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    padding: 0;
    background: var(--bg-primary);
}

/* Instagram Image Card */
.ig-image-card {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--bg-tertiary);
    cursor: pointer;
}

.ig-image-card .ig-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
}

/* Blurred image for locked content */
.ig-image-card .ig-image-blur {
    filter: blur(15px);
    transform: scale(1.1);
}

.ig-image-blur-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Trial badge in lock overlay */
.ig-lock-trial-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    margin-bottom: 2px;
}

/* Blur wrapper and lock overlay are defined globally in style.css */

/* NSFW Overlay for Premium Users (showNSFW=false) */
.ig-image-nsfw-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.ig-image-card .ig-image-nsfw {
    filter: blur(15px);
    transform: scale(1.1);
}

.ig-image-nsfw-wrapper[data-revealed="true"] .ig-image-nsfw {
    filter: none;
    transform: scale(1);
}

.ig-nsfw-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: white;
    backdrop-filter: blur(2px);
    transition: opacity 0.2s ease;
}

.ig-nsfw-overlay i {
    font-size: 1.5rem;
    opacity: 0.9;
}

.ig-nsfw-overlay span {
    font-size: 11px;
    font-weight: 500;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ig-nsfw-overlay:hover {
    background: rgba(0, 0, 0, 0.6);
}

.ig-nsfw-overlay:hover i,
.ig-nsfw-overlay:hover span {
    opacity: 1;
}

/* Hover Overlay - Hidden (mobile-first design) */
.ig-image-overlay {
    display: none;
}

.ig-image-stats {
    display: flex;
    gap: 20px;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
}

.ig-stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Like Button - Always visible (mobile-first) */
.ig-like-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 10;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.4);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    backdrop-filter: blur(4px);
}

.ig-like-btn.liked {
    background: rgba(0, 0, 0, 0.5);
}

.ig-like-btn.liked i {
    color: #ef4444;
}

/* Character Footer - Always visible (mobile-first) */
.ig-image-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 6px 8px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.ig-footer-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid rgba(255, 255, 255, 0.5);
    flex-shrink: 0;
}

.ig-footer-name {
    color: white;
    font-size: 10px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

/* Responsive Grid Adjustments */
@media (min-width: 768px) {
    body.user-profile-page #user-images-gallery {
        grid-template-columns: repeat(4, 1fr);
        gap: 3px;
    }
}

@media (min-width: 1024px) {
    body.user-profile-page #user-images-gallery {
        grid-template-columns: repeat(5, 1fr);
        gap: 4px;
    }
}

@media (min-width: 1400px) {
    body.user-profile-page #user-images-gallery {
        grid-template-columns: repeat(6, 1fr);
        gap: 4px;
    }
}

/* Loading Grid */
.loading-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    padding: 0;
    width: 100%;
    grid-column: 1 / -1;
}

.loading-item {
    aspect-ratio: 1;
    background: linear-gradient(90deg, #1a1a1a 25%, #2a2a2a 50%, #1a1a1a 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* About Container */
.ig-about-container {
    padding: 16px;
    background: var(--bg-primary);
}

.ig-attributes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.ig-attribute-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.ig-attribute-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.ig-attribute-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.ig-attribute-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.ig-attribute-value {
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ig-attribute-value.ig-premium-badge {
    color: #fbbf24;
}

/* Section Card */
.ig-section-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 16px;
    margin-bottom: 16px;
}

.ig-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem;
}

.ig-section-header i {
    color: var(--primary-color);
    font-size: 1.1rem;
}

.ig-section-header .ig-section-link {
    margin-left: auto;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.ig-section-header .ig-section-link:hover {
    color: var(--primary-color);
}

.ig-section-text {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.6;
    margin: 0;
}

/* Preferences List */
.ig-preferences-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ig-preference-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.ig-preference-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.ig-preference-value {
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* Quick Links */
.ig-quick-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 20px;
}

.ig-quick-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s ease;
}

.ig-quick-link:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.ig-quick-link i {
    font-size: 1.3rem;
}

.ig-quick-link span {
    font-size: 0.75rem;
    font-weight: 600;
}

/* Post Controls */
.ig-post-controls {
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

/* Toggle Switch */
.ig-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.ig-toggle input {
    display: none;
}

.ig-toggle-slider {
    width: 36px;
    height: 20px;
    background: var(--border-color);
    border-radius: 20px;
    position: relative;
    transition: background 0.2s ease;
}

.ig-toggle-slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s ease;
}

.ig-toggle input:checked + .ig-toggle-slider {
    background: var(--primary-color);
}

.ig-toggle input:checked + .ig-toggle-slider::after {
    transform: translateX(16px);
}

.ig-toggle-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Schedules List */
.ig-schedules-list {
    max-height: 300px;
    overflow-y: auto;
}

/* Empty State */
.ig-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.ig-empty-state.small {
    padding: 20px;
}

.ig-empty-state i {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: 0.5;
    display: block;
}

.ig-empty-state.small i {
    font-size: 1.5rem;
}

.ig-empty-state p {
    margin: 0;
    font-size: 0.9rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .ig-profile-info {
        padding: 12px 16px;
        gap: 16px;
    }

    .ig-avatar-ring {
        width: 77px;
        height: 77px;
    }

    .ig-avatar {
        width: 70px;
        height: 70px;
    }

    .ig-stat-number {
        font-size: 1rem;
    }

    .ig-stat-label {
        font-size: 0.65rem;
    }

    .ig-display-name {
        font-size: 0.85rem;
    }

    .ig-bio {
        font-size: 0.8rem;
    }

    .ig-chat-btn {
        padding: 9px 16px;
        font-size: 0.85rem;
    }

    .ig-tab {
        padding: 12px 0;
        font-size: 1.2rem;
    }

    .ig-attributes-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .ig-quick-links {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 480px) {
    .ig-stats-row {
        gap: 8px;
    }

    .ig-stat-number {
        font-size: 0.95rem;
    }

    .ig-stat-label {
        font-size: 0.6rem;
    }

    .ig-action-row {
        padding: 10px 12px;
        gap: 6px;
    }

    .ig-secondary-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .ig-attributes-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .ig-attribute-card {
        padding: 10px;
        gap: 8px;
    }

    .ig-attribute-icon {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }

    .ig-attribute-label {
        font-size: 0.6rem;
    }

    .ig-attribute-value {
        font-size: 0.75rem;
    }

    .ig-quick-links {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .ig-quick-link {
        padding: 12px 8px;
    }

    .ig-quick-link i {
        font-size: 1.1rem;
    }

    .ig-quick-link span {
        font-size: 0.65rem;
    }
}