/* ============================================
   PROFILE LUXURY CSS - Kaly4cID
   Premium Profile Experience
   ============================================ */

/* ============= CSS VARIABLES ============= */
:root {
    --profile-bg: transparent;
    --profile-card: rgba(20, 20, 35, 0.75);
    --profile-glass: rgba(255, 255, 255, 0.03);
    --profile-border: rgba(255, 255, 255, 0.08);
    --profile-primary: #6366f1;
    --profile-secondary: #ec4899;
    --profile-success: #10b981;
    --profile-warning: #f59e0b;
    --profile-error: #ef4444;
    --profile-text: #ffffff;
    --profile-text-secondary: #9ca3af;
    --profile-gradient: linear-gradient(135deg, #6366f1, #ec4899);
    --profile-glow: 0 0 30px rgba(99, 102, 241, 0.3);
}

body.light-theme {
    --profile-bg: transparent;
    --profile-card: rgba(255, 255, 255, 0.75);
    --profile-glass: rgba(255, 255, 255, 0.5);
    --profile-border: rgba(0, 0, 0, 0.08);
    --profile-text: #1a1a2e;
    --profile-text-secondary: #6b7280;
}

/* ============= PAGE LAYOUT ============= */
.profile-page {
    min-height: 100vh;
    background: var(--profile-bg);
    padding-bottom: 100px;
}

/* ============= HEADER ============= */
.profile-header-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 10, 15, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--profile-border);
    padding: 16px 20px;
}

body.light-theme .profile-header-bar {
    background: rgba(245, 245, 247, 0.7);
}

.profile-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 600px;
    margin: 0 auto;
}

.profile-back-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--profile-glass);
    border: 1px solid var(--profile-border);
    color: var(--profile-text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.profile-back-btn:hover {
    background: var(--profile-primary);
    border-color: var(--profile-primary);
}

.profile-header-title {
    font-size: 1.25rem;
    font-weight: 700;
    background: var(--profile-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.profile-header-actions {
    display: flex;
    gap: 8px;
}

.profile-action-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--profile-glass);
    border: 1px solid var(--profile-border);
    color: var(--profile-text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.profile-action-btn:hover {
    background: var(--profile-primary);
    border-color: var(--profile-primary);
}

.profile-action-btn.active {
    background: var(--profile-error);
    border-color: var(--profile-error);
}

/* ============= PROFILE HERO SECTION ============= */
.profile-hero {
    padding: 30px 20px;
    text-align: center;
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.profile-avatar-wrapper {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
}

.profile-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid transparent;
    background: linear-gradient(var(--profile-bg), var(--profile-bg)) padding-box,
        var(--profile-gradient) border-box;
    box-shadow: 0 10px 40px rgba(99, 102, 241, 0.3);
    transition: all 0.3s ease;
}

.profile-avatar-wrapper:hover .profile-avatar-img {
    transform: scale(1.05);
    box-shadow: 0 15px 50px rgba(99, 102, 241, 0.4);
}

.profile-avatar-overlay {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 36px;
    height: 36px;
    background: var(--profile-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.85rem;
    cursor: pointer;
    border: 3px solid var(--profile-bg);
    transition: all 0.3s ease;
}

.profile-avatar-overlay:hover {
    transform: scale(1.1);
}

.profile-name-display {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--profile-text);
    margin-bottom: 6px;
}

.profile-email-display {
    font-size: 0.9rem;
    color: var(--profile-text-secondary);
}

/* ============= CONTENT ============= */
.profile-content {
    padding: 0 20px;
    max-width: 600px;
    margin: 0 auto;
}

/* ============= SECTION ============= */
.profile-section {
    background: var(--profile-card);
    border-radius: 20px;
    border: 1px solid var(--profile-border);
    padding: 20px;
    margin-bottom: 16px;
}

.profile-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.profile-section-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--profile-text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.profile-section-title i {
    color: var(--profile-primary);
}

.profile-edit-badge {
    padding: 4px 10px;
    background: rgba(99, 102, 241, 0.15);
    color: var(--profile-primary);
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.profile-edit-badge:hover {
    background: var(--profile-primary);
    color: white;
}

/* ============= PROFILE ITEM ============= */
.profile-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--profile-border);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-wrap: wrap;
}

.profile-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.profile-item:first-child {
    padding-top: 0;
}

.profile-item:hover {
    opacity: 0.8;
}

.profile-item-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(99, 102, 241, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--profile-primary);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.profile-item-icon.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--profile-success);
}

.profile-item-icon.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--profile-warning);
}

.profile-item-icon.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--profile-error);
}

.profile-item-content {
    flex: 1;
    min-width: 0;
}

.profile-item-label {
    font-size: 0.75rem;
    color: var(--profile-text-secondary);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-item-value {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--profile-text);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.profile-item-action {
    color: var(--profile-text-secondary);
    font-size: 0.9rem;
}

/* ============= VERIFICATION BADGE ============= */
.verify-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.verify-badge.verified {
    background: rgba(16, 185, 129, 0.15);
    color: var(--profile-success);
}

.verify-badge.unverified {
    background: rgba(239, 68, 68, 0.15);
    color: var(--profile-error);
}

.profile-resend-btn {
    padding: 8px 14px;
    background: var(--profile-primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

.profile-resend-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.profile-resend-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ============= EDIT FORM ============= */
.profile-form {
    display: none;
}

.profile-form.active {
    display: block;
}

.profile-form-group {
    margin-bottom: 16px;
}

.profile-form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--profile-text);
    margin-bottom: 8px;
}

.profile-form-label.required::after {
    content: ' *';
    color: var(--profile-error);
}

.profile-form-input {
    width: 100%;
    padding: 14px 16px;
    background: var(--profile-glass);
    border: 1px solid var(--profile-border);
    border-radius: 12px;
    color: var(--profile-text);
    font-size: 1rem;
    transition: all 0.2s ease;
}

.profile-form-input:focus {
    outline: none;
    border-color: var(--profile-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.profile-form-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.profile-btn-cancel {
    flex: 1;
    padding: 14px 20px;
    background: var(--profile-glass);
    border: 1px solid var(--profile-border);
    border-radius: 12px;
    color: var(--profile-text);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.profile-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.1);
}

.profile-btn-save {
    flex: 2;
    padding: 14px 20px;
    background: var(--profile-gradient);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.profile-btn-save:hover {
    transform: translateY(-2px);
    box-shadow: var(--profile-glow);
}

/* ============= MENU ITEMS ============= */
.profile-menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: var(--profile-card);
    border-radius: 16px;
    border: 1px solid var(--profile-border);
    margin-bottom: 10px;
    cursor: pointer;
    text-decoration: none;
    color: var(--profile-text);
    transition: all 0.2s ease;
}

.profile-menu-item:hover {
    transform: translateX(4px);
    border-color: rgba(99, 102, 241, 0.3);
}

.profile-menu-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.profile-menu-icon.admin {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.2));
    color: #8b5cf6;
}

.profile-menu-icon.settings {
    background: rgba(107, 114, 128, 0.2);
    color: var(--profile-text-secondary);
}

.profile-menu-icon.download {
    background: rgba(16, 185, 129, 0.2);
    color: var(--profile-success);
}

.profile-menu-content {
    flex: 1;
}

.profile-menu-title {
    font-size: 0.95rem;
    font-weight: 600;
}

.profile-menu-subtitle {
    font-size: 0.75rem;
    color: var(--profile-text-secondary);
}

/* ============= LOGOUT BUTTON ============= */
.profile-logout-btn {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.05));
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 16px;
    color: var(--profile-error);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    transition: all 0.3s ease;
}

.profile-logout-btn:hover {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.1));
    transform: translateY(-2px);
}

/* ============= MODAL ============= */
.profile-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.profile-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.profile-modal {
    background: var(--profile-card);
    border-radius: 24px;
    border: 1px solid var(--profile-border);
    max-width: 420px;
    width: 100%;
    padding: 24px;
    transform: translateY(30px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.profile-modal-overlay.active .profile-modal {
    transform: translateY(0) scale(1);
}

.profile-modal-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
}

.profile-modal-icon.primary {
    background: rgba(99, 102, 241, 0.15);
    color: var(--profile-primary);
}

.profile-modal-icon.warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--profile-warning);
}

.profile-modal-icon.success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--profile-success);
}

.profile-modal-title {
    text-align: center;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--profile-text);
    margin-bottom: 8px;
}

.profile-modal-text {
    text-align: center;
    color: var(--profile-text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 20px;
}

.profile-modal-email {
    background: var(--profile-glass);
    border: 1px solid var(--profile-border);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.profile-modal-email i {
    color: var(--profile-primary);
}

.profile-modal-email span {
    word-break: break-all;
    color: var(--profile-text);
}

.profile-modal-actions {
    display: flex;
    gap: 12px;
}

.profile-modal-btn {
    flex: 1;
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.profile-modal-btn.secondary {
    background: var(--profile-glass);
    border: 1px solid var(--profile-border);
    color: var(--profile-text);
}

.profile-modal-btn.primary {
    background: var(--profile-gradient);
    border: none;
    color: white;
}

.profile-modal-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--profile-glow);
}

/* ============= TOAST ============= */
.profile-toast-container {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.profile-toast {
    padding: 14px 24px;
    background: var(--profile-card);
    border: 1px solid var(--profile-border);
    border-radius: 14px;
    color: var(--profile-text);
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    animation: toastSlideIn 0.3s ease;
}

.profile-toast.success {
    border-left: 4px solid var(--profile-success);
}

.profile-toast.success i {
    color: var(--profile-success);
}

.profile-toast.error {
    border-left: 4px solid var(--profile-error);
}

.profile-toast.error i {
    color: var(--profile-error);
}

.profile-toast.warning {
    border-left: 4px solid var(--profile-warning);
}

.profile-toast.warning i {
    color: var(--profile-warning);
}

.profile-toast.info {
    border-left: 4px solid var(--profile-primary);
}

.profile-toast.info i {
    color: var(--profile-primary);
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============= BOTTOM NAV ============= */
.profile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--profile-border);
    padding: 12px 20px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    z-index: 100;
}

body.light-theme .profile-bottom-nav {
    background: rgba(245, 245, 247, 0.95);
}

.profile-nav-content {
    display: flex;
    justify-content: space-around;
    max-width: 500px;
    margin: 0 auto;
}

.profile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--profile-text-secondary);
    text-decoration: none;
    font-size: 0.7rem;
    transition: all 0.2s ease;
    cursor: pointer;
    background: none;
    border: none;
    padding: 8px 16px;
    border-radius: 12px;
}

.profile-nav-item:hover {
    color: var(--profile-text);
}

.profile-nav-item.active {
    color: var(--profile-primary);
    background: rgba(99, 102, 241, 0.1);
}

.profile-nav-item i {
    font-size: 1.25rem;
}

.profile-nav-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--profile-primary);
}

/* ============= LIGHT THEME COMPREHENSIVE ============= */
body.light-theme .profile-item:hover {
    background: rgba(0, 0, 0, 0.02);
}

body.light-theme .profile-avatar-img {
    box-shadow: 0 10px 40px rgba(99, 102, 241, 0.2);
}

body.light-theme .profile-avatar-wrapper:hover .profile-avatar-img {
    box-shadow: 0 15px 50px rgba(99, 102, 241, 0.3);
}

body.light-theme .profile-avatar-overlay {
    border-color: #f5f5f7;
}

body.light-theme .profile-menu-item:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

body.light-theme .profile-modal-overlay {
    background: rgba(0, 0, 0, 0.5);
}

body.light-theme .profile-modal {
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

body.light-theme .profile-modal-email {
    background: rgba(0, 0, 0, 0.03);
}

body.light-theme .profile-form-input {
    background: rgba(0, 0, 0, 0.03);
}

body.light-theme .profile-form-input:focus {
    background: white;
}

body.light-theme .profile-btn-cancel:hover {
    background: rgba(0, 0, 0, 0.05);
}

body.light-theme .profile-toast {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

/* ============= RESPONSIVE ============= */
@media (max-width: 480px) {
    .profile-hero {
        padding: 20px 16px;
    }

    .profile-avatar-wrapper {
        width: 100px;
        height: 100px;
    }

    .profile-modal {
        border-radius: 24px 24px 0 0;
        max-height: 90vh;
        margin-top: auto;
    }

    .profile-modal-overlay {
        align-items: flex-end;
        padding: 0;
    }
}