body {
    background: linear-gradient(to bottom, rgb(255, 255, 255), rgba(0, 0, 0, 0.041)), url('../images/background/mainbackground2.jpg');


}

.cont {
    display: flex;
    flex-direction: row;
    flex-grow: 1;
}

.top-right {
    position: absolute;
    top: 0;
    right: 0;
    margin: 10px;
    /* Adjust the margin as needed */
}

.row {
    --bs-gutter-x: 1.5rem;
    --bs-gutter-y: 0;
    display: flex;
    flex: 1 0 100%;
    flex-wrap: wrap;
    margin-top: calc(var(--bs-gutter-y) * -1);
    margin-right: 0;
    margin-left: 0;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;

}

.form-control:focus {
    box-shadow: none;
    border-color: #BA68C8
}

.profile-button {
    background: rgb(99, 39, 120);
    box-shadow: none;
    border: none
}

.profile-button:hover {
    background: #300438
}

.profile-button:focus {
    background: #682773;
    box-shadow: none
}

.profile-button:active {
    background: #682773;
    box-shadow: none
}

.back:hover {
    color: #682773;
    cursor: pointer
}

.labels {
    font-size: 11px
}

h2.update-profile-header {
    color: #333;
    text-align: center;
    margin-top: 20px;
    margin-bottom: 30px;
    font-weight: 700;
}

.gallery {
    --s: 130px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
    position: relative;
    width: 100%;
}


.profile-action-button {
    color: white;
    transition: background-color 0.3s ease;
    margin: 10px auto;
    position: relative;
    left: auto;
    display: block;
    width: fit-content;
}

.profile-action-button.follow {
    background-color: #75c400;
    color: white;
}

.profile-action-button.following {
    background-color: #14802d;
    color: white;
    /* Bootstrap success color */
}

/* Update Profile Button */
.update-profile-btn {
    background: transparent !important;
    color: black !important;
    border: 2px solid #333 !important;
    padding: 10px 24px !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    position: relative !important;
    left: auto !important;
    top: auto !important;
    margin: 16px auto !important;
}

.update-profile-btn:hover {
    background: rgba(0, 0, 0, 0.05) !important;
    border-color: #000 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.update-profile-btn:active {
    transform: translateY(0);
}

.update-profile-btn i {
    font-size: 1rem;
}

/* Follow/Following Button */
.follow-btn {
    background: transparent !important;
    color: black !important;
    border: 2px solid #333 !important;
    padding: 10px 24px !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    position: relative !important;
    left: auto !important;
    top: auto !important;
    margin: 16px auto !important;
}

.follow-btn.follow {
    background: #43e97b !important;
    color: white !important;
    border-color: #43e97b !important;
}

.follow-btn.follow:hover {
    background: #38d66f !important;
    border-color: #38d66f !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(67, 233, 123, 0.3);
}

.follow-btn.following {
    background: transparent !important;
    color: #333 !important;
    border-color: #333 !important;
}

.follow-btn.following:hover {
    background: rgba(0, 0, 0, 0.05) !important;
    border-color: #000 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.follow-btn:active {
    transform: translateY(0);
}

.follow-btn i {
    font-size: 1rem;
}

.labels {
    font-size: 1em;
    color: #333;
    /* Label text color */
    font: weight 11px;
    /* Make label text bold */
    margin-bottom: 0.5em;
    /* Space below the label */
}

.stat-value {
    color: black;
    /* Stat value text color */
    font-size: 1.9em;
    /* Stat value font size */
    margin-left: 0.5em;
    /* Space to the left of the stat value */
}

.labels+br+.stat-value {
    display: block;
    margin-top: 5px;
    margin-bottom: 15px;
    /* Provide space after each label */
}

a:hover {
    color: #000000;
    text-decoration: underline;
}

/* Phase 2: Content Organization Improvements */

/* Comics Gallery Filter/Sort Controls */
.comics-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 16px;
    background: rgba(255, 255, 255, 0);

}

.comics-controls h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.comics-filters {
    display: flex;
    gap: 12px;
}

.filter-select,
.sort-select {
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color 0.2s;
}

.filter-select:hover,
.sort-select:hover {
    border-color: #999;
}

.filter-select:focus,
.sort-select:focus {
    outline: none;
    border-color: #667eea;
}


/* Empty State Styling */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 8px;
    margin: 20px 0;
}

.empty-state i {
    font-size: 4rem;
    color: #ddd;
    margin-bottom: 16px;
}

.empty-state p {
    font-size: 1.1rem;
    color: #666;
    margin: 8px 0;
}

.empty-state a {
    display: inline-block;
    margin-top: 16px;
    padding: 10px 24px;
    background: #667eea;
    color: white;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.2s;
}

.empty-state a:hover {
    background: #5568d3;
    text-decoration: none;
}

/* View Mode Toggle */
.view-mode-toggle {
    display: flex;
    gap: 8px;
    background: #f5f5f5;
    padding: 4px;
    border-radius: 6px;
}

.view-mode-btn {
    padding: 6px 12px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
}

.view-mode-btn.active {
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.view-mode-btn:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* List View Mode */
.comics-gallery.list-view {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.comics-gallery.list-view .comic-container {
    width: 100% !important;
    display: flex;
    flex-direction: row;
    align-items: center;
}

.comics-gallery.list-view .image-container {
    width: 150px;
    flex-shrink: 0;
}

.comics-gallery.list-view .image-title {
    flex: 1;
    text-align: left;
    padding-left: 16px;
}

/* Phase 4: UX Enhancements */

/* Skeleton Loading States */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.skeleton-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    margin: 0 auto 16px;
}

.skeleton-text {
    height: 20px;
    margin: 8px 0;
}

.skeleton-text.short {
    width: 60%;
}

.skeleton-text.medium {
    width: 80%;
}

.skeleton-text.long {
    width: 100%;
}

.skeleton-card {
    height: 200px;
    border-radius: 8px;
}

/* Breadcrumb Navigation */
.breadcrumb-nav {
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.breadcrumb-nav a {
    color: #667eea;
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb-nav a:hover {
    color: #5568d3;
    text-decoration: underline;
}

.breadcrumb-nav .separator {
    color: #999;
}

.breadcrumb-nav .current {
    color: #333;
    font-weight: 600;
}

/* Smooth Scroll Behavior */
html {
    scroll-behavior: smooth;
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #667eea;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Button Loading State */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.6s linear infinite;
}

/* Fade In Animation */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Sticky Header on Scroll */
.profile-sticky-header {
    position: sticky;
    top: 0;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 12px 24px;
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: space-between;
}

.profile-sticky-header.visible {
    display: flex;
}

.profile-sticky-header .user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile-sticky-header .user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.profile-sticky-header .user-name {
    font-weight: 600;
    font-size: 1rem;
}

/* Success/Error Toast Notifications */
.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10000;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-notification.success {
    border-left: 4px solid #43e97b;
}

.toast-notification.error {
    border-left: 4px solid #f5576c;
}

.toast-notification i {
    font-size: 1.2rem;
}

.toast-notification.success i {
    color: #43e97b;
}

.toast-notification.error i {
    color: #f5576c;
}


/* Phase 3: Functionality Enhancements */

/* Inline Bio Editing */
.bio-container {
    position: relative;
    margin: 12px 0;
}

.bio-text {
    min-height: 40px;
    padding: 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.bio-text:hover {
    background: rgba(0, 0, 0, 0.02);
}

.bio-edit-btn {
    position: absolute;
    top: 0;
    right: 0;
    padding: 4px 8px;
    font-size: 0.8rem;
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
}

.bio-container:hover .bio-edit-btn {
    opacity: 1;
}

.bio-edit-btn:hover {
    background: #f0f0f0;
}

.bio-textarea {
    width: 100%;
    min-height: 80px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
}

.bio-textarea:focus {
    outline: none;
    border-color: #667eea;
}

.bio-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.bio-save-btn,
.bio-cancel-btn {
    padding: 6px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.bio-save-btn {
    background: #667eea;
    color: white;
}

.bio-save-btn:hover {
    background: #5568d3;
}

.bio-cancel-btn {
    background: #e0e0e0;
    color: #333;
}

.bio-cancel-btn:hover {
    background: #d0d0d0;
}

/* Badges Display */
.badges-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0;
    padding: 12px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 16px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.badge.gold {
    background: linear-gradient(135deg, #f7971e 0%, #ffd200 100%);
}

.badge.silver {
    background: linear-gradient(135deg, #bdc3c7 0%, #2c3e50 100%);
}

.badge.bronze {
    background: linear-gradient(135deg, #cd7f32 0%, #8b4513 100%);
}

.badge.special {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.badge i {
    font-size: 1rem;
}

.badges-title {
    width: 100%;
    font-size: 0.9rem;
    font-weight: 600;
    color: #666;
    margin-bottom: 4px;
}

/* No badges message */
.no-badges {
    color: #999;
    font-size: 0.9rem;
    font-style: italic;
}

/* Social Stats Spacing */
.social-stats-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 10px 0;
    justify-content: center;
}

/* Mobile Optimization */
@media screen and (max-width: 991px) {
    .cont {
        flex-direction: column;
    }

    .top-right {
        position: relative;
        text-align: center;
        margin-bottom: 20px;
        margin-top: 10px;
    }

    .gallery {
        grid-template-columns: repeat(2, 1fr);
        /* 2 columns on mobile */
    }

    .profile-action-button,
    .update-profile-btn {
        width: 100%;
        justify-content: center;
    }

    /* Bootstrap col overrides for profile info if needed */
    .row>* {
        width: 100%;
        max-width: 100%;
    }

    /* DEEP MOBILE OPTIMIZATION (App-Like) */

    /* 1. App Header */
    .mobile-header-placeholder {
        height: 60px;
        display: block;
    }

    /* 2. Remove Card Styling */
    .row {
        border: none !important;
        background: transparent !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin-top: 50px !important;
        /* Space for fixed header */
        gap: 0 !important;
    }

    /* 3. Hero Section (PFP + Info) */
    .col-md-3.border-right {
        border: none !important;
        padding-bottom: 0 !important;
        margin-bottom: 0 !important;
        background: white;
    }

    .d-flex.flex-column.align-items-center {
        flex-direction: row !important;
        align-items: center !important;
        padding: 20px 15px !important;
        gap: 20px;
    }

    /* Profile Pic */
    .rounded-circle.mt-5 {
        margin-top: 0 !important;
        width: 80px !important;
        height: 80px !important;
        border: 2px solid white;
        /* clean look */
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }

    /* User Info Text (Stack on right of PFP) */
    .d-flex.flex-column.align-items-center>span {
        text-align: left;
    }

    .font-weight-bold {
        font-size: 1.4rem;
    }

    /* 4. Stats Row (Followers/Following/Posts) */
    /* We need to target the stats loop. Typically these are in the next column */
    /* Since we can't easily change HTML structure via CSS, we'll try to flex the parent row */

    /* Hide the desktop back button, we will use a fixed app header */
    .headerallcbutton {
        display: none !important;
    }

    /* 5. Sticky Tabs / Controls */
    .comics-controls {
        position: sticky;
        top: 60px;
        /* Below header */
        background: white;
        z-index: 90;
        border-bottom: 1px solid #eee;
        padding: 10px 15px;
        margin-bottom: 15px;
    }

    /* 6. Gallery Optimization */
    .gallery {
        grid-template-columns: repeat(3, 1fr) !important;
        /* 3 columns like Insta */
        gap: 2px !important;
        /* Tighter gap */
        padding-bottom: 60px;
        /* Space for potential bottom nav */
    }

    .gallery img {
        height: 100% !important;
        object-fit: cover;
    }

    /* Hide the breadcrumb on mobile for cleaner look */
    .breadcrumb-nav {
        display: none;
    }
}