/* Profile-specific styles */

/* App shell: card defaults are opaque; keep header body transparent so banner layer shows */
#partial-content .profile-header.card .card-body,
.app-main .profile-header.card .card-body {
    background: transparent !important;
}

/* Profile Header Styles */
.profile-header .card-body {
    padding: 1rem !important;
}

.profile-header .card-title {
    font-size: 1.4rem;
    margin-bottom: 0.25rem !important;
}

.profile-header .opacity-75 {
    font-size: 0.9rem;
}

.profile-header .mb-3 {
    margin-bottom: 0.75rem !important;
}

/* Energy meter below profile header */
.profile-energy-strip {
    max-width: 100%;
}

.profile-energy-label {
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6c757d;
    opacity: 0.9;
}

.profile-energy-pct {
    font-size: 0.78rem;
}

.profile-energy-track {
    background: rgba(139, 157, 131, 0.12);
    padding: 0.4rem 0.55rem 0.45rem;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.profile-energy-progress {
    height: 10px;
    border-radius: 0.35rem;
    background-color: rgba(255, 255, 255, 0.65);
}

.profile-energy-reset {
    font-size: 0.78rem;
}

.profile-energy-reset small {
    opacity: 0.88;
}

/* Slim Section Styles */
.slim-section .card-header {
    padding: 0.5rem 0.75rem !important;
}

.slim-section .card-header h4 {
    font-size: 1rem;
}

.slim-section .card-body {
    padding: 0.5rem 0.75rem !important;
}

.slim-section .form-control-plaintext {
    font-size: 0.9rem;
}

.slim-section .mb-3 {
    margin-bottom: 0.75rem !important;
}

/* Inline Editing Styles */
.editable-field {
    position: relative;
}

.editable-field .view-mode {
    position: relative;
    padding-right: 0; /* Inline edit button sits with label now */
}

/* Dedicated edit button style (independent of outline-primary) */
.edit-btn {
    padding: 0.15rem 0.35rem !important; /* tighter than normal btn */
    font-size: 0.7rem !important;       /* smaller icon/text */
    line-height: 1 !important;
    border: 1px solid #adb5bd !important;
    color: #6c757d !important;
    background-color: transparent !important;
}

.edit-btn:hover {
    background-color: rgba(108, 117, 125, 0.08) !important;
    border-color: #8b9d83 !important;
    color: #8b9d83 !important;
}

.editable-field .edit-mode {
    position: relative;
}

.editable-field .form-control,
.editable-field .form-select {
    border: 2px solid #8b9d83;
    border-radius: 0.5rem;
}

.editable-field .form-control:focus,
.editable-field .form-select:focus {
    border-color: #7a8a72;
    box-shadow: 0 0 0 0.2rem rgba(139, 157, 131, 0.25);
}

.editable-field .btn-sm {
    padding: 0.2rem 0.4rem !important;
    font-size: 0.75rem !important;
}

.editable-field .save-btn {
    background-color: #28a745;
    border-color: #28a745;
}

.editable-field .save-btn:hover {
    background-color: #218838;
    border-color: #1e7e34;
}

.editable-field .cancel-btn {
    background-color: #6c757d;
    border-color: #6c757d;
}

.editable-field .cancel-btn:hover {
    background-color: #5a6268;
    border-color: #545b62;
}

/* Loading state */
.editable-field.loading {
    opacity: 0.6;
    pointer-events: none;
}

.editable-field.loading .btn {
    pointer-events: none;
}

/* Success animation */
.editable-field.success .view-mode p {
    animation: successPulse 0.5s ease;
}

@keyframes successPulse {
    0% { background-color: transparent; }
    50% { background-color: rgba(40, 167, 69, 0.1); }
    100% { background-color: transparent; }
}

/* Profile Accordion Styles */
.profile-accordion .accordion-header {
    transition: all 0.3s ease;
    user-select: none;
}

.profile-accordion .accordion-header:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%) !important;
    transform: translateY(-1px);
}

.profile-accordion .accordion-header:active {
    transform: translateY(0);
}

.profile-accordion .accordion-icon {
    transition: transform 0.3s ease;
    color: #8b9d83;
    font-size: 1.1rem;
}

.profile-accordion .accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding-top: 0;
    padding-bottom: 0;
}

.profile-accordion .accordion-content.expanded {
    max-height: none; /* Allow content to expand naturally */
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
}

.profile-accordion .accordion-icon.expanded {
    transform: rotate(180deg);
}

/* Speaker Interactions Styles */
.speaker-avatar {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #8b9d83 0%, #a67c52 100%);
    border-radius: 50%;
    color: white;
    overflow: hidden;
    position: relative;
}

/* Profile uses <img class="speaker-image"> inside .speaker-avatar. The gallery uses
   <div class="speaker-image"> as a wrapper — unscoped rules here broke card layout and hid bios. */
img.speaker-image,
.speaker-avatar .speaker-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.fallback-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
}

.card.speaker-card {
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.card.speaker-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    border-color: #8b9d83;
}

/* Toast container styles */
.toast-container {
    z-index: 9999;
}

.toast {
    min-width: 250px;
}

/* Loading spinner styles */
.spinner-border {
    width: 2rem;
    height: 2rem;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .profile-accordion .accordion-header {
        padding: 1rem;
    }
    
    .profile-accordion .accordion-header h4 {
        font-size: 1.1rem;
    }
    
    .profile-accordion .accordion-icon {
        font-size: 1rem;
    }
    
    .profile-accordion .accordion-content.expanded {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }
    
    .slim-section .card-body {
        padding: 0.75rem 1rem !important;
    }
    
    .slim-section .card-header {
        padding: 0.75rem 1rem !important;
    }
    
    .slim-section .card-header h4 {
        font-size: 1.1rem;
    }
}

/* 2026 editorial profile refresh */
.profile-modern-page {
    --profile-ink: #263930;
    --profile-muted: #67776e;
    --profile-green: #32644f;
    --profile-green-deep: #244c3b;
    --profile-gold: #b78a45;
    --profile-paper: #fbfaf6;
    --profile-line: #dce5df;
    width: min(1180px, calc(100% - 2rem));
    max-width: 1180px;
    margin: 0 auto !important;
    padding: 2rem 0 4.5rem;
    color: var(--profile-ink);
}

.profile-modern-page > .row,
.profile-modern-page > .row > [class*="col-"] {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
}

.profile-modern-page [id^="profile-"] {
    scroll-margin-top: 1.25rem;
}

.profile-modern-page .profile-header {
    position: relative;
    min-height: 310px;
    margin-bottom: 1rem !important;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.42) !important;
    border-radius: 28px !important;
    background: linear-gradient(135deg, #315e4b 0%, #85673f 100%) !important;
    box-shadow: 0 22px 55px rgba(37, 58, 48, 0.16) !important;
}

.profile-modern-page .profile-header::before {
    content: "";
    position: absolute;
    z-index: 2;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(21, 42, 33, 0.88) 0%, rgba(27, 49, 40, 0.68) 54%, rgba(35, 48, 39, 0.3) 100%),
        radial-gradient(circle at 88% 10%, rgba(231, 193, 121, 0.28), transparent 32%);
    pointer-events: none;
}

.profile-modern-page .profile-header::after {
    content: "";
    position: absolute;
    z-index: 2;
    right: -95px;
    bottom: -220px;
    width: 430px;
    height: 430px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    pointer-events: none;
}

.profile-modern-page .banner-background {
    opacity: 0.82;
    filter: saturate(0.85) contrast(1.02);
}

.profile-modern-page .profile-header .card-body {
    position: relative;
    z-index: 3 !important;
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: clamp(1.5rem, 4vw, 3rem);
    align-items: center;
    min-height: 310px;
    padding: clamp(2rem, 5vw, 4rem) !important;
    text-align: left !important;
}

.profile-modern-page .profile-hero-avatar {
    margin: 0 !important;
}

.profile-modern-page .profile-avatar {
    width: 138px !important;
    height: 138px !important;
    margin: 0 !important;
    background: rgba(255, 255, 255, 0.16) !important;
    box-shadow: 0 18px 40px rgba(10, 25, 18, 0.28);
}

.profile-modern-page .profile-avatar > img:first-child {
    border: 4px solid rgba(255, 255, 255, 0.88);
}

.profile-hero-copy {
    max-width: 680px;
}

.profile-hero-kicker,
.profile-section-kicker {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.55rem;
    color: #efd29d;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.profile-modern-page .profile-header .card-title {
    margin: 0 !important;
    color: #fff;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.6rem, 6vw, 4.7rem);
    font-weight: 500;
    line-height: 0.98;
    letter-spacing: -0.035em;
    text-shadow: 0 3px 18px rgba(10, 25, 18, 0.24);
}

.profile-hero-handle {
    margin-top: 0.8rem;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.profile-hero-intro {
    max-width: 620px;
    margin: 0.75rem 0 1.1rem;
    color: rgba(255, 255, 255, 0.88);
    font-size: 1rem;
    line-height: 1.55;
}

.profile-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.profile-modern-page .profile-hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.58rem 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.34);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 0.84rem;
    font-weight: 700;
    backdrop-filter: blur(8px);
}

.profile-modern-page .profile-hero-btn:hover,
.profile-modern-page .profile-hero-btn:focus-visible {
    border-color: rgba(255, 255, 255, 0.72);
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
    transform: translateY(-1px);
}

.profile-quick-nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.65rem;
    margin: 0 0 1.25rem;
    padding: 0.65rem;
    border: 1px solid var(--profile-line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 12px 30px rgba(39, 63, 51, 0.06);
}

.profile-quick-nav a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.48rem;
    min-height: 44px;
    padding: 0.55rem 0.6rem;
    border-radius: 12px;
    color: var(--profile-green-deep);
    font-size: 0.82rem;
    font-weight: 750;
    text-decoration: none;
    transition: background 160ms ease, transform 160ms ease;
}

.profile-quick-nav a:hover,
.profile-quick-nav a:focus-visible {
    background: #eef4ef;
    color: var(--profile-green-deep);
    transform: translateY(-1px);
}

.profile-quick-nav i {
    color: var(--profile-gold);
}

.profile-modern-page .profile-energy-strip {
    margin-bottom: 1.4rem !important;
    padding: 0.9rem 1.05rem;
    border: 1px solid var(--profile-line);
    border-radius: 16px;
    background: rgba(251, 250, 246, 0.88);
}

.profile-modern-page .profile-energy-label {
    color: var(--profile-green);
    font-weight: 800;
}

.profile-modern-page .profile-energy-track {
    border: 0;
    background: #e6ece7;
}

.profile-modern-page #token-progress-bar {
    border-radius: inherit;
    background: linear-gradient(90deg, var(--profile-green), var(--profile-gold));
}

.profile-modern-page .card:not(.profile-header) {
    overflow: hidden;
    border: 1px solid var(--profile-line) !important;
    border-radius: 21px !important;
    background: rgba(255, 255, 255, 0.9) !important;
    box-shadow: 0 14px 36px rgba(39, 63, 51, 0.07) !important;
}

.profile-modern-page .card-header {
    padding: 1.1rem 1.25rem !important;
    border-bottom: 1px solid var(--profile-line) !important;
    border-radius: 0 !important;
    background: linear-gradient(135deg, #f6f4ec 0%, #eef4ef 100%) !important;
}

.profile-modern-page .card-header h4,
.profile-modern-page .profile-energy-card h4 {
    color: var(--profile-ink);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.25rem, 2vw, 1.55rem) !important;
    font-weight: 500;
}

.profile-modern-page .card-header h4 i,
.profile-modern-page .profile-energy-card h4 i {
    color: var(--profile-green) !important;
    font-size: 0.9em;
}

.profile-modern-page .card-header h4.text-white {
    color: var(--profile-ink) !important;
}

.profile-modern-page .card-body {
    color: var(--profile-ink);
}

.profile-modern-page .slim-section {
    height: 100%;
}

.profile-modern-page .slim-section .card-body {
    padding: 1.15rem 1.3rem !important;
}

.profile-modern-page .slim-section .mb-3 {
    margin-bottom: 1rem !important;
}

.profile-modern-page .form-label {
    color: var(--profile-green) !important;
    font-size: 0.7rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.profile-modern-page .form-control-plaintext {
    min-height: 38px;
    margin: 0;
    padding: 0.45rem 0.1rem 0.6rem !important;
    border-color: #e4eae5 !important;
    color: #35473e;
}

.profile-modern-page .edit-btn {
    display: inline-grid;
    width: 28px;
    height: 28px;
    place-items: center;
    padding: 0 !important;
    border-color: #d6e0d9 !important;
    border-radius: 50% !important;
    color: var(--profile-green) !important;
    background: #f4f7f3 !important;
}

.profile-modern-page .form-control,
.profile-modern-page .form-select {
    border: 1px solid #cedbd3;
    border-radius: 11px;
    background-color: #fff;
}

.profile-modern-page .profile-energy-card {
    background:
        radial-gradient(circle at 92% 8%, rgba(183, 138, 69, 0.16), transparent 28%),
        linear-gradient(135deg, #f9f7ef 0%, #f0f5f0 100%) !important;
}

.profile-modern-page .profile-energy-card > .card-body {
    padding: clamp(1.3rem, 3vw, 2.25rem) !important;
}

.profile-modern-page .profile-section-kicker {
    margin-bottom: 0.3rem;
    color: var(--profile-green);
}

.profile-modern-page .subscription-info-card {
    height: 100%;
    border-color: rgba(50, 100, 79, 0.14) !important;
    border-radius: 15px !important;
    background: rgba(255, 255, 255, 0.74) !important;
}

.profile-modern-page .energy-bucket {
    min-height: 205px;
    overflow: hidden;
    border: 1px solid rgba(183, 138, 69, 0.5) !important;
    border-radius: 18px !important;
    box-shadow: 0 10px 24px rgba(61, 57, 42, 0.1);
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.profile-modern-page .energy-bucket:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 30px rgba(61, 57, 42, 0.15);
}

.profile-modern-page .energy-bucket > div {
    border: 1px solid rgba(255, 255, 255, 0.64);
    border-radius: 13px !important;
    background: rgba(251, 250, 246, 0.9) !important;
    backdrop-filter: blur(5px);
}

.profile-modern-page .energy-bucket .btn-primary,
.profile-modern-page .btn-primary {
    border-color: var(--profile-green) !important;
    background: var(--profile-green) !important;
    color: #fff !important;
}

.profile-modern-page .energy-bucket .btn-primary:hover,
.profile-modern-page .btn-primary:hover {
    border-color: var(--profile-green-deep) !important;
    background: var(--profile-green-deep) !important;
}

.profile-modern-page #profile-energy > .col-12 > .card-body,
.profile-modern-page #profile-customize .card-body {
    padding: 1.5rem !important;
}

.profile-modern-page .profile-image-container,
.profile-modern-page .profile-image-preview {
    border-color: rgba(50, 100, 79, 0.23) !important;
    outline: 8px solid #f1f5f1;
    box-shadow: 0 10px 24px rgba(36, 76, 59, 0.12);
}

.profile-modern-page .banner-preview {
    border: 1px solid rgba(50, 100, 79, 0.23) !important;
    border-radius: 15px !important;
    box-shadow: 0 10px 24px rgba(36, 76, 59, 0.1);
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.profile-modern-page .banner-preview:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(36, 76, 59, 0.15);
}

.profile-modern-page .profile-accordion .accordion-header {
    cursor: pointer;
}

.profile-modern-page .profile-accordion .accordion-header:hover {
    background: linear-gradient(135deg, #f1f4ed 0%, #e8f0e9 100%) !important;
    transform: none;
}

.profile-modern-page .profile-accordion .accordion-icon {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 1px solid #d7e2da;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.65);
    color: var(--profile-green);
}

.profile-modern-page .profile-accordion .accordion-content.expanded {
    padding: 1.35rem !important;
}

.profile-modern-page .bg-light {
    border: 1px solid #e4eae5;
    background: #f7f8f4 !important;
}

.profile-modern-page .text-primary {
    color: var(--profile-green) !important;
}

.profile-modern-page .btn-outline-primary {
    border-color: #9ab1a4;
    color: var(--profile-green);
}

.profile-modern-page .btn-outline-primary:hover,
.profile-modern-page .btn-outline-primary.active {
    border-color: var(--profile-green);
    background: var(--profile-green);
    color: #fff;
}

.profile-modern-page .modal-content {
    overflow: hidden;
    border: 1px solid var(--profile-line) !important;
    border-radius: 22px !important;
    background: var(--profile-paper);
    box-shadow: 0 26px 70px rgba(25, 43, 34, 0.24) !important;
}

.profile-modern-page .modal-header {
    border-radius: 0 !important;
    background: linear-gradient(135deg, var(--profile-green-deep), #7d633f) !important;
}

.profile-modern-page .upload-area {
    border-color: #b8c9bf !important;
    border-radius: 16px !important;
    background: #f5f7f3 !important;
}

@media (max-width: 900px) {
    .profile-modern-page .profile-header .card-body {
        grid-template-columns: 118px minmax(0, 1fr);
        gap: 1.5rem;
    }

    .profile-modern-page .profile-avatar {
        width: 112px !important;
        height: 112px !important;
    }

    .profile-quick-nav {
        grid-template-columns: repeat(5, minmax(112px, 1fr));
        overflow-x: auto;
        scrollbar-width: thin;
    }
}

@media (max-width: 700px) {
    .profile-modern-page {
        width: min(100% - 1rem, 1180px);
        padding: 0.75rem 0 3rem;
    }

    .profile-modern-page .profile-header {
        min-height: 0;
        border-radius: 21px !important;
    }

    .profile-modern-page .profile-header::before {
        background: linear-gradient(180deg, rgba(22, 43, 34, 0.62), rgba(19, 40, 31, 0.9));
    }

    .profile-modern-page .profile-header .card-body {
        grid-template-columns: 1fr;
        gap: 1rem;
        min-height: 0;
        padding: 1.6rem 1.35rem !important;
        text-align: left !important;
    }

    .profile-modern-page .profile-avatar {
        width: 92px !important;
        height: 92px !important;
    }

    .profile-modern-page .profile-header .card-title {
        font-size: clamp(2.35rem, 13vw, 3.4rem);
    }

    .profile-hero-intro {
        font-size: 0.94rem;
    }

    .profile-quick-nav {
        margin-bottom: 1rem;
        border-radius: 15px;
    }

    .profile-quick-nav a {
        min-width: 108px;
        min-height: 42px;
    }

    .profile-modern-page .profile-energy-card > .card-body,
    .profile-modern-page .card-body {
        padding-right: 1rem !important;
        padding-left: 1rem !important;
    }

    .profile-modern-page .energy-bucket {
        min-height: 190px;
    }

    .profile-modern-page .modal-dialog {
        margin: 0.65rem;
    }
}

/* Banner Gallery Modal Styles */
/* Fix z-index to appear above slide-menu and hamburger menu */
#bannerGalleryModal,
#profileImageModal,
#editUserModal,
div.modal {
    z-index: 2500 !important; /* Above slide-menu (z-index: 1999) and hamburger menu (z-index: 2001) */
}

.modal-backdrop.show,
div.modal-backdrop,
.modal-backdrop {
    z-index: 2499 !important; /* Just below modal but above slide-menu and hamburger menu */
}

/* Also hide hamburger menu when admin modals are open */
body.modal-open .hamburger-menu {
    z-index: 1500 !important; /* Below modal backdrop */
}

/* Also force slide-menu below modals */
body.modal-open .slide-menu {
    z-index: 1500 !important; /* Below modal backdrop */
    pointer-events: none !important; /* Disable clicks */
}

.banner-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.banner-option {
    position: relative;
    border-radius: 0.5rem;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    background: #f8f9fa;
}

.banner-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    border-color: #8b9d83;
}

.banner-option.selected {
    border-color: #8b9d83;
    box-shadow: 0 0 0 3px rgba(139, 157, 131, 0.2);
}

.banner-option img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
}

.banner-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: white;
    padding: 0.5rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.banner-option:hover .banner-overlay {
    transform: translateY(0);
}

.banner-name {
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
}

.selected-indicator {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 24px;
    height: 24px;
    background: #8b9d83;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.75rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.banner-option.selected .selected-indicator {
    opacity: 1;
}

/* Mobile responsive banner grid */
@media (max-width: 768px) {
    .banner-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.75rem;
    }
    
    .banner-option img {
        height: 100px;
    }
    
    .banner-name {
        font-size: 0.8rem;
    }
}

