/* --- THIS IS THE FIX --- */
/* Pushes all account page content down below the fixed header */
body.account-page-body {
    padding-top: 120px;
}
/* --- END FIX --- *//* This adds the missing space between the content and the footer */
main.nexus-container {
    margin-bottom: 50px;
}



/* =================================================================== */
/* --- 1. ACCOUNT PAGE: MAIN LAYOUT & HEADER --- */
/* =================================================================== */

/* This is the main container for the dashboard */
#account-hub-container {
    width: 100%;
    max-width: 1200px; /* Max width of the dashboard */
    margin: 0 auto;
}

.account-hub-header {
    margin-bottom: 30px;
}

.account-hub-header h1 {
    font-size: 2.5rem;
    font-weight: 600;
    color: #fff;
    margin: 0 0 5px 0;
}

.account-hub-header p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

/* =================================================================== */
/* --- 2. ACCOUNT PAGE: "HUB" GRID & CARD BASE --- */
/* =================================================================== */

.account-hub-grid {
    display: grid;
    /* Creates 3 columns, each 1 "fraction" wide */
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

/* Base styles for all cards on the dashboard */
.hub-card {
    background: rgba(15, 17, 26, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Ensures padding/borders look right */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hub-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.hub-card .card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.hub-card .card-header svg {
    width: 20px;
    height: 20px;
    color: #4a90e2; /* Icon accent color */
    flex-shrink: 0;
}

.hub-card .card-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
}

.hub-card .card-body {
    padding: 25px;
    flex-grow: 1; /* Makes the body fill available space */
}

/* A standard intro text for cards */
.hub-card .card-intro-text {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 0;
}

.hub-card .card-footer {
    display: flex;
    justify-content: flex-end; /* Aligns button(s) to the right */
    gap: 10px;
    padding: 20px 25px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: auto; /* Pushes footer to the bottom */
}

/* Base button style for card footers */
.hub-card-button {
    display: inline-block;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 10px 20px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

/* Primary "action" button (e.g., "Manage") */
.hub-card-button.primary {
    background-color: #4a90e2;
    color: #fff;
    border: 1px solid #4a90e2;
}
.hub-card-button.primary:hover {
    background-color: #5aa1f2;
    border-color: #5aa1f2;
    box-shadow: 0 0 15px rgba(74, 144, 226, 0.3);
}

/* Secondary "other" button (e.g., "Preview") */
.hub-card-button.secondary {
    background-color: transparent;
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.3);
}
.hub-card-button.secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.5);
}

/* =================================================================== */
/* --- 3. ACCOUNT PAGE: "HUB" CARD-SPECIFIC STYLES --- */
/* =================================================================== */

/* --- Card 1: Operative Profile --- */
.profile-card-body {
    display: flex;
    flex-direction: column; /* Changed from 'flex' */
    gap: 20px;
}
.profile-card-avatar-wrapper {
    position: relative;
    flex-shrink: 0;
}
.profile-card-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.2);
}
.profile-status-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 3px solid #0f111a; /* Matches the theme background */
    background-color: #6c757d; /* Default: Offline (grey) */
    transition: background-color 0.3s ease;
}

.profile-status-dot.online {
    background-color: #28a745; /* Green */
}
.profile-status-dot.afk {
    background-color: #fd7e14; /* Orange */
}
.profile-status-dot.busy {
    background-color: #f56c6c; /* Red */
}
.profile-status-dot.offline {
    background-color: #6c757d; /* Grey */
}
.profile-card-info {
    display: flex;
    flex-direction: column;
}
.profile-card-info h4 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #fff;
    margin: 0;
}
.profile-card-info span {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.5;
    word-break: break-all;
}
#hub-profile-id {
    font-family: monospace;
    color: #4a90e2;
    font-weight: 500;
}

/* --- Card 2: Security Hub --- */
.security-score-placeholder {
    text-align: center;
    padding: 10px 0 25px 0;
}
.security-score-placeholder span {
    font-size: 2.5rem;
    font-weight: 600;
    color: #67c23a; /* Green for "Strong" */
}
.security-score-placeholder p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}
.security-checklist {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.95rem;
}
.security-checklist li {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
}
.security-checklist li:last-child {
    border-bottom: none;
}
.security-checklist li::after {
    content: attr(data-status);
    font-weight: 600;
    color: #fff;
}
/* We will use JS to set the text and class */
#hub-security-password-status { color: #67c23a; }
#hub-security-2fa-status, #hub-security-passkey-status { color: #f56c6c; }


/* --- Card 3: Public Identity --- */
.identity-checklist {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.identity-checklist li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    padding: 8px 0; /* Add some vertical spacing */
}
.identity-checklist li strong {
    font-weight: 600;
    color: #fff;
    font-size: 1rem;
}
.bio-preview-title {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    margin: 0 0 8px 0;
}
.bio-preview-text {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
    margin: 0;
    line-height: 1.5;
    /* Truncate long bios */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* --- Card 4: Personal Dossier --- */
.dossier-checklist {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.dossier-checklist li {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}
.dossier-checklist li strong {
    color: #fff;
    font-weight: 500;
    margin-left: 5px;
}
.dossier-disclaimer {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 20px;
    margin-bottom: 0;
}

/* --- Card 6: Auxiliary Access --- */
.aux-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.hub-aux-link {
    display: block;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    transition: all 0.2s ease;
}
.hub-aux-link:hover {
    background: rgba(74, 144, 226, 0.1);
    border-color: #4a90e2;
    color: #fff;
}

/* =================================================================== */
/* --- 4. ACCOUNT PAGE: "SPOKE" PAGE STYLES --- */
/* =================================================================== */

.account-spoke-page {
    width: 100%;
    max-width: 1000px; /* Spoke pages can be a bit wider */
    margin: 0 auto;
}

.account-spoke-header {
    margin-bottom: 30px;
}

.spoke-back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s ease;
}
.spoke-back-button:hover {
    color: #fff;
}
.spoke-back-button svg {
    width: 20px;
    height: 20px;
}

/* Placeholder styles (will be replaced) */
.spoke-placeholder-content {
    background: rgba(15, 17, 26, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 100px 40px;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
}
.spoke-placeholder-content h2 {
    color: #fff;
    margin-top: 0;
}


/* =================================================================== */
/* --- 5. RESPONSIVE & UTILITY --- */
/* =================================================================== */

.hidden {
    display: none !important;
}

/* When modals are open, prevent main page from scrolling */
body.custom-modal-open {
    overflow: hidden;
}

/* Tablet */
@media (max-width: 900px) {
    .account-hub-grid {
        /* Switch to 2 columns */
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile */
@media (max-width: 600px) {
    .account-hub-header h1 {
        font-size: 2rem;
    }
    .account-hub-grid {
        /* Switch to 1 column */
        grid-template-columns: 1fr;
    }
    .profile-card-body {
        flex-direction: column;
        text-align: center;
    }
}

/* =================================================================== */
/* --- GLOBAL PROFILE PREVIEW MODAL STYLES (NEW DESIGN) --- */
/* =================================================================== */

.profile-preview-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(9, 10, 15, 0.85);
    backdrop-filter: blur(5px);
    z-index: 6000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    cursor: pointer;
}

.profile-preview-modal-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

#profile-preview-modal-content {
    cursor: default;
    transform: scale(0.95);
    transition: transform 0.3s ease;
    max-width: 90%;
}

.profile-preview-modal-overlay.is-visible #profile-preview-modal-content {
    transform: scale(1);
}

/* --- The Profile Card Design (Popup Only) --- */
.profile-card {
    background: rgba(15, 17, 26, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 340px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.profile-card .card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 0;
    border: none;
}

.profile-card .card-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
    object-fit: cover;
}

.profile-card .card-display-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
}

.profile-card .card-status {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    gap: 8px;
}

.profile-card .status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
/* Status colors are shared globally */
.status-dot.online { background-color: #28a745; }
.status-dot.busy { background-color: #f56c6c; }
.status-dot.afk { background-color: #fd7e14; }
.status-dot.offline { background-color: #6c757d; }

.profile-card .card-bio {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.5;
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 8px;
    min-height: 60px;
    overflow-y: auto;
    max-height: 150px;
}

.profile-card .card-bio::-webkit-scrollbar {
    width: 6px;
}
.profile-card .card-bio::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}
.profile-card .card-bio::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.profile-card .card-bio.is-empty {
    font-style: italic;
    color: rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-card .card-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 15px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.4);
    text-align: center;
    margin: 0;
    background: transparent;
}

/* =================================================================== */
/* --- HUB DASHBOARD SPECIFIC LAYOUTS (RETAINED) --- */
/* =================================================================== */

/* These styles control the layout inside the "Operative Profile" Hub Card */
.profile-card-main {
    display: flex;
    align-items: center;
    gap: 20px;
}

hr.profile-card-divider {
    border: none;
    height: 1px;
    background-color: rgba(255, 255, 255, 0.1);
    margin: 0;
}

.profile-card-public-identity {
    display: flex;
    flex-direction: column;
}

/* --- Placeholder Card Styles --- */
.hub-card-placeholder {
    border: 2px dashed rgba(255, 255, 255, 0.2);
    background: transparent;
    backdrop-filter: none;
    box-shadow: none;
}
.hub-card-placeholder:hover {
    transform: none;
    box-shadow: none;
}
.hub-card-placeholder .card-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 200px;
}
.hub-card-placeholder svg {
    width: 32px;
    height: 32px;
    color: rgba(255, 255, 255, 0.3);
    margin-bottom: 15px;
}
.hub-card-placeholder h3 {
    margin: 0 0 5px 0;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.1rem;
    font-weight: 600;
}
.hub-card-placeholder p {
    margin: 0;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.9rem;
}

/* --- PIN Status Note on Hub Card --- */
.pin-status-note {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #f56c6c; /* Red warning color */
    background: rgba(245, 108, 108, 0.1);
    padding: 3px 6px;
    border-radius: 4px;
    margin-left: 10px;
}
.pin-status-note.hidden {
    display: none;
}
.pin-status-note svg {
    width: 12px;
    height: 12px;
}

/* Make the 2FA and Passkey status list items justify-between */
#hub-security-2fa-status,
#hub-security-passkey-status {
    justify-content: space-between;
}
#hub-security-passkey-status::after {
    content: 'Inactive';
}
/* We hide the '::after' content when the PIN note is shown */
#hub-security-passkey-status[data-status="pin-warning"]::after {
    display: none;
}

/* --- FIX: Active Passkey/Security Status --- */
/* When the status is Active, turn the main text Green */
#hub-security-passkey-status[data-status="Active"] {
    color: #67c23a !important;
}

/* When the status is Active, change the ::after text to 'Active' and make it Green */
#hub-security-passkey-status[data-status="Active"]::after {
    content: 'Active';
    color: #67c23a;
}

/* =================================================================== */
/* --- REDESIGNED SECURITY CARD (MODERN DASHBOARD THEME - GREEN RIPPLE) --- */
/* =================================================================== */

/* 1. The Container */
.security-monitor-body {
    display: flex;
    flex-direction: column;
    gap: 25px; 
    padding: 25px 30px; 
    flex-grow: 1;
}

/* 2. The Hero Section */
.security-hero {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    position: relative;
    /* [FIX] Reduced bottom padding to bring text closer to the grid below */
    padding: 10px 0 0 0;
}

.security-ring-container {
    position: relative;
    width: 90px;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    /* [FIX] Increased margin to 35px so the ripple doesn't hit the text */
    margin-bottom: 35px;
}

/* Rings */
.security-ring {
    position: absolute;
    border-radius: 50%;
    width: 100%;
    height: 100%;
}

/* Static Track (Faint Green) */
.security-ring.inner {
    border: 3px solid rgba(103, 194, 58, 0.1); /* Green tint */
}

/* =================================================================== */
/* --- REACTIVE SECURITY INDICATOR (4-STAGE) & MODULES --- */
/* =================================================================== */

/* --- 1. The Dynamic Ring (States) --- */

/* Base Ring Shape */
.security-ring.outer {
    border: 3px solid transparent; /* Color is set by state class below */
    border-radius: 50%;
    background: transparent;
    transition: all 0.5s ease;
}

/* STATE 1: CRITICAL (0-25%) - Red, Fast Breath */
.security-ring.outer.state-critical {
    border-color: #f56c6c;
    box-shadow: 0 0 15px rgba(245, 108, 108, 0.2);
    animation: breathe-red 1.5s ease-in-out infinite;
}

/* STATE 2: MEDIUM (50%) - Orange, Medium Breath */
.security-ring.outer.state-medium {
    border-color: #fd7e14;
    box-shadow: 0 0 15px rgba(253, 126, 20, 0.2);
    animation: breathe-orange 2.5s ease-in-out infinite;
}

/* STATE 3: HIGH (75%) - Yellow, Slow Breath */
.security-ring.outer.state-high {
    border-color: #e6a23c;
    box-shadow: 0 0 15px rgba(230, 162, 60, 0.2);
    animation: breathe-yellow 3s ease-in-out infinite;
}

/* STATE 4: MAX (100%) - Green, Ripple Active */
.security-ring.outer.state-max {
    border-color: #67c23a;
    box-shadow: 0 0 15px rgba(103, 194, 58, 0.2);
    /* No breathing on the ring itself here; the ripple handles the movement */
}

/* The "Sonar Ripple" Effect (Only visible on .state-max) */
.security-ring.outer::after {
    content: '';
    position: absolute;
    top: -2px; left: -2px; right: -2px; bottom: -2px;
    border: 2px solid #67c23a; 
    border-radius: 50%;
    opacity: 0;
    display: none; /* Hidden by default */
}

.security-ring.outer.state-max::after {
    display: block; /* Show only when secure */
    animation: green-ripple 3s cubic-bezier(0, 0, 0.2, 1) infinite;
}

/* --- 2. Center Icon & Text --- */

.security-hero-icon {
    font-size: 2.2rem;
    color: #fff; /* Default white */
    z-index: 2;
    transition: all 0.3s ease;
}

/* Icon Color Logic */
.security-hero-icon.state-critical { color: #f56c6c; text-shadow: 0 0 20px rgba(245, 108, 108, 0.4); }
.security-hero-icon.state-medium { color: #fd7e14; text-shadow: 0 0 20px rgba(253, 126, 20, 0.4); }
.security-hero-icon.state-high { color: #e6a23c; text-shadow: 0 0 20px rgba(230, 162, 60, 0.4); }
.security-hero-icon.state-max { color: #fff; text-shadow: 0 0 20px rgba(103, 194, 58, 0.5); }

.security-score-text {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* --- 3. The Module Grid (PRESERVED) --- */
.security-modules-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; 
    gap: 12px;
}

.sec-module {
    background: rgba(255, 255, 255, 0.03); 
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
    cursor: default;
}

.sec-module:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.sec-module-icon {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.4);
    transition: all 0.3s ease;
}

.sec-module-icon span {
    font-size: 18px;
}

.sec-module-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
}

.sec-module-label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.sec-module-status {
    font-size: 0.9rem;
    font-weight: 500;
    color: #fff;
}

/* --- 4. Dynamic States for Modules (PRESERVED) --- */

.sec-module.is-active {
    background: rgba(74, 144, 226, 0.08); /* Blue Tint */
    border-color: rgba(74, 144, 226, 0.3);
}
.sec-module.is-active .sec-module-icon {
    color: #fff;
    background: #4a90e2; 
    box-shadow: 0 4px 10px rgba(74, 144, 226, 0.3);
}

.sec-module.is-inactive .sec-module-icon {
    color: rgba(255, 255, 255, 0.3);
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* --- 5. Animations (UPDATED) --- */

@keyframes breathe-red {
    0%, 100% { box-shadow: 0 0 10px rgba(245, 108, 108, 0.2); opacity: 0.7; }
    50% { box-shadow: 0 0 20px rgba(245, 108, 108, 0.6); opacity: 1; }
}

@keyframes breathe-orange {
    0%, 100% { box-shadow: 0 0 10px rgba(253, 126, 20, 0.2); opacity: 0.8; }
    50% { box-shadow: 0 0 20px rgba(253, 126, 20, 0.5); opacity: 1; }
}

@keyframes breathe-yellow {
    0%, 100% { box-shadow: 0 0 10px rgba(230, 162, 60, 0.2); opacity: 0.8; }
    50% { box-shadow: 0 0 20px rgba(230, 162, 60, 0.5); opacity: 1; }
}

@keyframes green-ripple {
    0% { transform: scale(1); opacity: 0.6; border-width: 2px; }
    100% { transform: scale(1.5); opacity: 0; border-width: 0px; }
}

/* Responsive */
@media (max-width: 1100px) {
    .security-modules-grid {
        grid-template-columns: 1fr; 
    }
}