
/* ==========================================================
   REEDROUX PROFILE PAGE
   ========================================================== */

:root {
    --profile-bg: #0b0b10;
    --profile-panel: #141419;
    --profile-panel-hover: #1b1b23;
    --profile-border: #292932;
    --profile-border-hover: #45404b;

    --profile-text: #f5f5f7;
    --profile-muted: #9898a6;
    --profile-subtle: #727280;

    --profile-accent: #ef4055;
    --profile-accent-hover: #ff5367;
    --profile-accent-soft: rgba(239, 64, 85, 0.12);

    --profile-green: #22c55e;
    --profile-green-soft: rgba(34, 197, 94, 0.12);

    --profile-gold: #f5bd56;
    --profile-gold-soft: rgba(245, 189, 86, 0.12);

    --profile-blue: #60a5fa;
    --profile-blue-soft: rgba(96, 165, 250, 0.12);

    --profile-purple: #b78cff;
    --profile-purple-soft: rgba(183, 140, 255, 0.12);

    --profile-radius: 16px;
    --profile-radius-sm: 10px;

    --profile-transition: 0.2s ease;
}

/* ==========================================================
   GLOBAL PROFILE UTILITIES
   ========================================================== */

[hidden] {
    display: none !important;
}

.profile-banner,
.profile-stats,
.profile-actions,
.profile-login,
.profile-action,
.profile-stat {
    box-sizing: border-box;
}

.profile-banner *,
.profile-stats *,
.profile-actions * {
    box-sizing: border-box;
}

.profile-banner button,
.profile-actions button,
.profile-copy {
    font-family: inherit;
}

.profile-banner button:focus-visible,
.profile-actions button:focus-visible,
.profile-copy:focus-visible,
#copyRoleId:focus-visible,
#openAdminPanel:focus-visible {
    outline: 2px solid var(--profile-accent);
    outline-offset: 4px;
}

/* ==========================================================
   PROFILE BANNER
   ========================================================== */

.profile-banner {
    position: relative;
    overflow: hidden;

    padding: 32px;

    border: 1px solid #663846;
    border-radius: 18px;

    background:
        radial-gradient(
            circle at 90% 30%,
            rgba(239, 64, 85, 0.12),
            transparent 40%
        ),
        radial-gradient(
            circle at 5% 100%,
            rgba(183, 140, 255, 0.05),
            transparent 45%
        ),
        linear-gradient(
            115deg,
            #44202f,
            #1b1b24
        );

    transition:
        border-color var(--profile-transition),
        box-shadow var(--profile-transition);
}

.profile-banner:hover {
    border-color: #8a4657;
    box-shadow: 0 10px 45px rgba(0, 0, 0, 0.12);
}

.profile-banner::before {
    content: "";

    position: absolute;
    top: -110px;
    right: -90px;

    width: 300px;
    height: 300px;

    border-radius: 50%;

    background: radial-gradient(
        circle,
        rgba(239, 64, 85, 0.08),
        transparent 70%
    );

    pointer-events: none;
}

.profile-banner::after {
    content: "";

    position: absolute;
    inset: 0;

    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.015),
        transparent
    );

    pointer-events: none;
}

/* ==========================================================
   PROFILE HERO
   ========================================================== */

.profile-hero {
    position: relative;
    z-index: 1;

    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.profile-identity {
    display: flex;
    flex-direction: column;
    align-items: flex-start;

    min-width: 0;
    flex: 1;
}

.profile-hero h2 {
    margin: 8px 0;

    font-size: 28px;
    font-weight: 900;
    letter-spacing: -0.8px;
    line-height: 1.2;

    color: var(--profile-text);

    overflow-wrap: anywhere;
}

.profile-hero p {
    margin: 0 0 12px;

    color: #bcb4bd;
    font-size: 14px;

    overflow-wrap: anywhere;
}

.profile-hero .eyebrow {
    color: #e7a1af;
    font-weight: 800;
    letter-spacing: 1.5px;
    font-size: 10px;
}

.profile-hero .row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
}

/* ==========================================================
   PROFILE AVATAR
   ========================================================== */

.profile-hero .avatar.large {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 96px;
    height: 96px;

    flex-shrink: 0;

    border-radius: 22px;
    border: 2px solid #a34c61;

    background: #27212b;

    color: #fff;
    font-size: 35px;
    font-weight: 800;

    overflow: hidden;

    box-shadow:
        0 0 0 5px rgba(239, 64, 85, 0.06),
        0 12px 35px rgba(0, 0, 0, 0.2);
}

.profile-hero .avatar.large img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    border-radius: inherit;
}

#sidebarAvatar {
    overflow: hidden;
    flex-shrink: 0;
}

#sidebarAvatar img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    border-radius: inherit;
}

/* ==========================================================
   PROFILE BADGES
   ========================================================== */

.profile-hero .badge,
.profile-hero .staff-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;

    min-height: 27px;
    padding: 5px 11px;

    border-radius: 7px;

    font-size: 11px;
    font-weight: 700;
    line-height: 1.3;

    white-space: nowrap;
}

.profile-hero .badge {
    color: #d6fbe3;
    background: rgba(34, 197, 94, 0.11);
    border: 1px solid rgba(34, 197, 94, 0.24);
}

.profile-hero .staff-badge {
    color: #f3c5cf;
    background: rgba(239, 64, 85, 0.12);
    border: 1px solid rgba(239, 64, 85, 0.3);
}

/* ==========================================================
   SITE ADMINISTRATOR BADGE
   ========================================================== */

.site-admin-badge,
#siteAdminBadge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;

    color: #ffe3a4 !important;

    background: linear-gradient(
        135deg,
        rgba(245, 189, 86, 0.17),
        rgba(239, 64, 85, 0.1)
    ) !important;

    border: 1px solid rgba(
        245, 189, 86, 0.45
    ) !important;

    box-shadow: 0 0 18px rgba(
        245, 189, 86, 0.07
    );

    font-weight: 800 !important;
}

/* ==========================================================
   PREMIUM BADGE
   ========================================================== */

#premiumBadge {
    color: #f3d7ff;
    background: rgba(183, 140, 255, 0.12);
    border: 1px solid rgba(183, 140, 255, 0.3);
    font-weight: 800;
}

/* ==========================================================
   PROFILE BANNER FOOTER
   ========================================================== */

.profile-banner-footer {
    position: relative;
    z-index: 1;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;
    flex-wrap: wrap;

    margin-top: 28px;
    padding-top: 19px;

    border-top: 1px solid rgba(
        255, 255, 255, 0.09
    );
}

.profile-banner-footer span {
    display: inline-flex;
    align-items: center;
    gap: 7px;

    font-size: 12px;
    color: #b5a9b3;
}

.profile-banner-footer strong {
    color: #f5f5f7;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.profile-banner-footer strong.good {
    color: var(--profile-green);
}

/* ==========================================================
   SECTION HEADINGS
   ========================================================== */

.profile-banner + .section {
    margin-top: 28px;
}

.content .section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    gap: 15px;
    flex-wrap: wrap;

    margin-bottom: 17px;
}

.content .section-heading h2 {
    margin: 0 0 5px;

    font-size: 19px;
    font-weight: 800;
    letter-spacing: -0.4px;

    color: var(--profile-text);
}

.content .section-heading p {
    margin: 0;

    font-size: 13px;
    line-height: 1.6;

    color: var(--profile-muted);
}

/* ==========================================================
   PROFILE STATS
   ========================================================== */

.profile-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.profile-stat {
    position: relative;

    min-width: 0;
    min-height: 138px;

    padding: 23px;

    border: 1px solid var(--profile-border);
    border-radius: var(--profile-radius);

    background: var(--profile-panel);

    transition:
        border-color var(--profile-transition),
        background var(--profile-transition),
        transform var(--profile-transition);
}

.profile-stat:hover {
    border-color: var(--profile-border-hover);
    background: var(--profile-panel-hover);
    transform: translateY(-2px);
}

.profile-stat .eyebrow {
    margin-bottom: 16px;

    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.2px;

    color: var(--profile-muted);
}

.profile-stat h3 {
    margin: 0 0 7px;

    font-size: 23px;
    font-weight: 900;
    letter-spacing: -0.5px;

    color: var(--profile-text);

    overflow-wrap: anywhere;
}

.profile-stat h3.good {
    color: var(--profile-green);
}

.profile-stat p {
    margin: 0;

    font-size: 12px;
    line-height: 1.6;

    color: var(--profile-muted);
}

/* ==========================================================
   PROFILE PANELS
   ========================================================== */

.content .section.grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.content .section.grid > .panel {
    min-width: 0;
}

.content .section > .panel {
    border-radius: var(--profile-radius);
}

.content .section .panel h2 {
    margin-top: 0;
    margin-bottom: 18px;

    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.3px;
}

.content .section .panel .detail {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;

    min-width: 0;
    padding: 14px 0;

    border-bottom: 1px solid rgba(
        255, 255, 255, 0.055
    );
}

.content .section .panel .detail:last-of-type {
    border-bottom: none;
}

.content .section .panel .detail > span {
    flex: 0 1 auto;

    font-size: 12px;
    line-height: 1.5;

    color: var(--profile-muted);
}

.content .section .panel .detail > strong {
    min-width: 0;

    font-size: 12px;
    font-weight: 700;
    line-height: 1.5;

    text-align: right;

    color: var(--profile-text);

    overflow-wrap: anywhere;
}

.content .section .panel .detail > strong.good {
    color: var(--profile-green);
}

.content .section .panel .detail > strong.bad {
    color: var(--profile-accent);
}

/* ==========================================================
   PROFILE NOTES
   ========================================================== */

.profile-note {
    margin: 0 0 14px;

    font-size: 12px;
    line-height: 1.7;

    color: var(--profile-muted);
}

.content .panel > .profile-note:not(:first-child) {
    margin-top: 14px;
}

/* ==========================================================
   PROFILE COPY BUTTON
   ========================================================== */

.profile-copy {
    margin-top: 18px;
}

#copyUserId,
#copyRoleId {
    min-height: 38px;

    transition:
        background var(--profile-transition),
        border-color var(--profile-transition),
        transform var(--profile-transition);
}

#copyUserId:hover,
#copyRoleId:hover {
    transform: translateY(-1px);
}

/* ==========================================================
   ROLE INFORMATION
   ========================================================== */

#profileRank,
#overviewRole,
#primaryRole {
    font-weight: 800;
}

#primaryRoleId,
#profileId,
#bannerUserId,
#adminDiscordId {
    font-variant-numeric: tabular-nums;
}

#primaryRoleId {
    color: var(--profile-blue);
}

#roleLevel {
    color: var(--profile-gold);
}

/* ==========================================================
   SITE ADMINISTRATOR SECTION
   ========================================================== */

#siteAdministratorSection .section-heading .eyebrow {
    color: var(--profile-gold);
    margin-bottom: 8px;
}

#siteAdministratorSection .section-heading h2 {
    color: #f5d18d;
}

#siteAdministratorSection > .panel {
    position: relative;
    overflow: hidden;

    border: 1px solid rgba(
        245, 189, 86, 0.25
    );

    background:
        radial-gradient(
            circle at 100% 0%,
            rgba(245, 189, 86, 0.07),
            transparent 40%
        ),
        var(--profile-panel);
}

#siteAdministratorSection > .panel::before {
    content: "";

    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;

    width: 3px;

    background: linear-gradient(
        180deg,
        #f5bd56,
        #ef4055
    );
}

#siteAdministratorSection .detail strong.good {
    color: var(--profile-green);
}

#openAdminPanel {
    margin-top: 16px;

    background: linear-gradient(
        135deg,
        #d89b3d,
        #bd7334
    );

    border: 1px solid rgba(
        245, 189, 86, 0.3
    );

    color: #17110b;
    font-weight: 800;

    transition:
        filter var(--profile-transition),
        transform var(--profile-transition);
}

#openAdminPanel:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

/* ==========================================================
   STAFF NAVIGATION
   ========================================================== */

#staffNavigation {
    margin-top: 18px;
}

#staffNavigation .nav-label {
    color: var(--profile-muted);
}

#staffNavigation .nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

#staffNavigation .nav button {
    width: 100%;
}

#adminPanelNav {
    color: #f5d18d;
}

#adminPanelNav:hover {
    background: rgba(245, 189, 86, 0.08);
}

/* ==========================================================
   QUICK ACTIONS
   ========================================================== */

.profile-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.profile-action {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;

    gap: 9px;

    min-width: 0;
    min-height: 155px;

    padding: 21px;

    text-align: left;
    cursor: pointer;

    border: 1px solid var(--profile-border);
    border-radius: var(--profile-radius);

    background: var(--profile-panel);
    color: var(--profile-text);

    transition:
        background var(--profile-transition),
        border-color var(--profile-transition),
        transform var(--profile-transition),
        box-shadow var(--profile-transition);
}

.profile-action:hover {
    background: var(--profile-panel-hover);
    border-color: #6c3a48;

    transform: translateY(-3px);

    box-shadow: 0 10px 25px rgba(
        0, 0, 0, 0.12
    );
}

.profile-action:active {
    transform: translateY(0);
}

.profile-action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 40px;
    height: 40px;

    margin-bottom: 5px;

    border-radius: 11px;

    background: var(--profile-accent-soft);
    color: var(--profile-accent);

    font-size: 22px;
    font-weight: 800;
}

.profile-action:nth-child(2) .profile-action-icon {
    color: var(--profile-purple);
    background: var(--profile-purple-soft);
}

.profile-action:nth-child(3) .profile-action-icon {
    color: var(--profile-gold);
    background: var(--profile-gold-soft);
}

.profile-action:nth-child(4) .profile-action-icon {
    color: var(--profile-blue);
    background: var(--profile-blue-soft);
}

.profile-action strong {
    font-size: 14px;
    font-weight: 800;

    color: var(--profile-text);
}

.profile-action small {
    font-size: 12px;
    line-height: 1.5;

    color: var(--profile-muted);
}

/* ==========================================================
   SECURITY
   ========================================================== */

#securityAuthStatus,
#securityDiscord,
#securityAccess {
    font-weight: 700;
}

#lastProfileRefresh {
    font-variant-numeric: tabular-nums;
}

/* ==========================================================
   ACCOUNT ACTIONS
   ========================================================== */

.content .section .panel > .row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;

    margin-top: 20px;
}

#refreshAccount,
#copyProfileLink,
#logoutAccount {
    min-height: 39px;
}

/* ==========================================================
   PROFILE LOGIN
   ========================================================== */

.profile-login {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    min-height: 100vh;
    min-height: 100dvh;

    padding: 25px;

    text-align: center;

    background:
        radial-gradient(
            circle at 50% 25%,
            rgba(239, 64, 85, 0.09),
            transparent 40%
        ),
        var(--profile-bg);
}

.profile-login img {
    width: 72px;
    height: 72px;

    border-radius: 18px;
    margin-bottom: 20px;

    object-fit: cover;

    box-shadow: 0 12px 40px rgba(
        0, 0, 0, 0.25
    );
}

.profile-login h1 {
    margin: 0 0 12px;

    font-size: 29px;
    font-weight: 900;
    letter-spacing: -0.8px;

    color: var(--profile-text);
}

.profile-login p {
    max-width: 420px;

    margin: 0;

    color: var(--profile-muted);
    line-height: 1.7;
    font-size: 14px;
}

.profile-login .btn {
    margin-top: 22px;
}

.profile-login .bad {
    margin-top: 18px;
    color: var(--profile-accent);
}

/* ==========================================================
   PROFILE STATUS
   ========================================================== */

#profilePremium,
#profilePremiumPlan,
#profilePremiumExpiry,
#profileSiteAdmin {
    font-weight: 700;
}

#overviewPremium {
    overflow-wrap: anywhere;
}

#bannerAccountStatus {
    color: var(--profile-green);
}

/* ==========================================================
   TOAST NOTIFICATIONS
   ========================================================== */

.toast-container {
    position: fixed;
    top: 22px;
    right: 22px;
    z-index: 9999;

    display: flex;
    flex-direction: column;
    gap: 10px;

    width: min(360px, calc(100vw - 32px));

    pointer-events: none;
}

.toast-container .toast {
    padding: 14px 17px;

    border-radius: 11px;
    border: 1px solid var(--profile-border);

    background: #202027;
    color: var(--profile-text);

    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;

    box-shadow: 0 10px 35px rgba(
        0, 0, 0, 0.25
    );

    overflow-wrap: anywhere;
    pointer-events: auto;
}

.toast-container .toast.success {
    border-color: rgba(34, 197, 94, 0.35);
    background: #15251c;
    color: #b8f4cc;
}

.toast-container .toast.error {
    border-color: rgba(239, 64, 85, 0.35);
    background: #2a171d;
    color: #ffc4cd;
}

.toast-container .toast.info {
    border-color: rgba(96, 165, 250, 0.3);
    background: #192131;
    color: #c9ddff;
}

/* ==========================================================
   RESPONSIVE - LARGE TABLETS
   ========================================================== */

@media (max-width: 1100px) {
    .profile-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .profile-stats {
        gap: 12px;
    }

    .profile-stat {
        padding: 19px;
    }

    .profile-stat h3 {
        font-size: 20px;
    }
}

/* ==========================================================
   RESPONSIVE - TABLETS
   ========================================================== */

@media (max-width: 800px) {
    .profile-banner {
        padding: 24px;
    }

    .profile-hero {
        gap: 18px;
    }

    .profile-hero h2 {
        font-size: 25px;
    }

    .profile-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .content .section.grid {
        grid-template-columns: 1fr;
    }

    .profile-banner-footer {
        margin-top: 23px;
    }
}

/* ==========================================================
   RESPONSIVE - MOBILE
   ========================================================== */

@media (max-width: 600px) {
    .profile-banner {
        padding: 21px;
        border-radius: 15px;
    }

    .profile-hero {
        align-items: flex-start;
        gap: 16px;
    }

    .profile-hero .avatar.large {
        width: 80px;
        height: 80px;

        border-radius: 18px;
        font-size: 29px;
    }

    .profile-hero h2 {
        font-size: 23px;
    }

    .profile-stats {
        grid-template-columns: 1fr;
    }

    .profile-stat {
        min-height: auto;
        padding: 19px;
    }

    .profile-stat .eyebrow {
        margin-bottom: 10px;
    }

    .profile-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 11px;
    }

    .profile-action {
        padding: 16px;
        min-height: 145px;
    }

    .profile-action strong {
        font-size: 13px;
    }

    .profile-action small {
        font-size: 11px;
    }

    .profile-banner-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 9px;
    }

    .content .section .panel .detail {
        align-items: flex-start;
    }

    .content .section .panel .detail > span {
        max-width: 48%;
    }

    .content .section .panel .detail > strong {
        max-width: 52%;
    }

    .content .section .panel > .row .btn {
        flex: 1 1 auto;
    }

    .toast-container {
        top: 12px;
        right: 12px;
    }
}

/* ==========================================================
   RESPONSIVE - SMALL MOBILE
   ========================================================== */

@media (max-width: 480px) {
    .profile-banner {
        padding: 18px;
    }

    .profile-hero .avatar.large {
        width: 76px;
        height: 76px;
    }

    .profile-hero h2 {
        font-size: 21px;
    }

    .profile-hero p {
        font-size: 12px;
    }

    .profile-hero .badge,
    .profile-hero .staff-badge {
        font-size: 10px;
        padding: 5px 8px;
    }

    .profile-actions {
        grid-template-columns: 1fr;
    }

    .profile-action {
        min-height: 90px;
        gap: 6px;
    }

    .profile-action-icon {
        width: 35px;
        height: 35px;
        font-size: 19px;
    }

    .profile-login h1 {
        font-size: 25px;
    }

    .profile-login img {
        width: 64px;
        height: 64px;
    }

    .content .section .panel .detail {
        gap: 10px;
    }

    .content .section .panel .detail > span,
    .content .section .panel .detail > strong {
        font-size: 11px;
    }
}

/* ==========================================================
   ACCESSIBILITY
   ========================================================== */

@media (prefers-reduced-motion: reduce) {
    .profile-banner,
    .profile-stat,
    .profile-action,
    #openAdminPanel,
    #copyUserId,
    #copyRoleId {
        transition: none !important;
        transform: none !important;
    }
}
