/* ============================================================
   BIOAUREA - User Account & Auth Components
   User nav, dropdowns, account panel (profile, settings)
   ============================================================ */

/* ===== Account Modal Specific Styles ===== */
#account-modal.active {
    align-items: flex-start;
    padding-top: 110px;
}

#account-modal .modal-content {
    max-height: calc(100vh - 100px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#account-modal .modal-header {
    flex-shrink: 0;
    position: sticky;
    top: 0;
    background: var(--bg-card, #111);
    z-index: 10;
    margin-bottom: 0;
    padding: 20px 30px 12px;
}

#account-modal .modal-header .modal-title {
    font-size: 1.4em;
}

#account-modal .account-tabs {
    flex-shrink: 0;
}

#account-modal .account-panel {
    flex: 1;
    overflow-y: auto;
    max-height: calc(100vh - 220px);
    padding: 16px 20px;
}

#account-modal .account-panel::-webkit-scrollbar {
    width: 6px;
}

#account-modal .account-panel::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.02);
    border-radius: 10px;
}

#account-modal .account-panel::-webkit-scrollbar-thumb {
    background: rgba(0,255,136,0.2);
    border-radius: 10px;
}

#account-modal .account-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(0,255,136,0.4);
}

/* ===== User Nav (Logged In) ===== */
.user-nav-wrapper {
    position: relative;
}

.user-nav-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px 6px 6px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(0,255,136,0.25);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
    color: #fff;
}
.user-nav-btn:hover {
    background: rgba(0,255,136,0.08);
    border-color: rgba(0,255,136,0.4);
}

.user-nav-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1fa855, #178a45);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85em;
    color: #000;
    flex-shrink: 0;
}

.user-nav-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.user-nav-name {
    font-size: 0.85em;
    font-weight: 600;
    color: #fff;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-nav-chevron {
    transition: transform 0.3s;
    opacity: 0.6;
    flex-shrink: 0;
}

.user-info-nav { display: flex; align-items: center; gap: 10px; color: #00ff88; font-size: 0.9em; font-weight: 600; }
.user-info-nav .user-email { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-logout { background: transparent; border: 1px solid rgba(255,68,68,0.5); color: #ff6666; padding: 6px 14px; border-radius: 20px; cursor: pointer; font-size: 0.8em; transition: all 0.3s; }
.btn-logout:hover { background: rgba(255,68,68,0.15); border-color: #ff4444; }

/* ===== Role Badges ===== */
.role-badge {
    font-size: 0.65em;
    padding: 1px 8px;
    border-radius: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.role-demo {
    background: rgba(0,255,136,0.15);
    color: #00e07a;
    border: 1px solid rgba(0,255,136,0.3);
}
.role-premium {
    background: rgba(255,215,0,0.15);
    color: #ffd700;
    border: 1px solid rgba(255,215,0,0.3);
}
.role-admin {
    background: rgba(170,102,255,0.15);
    color: #aa66ff;
    border: 1px solid rgba(170,102,255,0.3);
}
.role-anonymous {
    background: rgba(255,255,255,0.08);
    color: #888;
    border: 1px solid rgba(255,255,255,0.15);
}

/* ===== User Dropdown ===== */
.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 280px;
    background: #1a1a1a;
    border: 1px solid rgba(0,255,136,0.2);
    border-radius: 14px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.8);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.97);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10002;
    overflow: hidden;
}
.user-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.user-dropdown-header {
    padding: 12px 16px;
    background: rgba(0,255,136,0.04);
}
.user-dropdown-name {
    font-weight: 700;
    font-size: 0.9em;
    color: #fff;
    margin-bottom: 2px;
}
.user-dropdown-email {
    font-size: 0.78em;
    color: #888;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-dropdown-divider {
    height: 1px;
    background: rgba(255,255,255,0.08);
}

.user-dropdown-item {
    width: 100%;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 9px;
    background: transparent;
    border: none;
    color: #ccc;
    font-size: 0.84em;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}
.user-dropdown-item:hover {
    background: rgba(0,255,136,0.06);
    color: #00e07a;
}
.user-dropdown-item svg {
    flex-shrink: 0;
    opacity: 0.6;
}
.user-dropdown-item:hover svg {
    opacity: 1;
    stroke: #00e07a;
}

.user-dropdown-logout:hover {
    background: rgba(255,68,68,0.08);
    color: #ff6666;
}
.user-dropdown-logout:hover svg {
    stroke: #ff6666;
}

/* ===== Account Modal Tabs & Panels ===== */
.account-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.account-tab {
    flex: 1;
    padding: 10px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: transparent;
    border: none;
    color: #888;
    font-size: 0.82em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    border-bottom: 2px solid transparent;
}
.account-tab.active {
    color: #00e07a;
    border-bottom-color: #00e07a;
    background: rgba(0,255,136,0.04);
}
.account-tab:hover:not(.active) {
    color: #fff;
    background: rgba(255,255,255,0.03);
}
.account-tab svg {
    opacity: 0.6;
}
.account-tab.active svg {
    opacity: 1;
    stroke: #00e07a;
}

.account-panel {
    display: none;
    padding: 20px;
}
.account-panel.active {
    display: block;
}

/* ===== Profile Card ===== */
.account-profile-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(0,255,136,0.03);
    border-radius: 10px;
    border: 1px solid rgba(0,255,136,0.08);
    margin-bottom: 14px;
}

.profile-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1fa855, #178a45);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9em;
    color: #000;
    flex-shrink: 0;
}

.profile-summary {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.profile-name {
    font-weight: 700;
    font-size: 0.95em;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.profile-email {
    font-size: 0.78em;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.profile-role-badge {
    display: inline-block;
    width: fit-content;
    padding: 1px 8px;
    border-radius: 8px;
    font-size: 0.65em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(0,255,136,0.15);
    color: #00e07a;
    border: 1px solid rgba(0,255,136,0.3);
    margin-top: 1px;
}
.profile-role-badge.premium {
    background: rgba(255,215,0,0.15);
    color: #ffd700;
    border-color: rgba(255,215,0,0.3);
}
.profile-role-badge.admin {
    background: rgba(170,102,255,0.15);
    color: #aa66ff;
    border-color: rgba(170,102,255,0.3);
}

/* ===== Account Info Grid ===== */
.account-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 0;
}
.account-info-item {
    padding: 8px 10px;
    background: rgba(255,255,255,0.03);
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.06);
}
.account-info-label {
    font-size: 0.72em;
    color: #666;
    margin-bottom: 3px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.account-info-value {
    font-size: 0.92em;
    color: #fff;
    font-weight: 600;
}

/* ===== Account Edit Form ===== */
.account-edit-form {
    margin-bottom: 10px;
}

.account-info-item.editable {
    position: relative;
}

.account-edit-input {
    width: 100%;
    padding: 7px 9px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 6px;
    color: #fff;
    font-size: 0.85em;
    transition: all 0.2s;
    box-sizing: border-box;
}

.account-edit-input:focus {
    outline: none;
    border-color: rgba(0,255,136,0.4);
    background: rgba(255,255,255,0.07);
}

.account-edit-input::placeholder {
    color: #444;
}

.account-quotas-section {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.quota-value {
    color: #00e07a !important;
    font-weight: 700 !important;
}

.btn-save-profile {
    width: 100%;
    padding: 10px 16px;
    background: linear-gradient(135deg, #1fa855, #178a45);
    border: none;
    border-radius: 8px;
    color: #000;
    font-size: 0.85em;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    margin-top: 12px;
}

.btn-save-profile:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(31, 168, 85, 0.3);
}

.btn-save-profile:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.profile-save-status {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.9em;
    margin-top: 15px;
    text-align: center;
}

.profile-save-status.success {
    background: rgba(0,255,136,0.1);
    color: #00e07a;
    border: 1px solid rgba(0,255,136,0.2);
}

.profile-save-status.error {
    background: rgba(255,68,68,0.1);
    color: #ff6666;
    border: 1px solid rgba(255,68,68,0.2);
}

.profile-save-status.loading {
    background: rgba(255,215,0,0.1);
    color: #ffd700;
    border: 1px solid rgba(255,215,0,0.2);
}

/* ===== Account Password Section ===== */
.account-password-section {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

/* ===== Account Actions ===== */
.account-actions {
    display: flex;
    gap: 10px;
}
.btn-account-action {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: transparent;
    border: 1px solid rgba(255,68,68,0.4);
    border-radius: 10px;
    color: #ff6666;
    font-size: 0.88em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}
.btn-account-action:hover {
    background: rgba(255,68,68,0.1);
    border-color: #ff4444;
}

/* ===== Empty State ===== */
.account-empty-state {
    text-align: center;
    padding: 35px 20px;
}
.account-empty-state svg {
    margin-bottom: 16px;
    opacity: 0.3;
}
.account-empty-state h3 {
    font-size: 1.1em;
    color: #888;
    margin-bottom: 8px;
    font-weight: 700;
}
.account-empty-state p {
    font-size: 0.9em;
    color: #555;
    max-width: 360px;
    margin: 0 auto;
    line-height: 1.5;
}
.account-empty-hint {
    display: inline-block;
    margin-top: 16px;
    padding: 6px 16px;
    background: rgba(255,255,255,0.05);
    border-radius: 20px;
    font-size: 0.8em;
    color: #666;
    border: 1px solid rgba(255,255,255,0.08);
}
