/* ═══════════════════════════════════════════════
   profile.css — Premium Profile Page Styles
   Furtive Apk / Hermesia Project
   ═══════════════════════════════════════════════ */

/* ── CSS Variables ── */
:root {
    --profile-header-height: 64px;
    --profile-accent: #6c5ce7;
    --profile-accent-light: #a29bfe;
    --profile-success: #00b894;
    --profile-warning: #fdcb6e;
    --profile-danger: #e17055;
    --profile-card-bg: rgba(255, 255, 255, 0.06);
    --profile-card-border: rgba(255, 255, 255, 0.08);
    --profile-glass-bg: rgba(30, 30, 40, 0.85);
    --profile-glass-border: rgba(255, 255, 255, 0.12);
    --profile-text-primary: #ffffff;
    --profile-text-secondary: rgba(255, 255, 255, 0.6);
    --profile-radius: 16px;
    --profile-radius-sm: 10px;
    --profile-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --profile-transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset & Global ── */
body.dark-background {
    background: linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 50%, #0a0a0f 100%);
    color: var(--profile-text-primary);
    min-height: 100vh;
}

body.light-background {
    background: linear-gradient(135deg, #f0f2f5 0%, #e8ecf1 50%, #f0f2f5 100%);
}

/* ══════════════════════════════════════════════
   HEADER — Clean, Glassmorphism Navbar
   ══════════════════════════════════════════════ */
.header {
    background: var(--profile-glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--profile-glass-border);
    padding: 0;
    height: var(--profile-header-height);
    z-index: 1000;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.25rem;
    height: 100%;
}

.left-side {
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
}

.star-logo {
    height: 32px;
    width: auto;
    filter: drop-shadow(0 0 8px rgba(108, 92, 231, 0.4));
    transition: transform var(--profile-transition), filter var(--profile-transition);
}

.star-logo:hover {
    transform: rotate(15deg) scale(1.1);
    filter: drop-shadow(0 0 12px rgba(108, 92, 231, 0.7));
}

.sitename {
    font-family: 'Nunito', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--profile-text-primary);
    margin: 0;
    letter-spacing: -0.02em;
}

.right-side {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

/* ── Profile Dropdown ── */
.profile-section {
    position: relative;
    display: flex;
    align-items: center;
}

#profileImage {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    object-fit: cover;
    border: 2px solid rgba(108, 92, 231, 0.5);
    box-shadow: 0 0 0 0 rgba(108, 92, 231, 0);
    transition: all var(--profile-transition);
}

#profileImage:hover {
    border-color: var(--profile-accent);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.25);
    transform: scale(1.05);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--profile-glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--profile-glass-border);
    border-radius: var(--profile-radius-sm);
    box-shadow: var(--profile-shadow);
    min-width: 180px;
    display: none;
    z-index: 1001;
    overflow: hidden;
    animation: dropdownSlide 0.2s ease-out;
}

@keyframes dropdownSlide {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-menu.show {
    display: block;
}

#logoutButton {
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--profile-text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background var(--profile-transition);
    font-family: 'Inter', sans-serif;
}

#logoutButton:hover {
    background: rgba(255, 255, 255, 0.08);
}

#logoutButton i {
    font-size: 1rem;
    color: var(--profile-danger);
}

/* ══════════════════════════════════════════════
   MAIN CONTENT
   ══════════════════════════════════════════════ */
.profile-main {
    max-width: 600px;
    margin: 0 auto;
    padding: calc(var(--profile-header-height) + 2rem) 1.25rem 3rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ── Profile Hero Card ── */
.profile-hero-card {
    position: relative;
    border-radius: var(--profile-radius);
    overflow: hidden;
    background: var(--profile-card-bg);
    border: 1px solid var(--profile-card-border);
    padding: 2.5rem 1.5rem 2rem;
    text-align: center;
    box-shadow: var(--profile-shadow);
}

.profile-hero-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.15) 0%, rgba(162, 155, 254, 0.08) 50%, rgba(0, 184, 148, 0.1) 100%);
    z-index: 0;
}

.profile-hero-bg::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(108, 92, 231, 0.12) 0%, transparent 70%);
    animation: floatOrb 8s ease-in-out infinite;
}

@keyframes floatOrb {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-30px, 20px) scale(1.1); }
}

.profile-avatar-wrapper {
    position: relative;
    display: inline-block;
    z-index: 1;
    margin-bottom: 1rem;
}

.profile-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(108, 92, 231, 0.5);
    box-shadow: 0 4px 20px rgba(108, 92, 231, 0.3);
    transition: transform var(--profile-transition), box-shadow var(--profile-transition);
}

.profile-avatar-large:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 28px rgba(108, 92, 231, 0.45);
}

.profile-avatar-ring {
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    border: 2px solid transparent;
    background: linear-gradient(135deg, var(--profile-accent), var(--profile-success)) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: ringPulse 3s ease-in-out infinite;
}

@keyframes ringPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.profile-hero-info {
    position: relative;
    z-index: 1;
}

.profile-hero-name {
    font-family: 'Nunito', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--profile-text-primary);
    margin: 0 0 0.35rem;
    letter-spacing: -0.01em;
}

.profile-hero-email {
    font-family: 'Roboto', sans-serif;
    font-size: 0.9rem;
    color: var(--profile-text-secondary);
    margin: 0;
}

/* ══════════════════════════════════════════════
   TABS
   ══════════════════════════════════════════════ */
.tabs-container {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.tabs {
    position: relative;
    display: flex;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--profile-card-border);
    border-radius: var(--profile-radius) var(--profile-radius) 0 0;
    padding: 4px;
    list-style: none;
    margin: 0;
}

.tab {
    flex: 1;
    padding: 0.85rem 1rem;
    text-align: center;
    cursor: pointer;
    position: relative;
    z-index: 2;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: var(--profile-text-secondary);
    transition: color var(--profile-transition);
    user-select: none;
}

.tab.active {
    color: var(--profile-text-primary);
}

.tab:hover:not(.active) {
    color: rgba(255, 255, 255, 0.8);
}

.marker {
    position: absolute;
    height: calc(100% - 8px);
    width: calc(100% - 8px);
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.3), rgba(108, 92, 231, 0.15));
    border: 1px solid rgba(108, 92, 231, 0.3);
    top: 4px;
    left: 4px;
    border-radius: calc(var(--profile-radius) - 4px);
    transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 12px rgba(108, 92, 231, 0.15);
}

/* ── Tab Content ── */
.tab-content {
    display: none;
    background: var(--profile-card-bg);
    border: 1px solid var(--profile-card-border);
    border-top: none;
    border-radius: 0 0 var(--profile-radius) var(--profile-radius);
    box-shadow: var(--profile-shadow);
}

.tab-content.active {
    display: block;
    animation: tabFadeIn 0.4s ease;
}

@keyframes tabFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.tab-content-inner {
    padding: 1.5rem;
}

/* ── Status Badge ── */
.status-badge-wrapper {
    margin-bottom: 1rem;
}

.status-badge {
    display: inline-block;
    padding: 0.4rem 1.2rem;
    border-radius: 50px;
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: rgba(253, 203, 110, 0.15);
    color: var(--profile-warning);
    border: 1px solid rgba(253, 203, 110, 0.25);
}

/* ── Device Info ── */
.device-info {
    font-family: 'Roboto', sans-serif;
    font-size: 0.8rem;
    color: var(--profile-text-secondary);
    margin-bottom: 1.25rem;
    padding: 0;
    min-height: 1.2em;
}

/* ── Access Section ── */
.access-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.access-section h3 {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--profile-text-secondary);
    margin: 0;
}

.email-display {
    font-family: 'Roboto', sans-serif;
    font-size: 0.9rem;
    color: var(--profile-text-primary);
    margin: 0;
    padding: 0;
    opacity: 0.85;
}

/* ── Password Input ── */
.password-container {
    position: relative;
    margin-top: 0.25rem;
}

.password-input {
    width: 100%;
    padding: 0.75rem 1rem;
    padding-right: 3rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--profile-radius-sm);
    font-family: 'Roboto', sans-serif;
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.04);
    color: var(--profile-text-primary);
    transition: all var(--profile-transition);
    outline: none;
    box-sizing: border-box;
}

.password-input:focus {
    border-color: var(--profile-accent);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.15);
    background: rgba(255, 255, 255, 0.06);
}

.password-input::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

.toggle-password {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--profile-text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    transition: color var(--profile-transition);
    font-size: 0.95rem;
}

.toggle-password:hover {
    color: var(--profile-accent-light);
}

/* ── Save Button ── */
.save-button {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--profile-accent), var(--profile-accent-light));
    color: white;
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: var(--profile-radius-sm);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--profile-transition);
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.3);
    margin-top: 0.5rem;
}

.save-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 92, 231, 0.45);
}

.save-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(108, 92, 231, 0.3);
}

/* ── Saved Messages ── */
#passSaved,
#passSaved2 {
    display: none;
    color: var(--profile-success);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    text-align: center;
    margin: 0.5rem 0 0;
    padding: 0.5rem;
    background: rgba(0, 184, 148, 0.1);
    border-radius: var(--profile-radius-sm);
    border: 1px solid rgba(0, 184, 148, 0.2);
    animation: savedPop 0.3s ease;
}

@keyframes savedPop {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* ══════════════════════════════════════════════
   TRANSFER BUTTON
   ══════════════════════════════════════════════ */
.ver-transferencias {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.9rem 1.5rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    background: linear-gradient(135deg, rgba(0, 184, 148, 0.15), rgba(0, 184, 148, 0.08));
    color: var(--profile-success);
    border: 1px solid rgba(0, 184, 148, 0.25);
    border-radius: var(--profile-radius);
    cursor: pointer;
    transition: all var(--profile-transition);
    box-shadow: 0 4px 16px rgba(0, 184, 148, 0.1);
}

.ver-transferencias:hover {
    background: linear-gradient(135deg, rgba(0, 184, 148, 0.25), rgba(0, 184, 148, 0.15));
    border-color: rgba(0, 184, 148, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 184, 148, 0.2);
}

.ver-transferencias:active {
    transform: translateY(0);
}

/* ══════════════════════════════════════════════
   MODAL
   ══════════════════════════════════════════════ */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    overflow: auto;
    padding-top: 80px;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    display: block;
    background: var(--profile-glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--profile-glass-border);
    color: var(--profile-text-primary);
    margin: auto;
    padding: 2rem;
    border-radius: var(--profile-radius);
    width: 90%;
    max-width: 440px;
    text-align: center;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
    font-family: 'Inter', sans-serif;
}

.close {
    color: var(--profile-text-secondary);
    float: right;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: color var(--profile-transition);
    line-height: 1;
}

.close:hover,
.close:focus {
    color: var(--profile-text-primary);
}

.modal-message {
    font-size: 1rem;
    margin-top: 1rem;
    color: var(--profile-text-secondary);
}

.modal-button {
    background: linear-gradient(135deg, var(--profile-danger), #e84393);
    border: none;
    color: white;
    padding: 10px 24px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--profile-radius-sm);
    cursor: pointer;
    transition: all var(--profile-transition);
}

.modal-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(225, 112, 85, 0.3);
}

/* ══════════════════════════════════════════════
   SPINNER OVERLAY
   ══════════════════════════════════════════════ */
.spinner-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 10, 15, 0.95);
}

.spinner-overlay .spinner {
    width: 48px;
    height: 48px;
    animation: spinnerRotate 1.2s ease-in-out infinite;
}

@keyframes spinnerRotate {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.15); }
    100% { transform: rotate(360deg) scale(1); }
}

/* ══════════════════════════════════════════════
   LIGHT MODE OVERRIDES
   ══════════════════════════════════════════════ */
body.light-background .header {
    background: rgba(255, 255, 255, 0.85);
    border-bottom-color: rgba(0, 0, 0, 0.06);
}

body.light-background .sitename {
    color: #1a1a2e;
}

body.light-background .profile-hero-card {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, 0.06);
}

body.light-background .profile-hero-name {
    color: #1a1a2e;
}

body.light-background .profile-hero-email {
    color: rgba(26, 26, 46, 0.55);
}

body.light-background .tabs {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.06);
}

body.light-background .tab {
    color: rgba(26, 26, 46, 0.5);
}

body.light-background .tab.active {
    color: #1a1a2e;
}

body.light-background .tab-content {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, 0.06);
}

body.light-background .access-section {
    border-top-color: rgba(0, 0, 0, 0.06);
}

body.light-background .access-section h3 {
    color: rgba(26, 26, 46, 0.5);
}

body.light-background .email-display {
    color: #1a1a2e;
}

body.light-background .password-input {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.1);
    color: #1a1a2e;
}

body.light-background .password-input:focus {
    border-color: var(--profile-accent);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.1);
}

body.light-background .password-input::placeholder {
    color: rgba(26, 26, 46, 0.3);
}

body.light-background .toggle-password {
    color: rgba(26, 26, 46, 0.4);
}

body.light-background .dropdown-menu {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.08);
}

body.light-background #logoutButton {
    color: #1a1a2e;
}

body.light-background #logoutButton:hover {
    background: rgba(0, 0, 0, 0.04);
}

body.light-background .device-info {
    color: rgba(26, 26, 46, 0.5);
}

body.light-background .modal-content {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.08);
    color: #1a1a2e;
}

body.light-background .close {
    color: rgba(26, 26, 46, 0.4);
}

body.light-background .close:hover {
    color: #1a1a2e;
}

body.light-background .modal-message {
    color: rgba(26, 26, 46, 0.65);
}

body.light-background .spinner-overlay {
    background: rgba(240, 242, 245, 0.95);
}

/* ══════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════ */

/* Tablet */
@media (max-width: 768px) {
    .profile-main {
        padding-top: calc(var(--profile-header-height) + 1.5rem);
        padding-left: 1rem;
        padding-right: 1rem;
        gap: 1.25rem;
    }

    .profile-hero-card {
        padding: 2rem 1.25rem 1.5rem;
    }

    .profile-avatar-large {
        width: 68px;
        height: 68px;
    }

    .profile-hero-name {
        font-size: 1.2rem;
    }

    .tab {
        padding: 0.75rem 0.75rem;
        font-size: 0.8rem;
    }

    .tab-content-inner {
        padding: 1.25rem;
    }
}

/* Mobile */
@media (max-width: 480px) {
    :root {
        --profile-header-height: 56px;
    }

    .header-container {
        padding: 0 0.75rem;
    }

    .star-logo {
        height: 26px;
    }

    .sitename {
        font-size: 1rem;
    }

    #profileImage {
        width: 32px;
        height: 32px;
    }

    .profile-main {
        padding-top: calc(var(--profile-header-height) + 1rem);
        padding-left: 0.75rem;
        padding-right: 0.75rem;
        gap: 1rem;
    }

    .profile-hero-card {
        padding: 1.75rem 1rem 1.25rem;
        border-radius: 12px;
    }

    .profile-avatar-large {
        width: 60px;
        height: 60px;
    }

    .profile-hero-name {
        font-size: 1.1rem;
    }

    .profile-hero-email {
        font-size: 0.82rem;
    }

    .tabs {
        border-radius: 12px 12px 0 0;
    }

    .tab {
        padding: 0.7rem 0.5rem;
        font-size: 0.78rem;
    }

    .marker {
        border-radius: 8px;
    }

    .tab-content {
        border-radius: 0 0 12px 12px;
    }

    .tab-content-inner {
        padding: 1rem;
    }

    .status-badge {
        font-size: 0.72rem;
        padding: 0.35rem 1rem;
    }

    .password-input {
        padding: 0.65rem 0.85rem;
        padding-right: 2.5rem;
        font-size: 0.9rem;
    }

    .save-button {
        width: 100%;
        align-self: stretch;
        text-align: center;
        padding: 0.7rem;
    }

    .ver-transferencias {
        border-radius: 12px;
        padding: 0.8rem 1rem;
        font-size: 0.85rem;
    }

    .modal-content {
        width: 92%;
        padding: 1.5rem;
        border-radius: 12px;
    }

    .dropdown-menu {
        min-width: 160px;
        right: -4px;
    }
}

/* Very small screens */
@media (max-width: 360px) {
    .sitename {
        font-size: 0.9rem;
    }

    .logo {
        gap: 0.45rem;
    }

    .star-logo {
        height: 22px;
    }

    .right-side {
        gap: 0.4rem;
    }

    .profile-hero-name {
        font-size: 1rem;
    }
}