/* =========================================
   EASY3D - User Profile Styles
   ========================================= */

html.profile-page, body.profile-page { font-family: var(--font-main) !important; display: flex; flex-direction: column; min-height: 100vh; margin: 0; overflow-x: clip !important; }
body.profile-page input, body.profile-page button, body.profile-page select, body.profile-page textarea { font-family: var(--font-main) !important; }
.profile-main { flex: 1 0 auto; padding-top: 115px; padding-bottom: 7rem; display: flex; flex-direction: column; box-sizing: border-box; }
.profile-layout { display: flex; gap: 2rem; max-width: 1200px; margin: 0 auto; width: 95%; align-items: flex-start; flex: 1 0 auto; }

/* Sidebar - Sticky Positioning Fix */
.profile-sidebar {
    flex: 0 0 280px;
    padding: 1.5rem 1.2rem;
    border-radius: 24px;
    position: sticky !important;
    top: 95px !important;
    align-self: flex-start !important;
    z-index: 50;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.sidebar-header { margin-bottom: 1.2rem; padding-bottom: 0.8rem; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.sidebar-header h3 { margin: 0; color: var(--text-primary); font-size: 1.25rem; font-weight: 700; }
.sidebar-nav { display: flex; flex-direction: column; gap: 0.4rem; }

.sidebar-nav-item {
    display: flex; align-items: center; gap: 0.9rem; padding: 0.85rem 1.1rem;
    color: var(--text-secondary); text-decoration: none; border-radius: 16px; transition: all 0.3s ease;
    font-weight: 500; background: transparent; border: 1px solid transparent; cursor: pointer;
    font-size: 0.95rem; width: 100%; box-sizing: border-box; text-align: left;
}

.sidebar-nav-item i { font-size: 1.1rem; width: 24px; text-align: center; }
.sidebar-nav-item:hover { background: rgba(255, 255, 255, 0.05); color: var(--text-primary); border-color: rgba(255, 255, 255, 0.1); }
.sidebar-nav-item.active {
    background: rgba(0, 229, 255, 0.12); color: var(--accent-cyan);
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.25); font-weight: 700; border-color: rgba(0, 229, 255, 0.4);
}

.sidebar-logout-btn {
    display: flex; align-items: center; gap: 0.9rem; padding: 0.85rem 1.1rem;
    color: rgba(255, 77, 77, 0.85); border-radius: 16px; transition: all 0.3s ease;
    font-weight: 600; background: rgba(255, 77, 77, 0.06); border: 1px solid rgba(255, 77, 77, 0.18);
    cursor: pointer; font-size: 0.95rem; width: 100%; box-sizing: border-box; text-align: left;
}
.sidebar-logout-btn i { font-size: 1.1rem; width: 24px; text-align: center; color: #ff4d4d; }
.sidebar-logout-btn:hover {
    background: rgba(255, 77, 77, 0.16); color: #ff4d4d; border-color: rgba(255, 77, 77, 0.4);
    box-shadow: 0 0 18px rgba(255, 77, 77, 0.25); transform: translateY(-1px);
}

/* Content Area */
.profile-content { flex: 1; min-width: 0; }
.tab-content { display: none; }
.tab-content.active { display: block; animation: profileFadeIn 0.35s ease; }

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

.content-title { font-size: 1.7rem; font-weight: 800; margin-bottom: 1.5rem; color: var(--text-primary); letter-spacing: -0.02em; }

/* Order Items Accordion Animation */
.order-accordion-wrapper {
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    transition: grid-template-rows 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease;
}
.order-accordion-wrapper.active {
    grid-template-rows: 1fr;
    opacity: 1;
}

/* Profile Cards */
.profile-card {
    background: rgba(255, 255, 255, 0.02); border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 24px; padding: 1.6rem; margin-bottom: 1.2rem; backdrop-filter: blur(10px);
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease; max-width: 900px;
}

.profile-card:hover, .support-main-card:hover, .contact-card-full:hover {
    border-color: rgba(0, 229, 255, 0.5); box-shadow: 0 0 25px rgba(0, 229, 255, 0.2), inset 0 0 15px rgba(0, 229, 255, 0.05);
    transform: translateY(-3px);
}

.profile-card-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 1.2rem; border-bottom: 1px solid rgba(255, 255, 255, 0.05); padding-bottom: 0.8rem;
}

.profile-card-title { font-size: 1.2rem; font-weight: 700; color: var(--text-primary); margin: 0; }

.btn-edit {
    background: none; border: 1px solid transparent; color: var(--accent-cyan); font-weight: 600;
    font-size: 0.9rem; cursor: pointer; display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.35rem 0.75rem; border-radius: 12px; transition: all 0.3s ease;
}

.btn-edit:hover { background: rgba(0, 229, 255, 0.12); border-color: rgba(0, 229, 255, 0.3); box-shadow: 0 0 15px rgba(0, 229, 255, 0.25); }

.profile-fields-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem; max-width: 850px; }
.profile-field-item { display: flex; flex-direction: column; gap: 0.35rem; width: 100%; }
.profile-field-label { font-size: 0.85rem; color: var(--text-secondary); font-weight: 500; }
.profile-field-value { font-size: 1rem; color: var(--text-primary); font-weight: 600; min-height: 2.2rem; display: flex; align-items: center; width: 100%; }

.profile-input-wrapper { display: flex; flex-direction: column; width: 100%; position: relative; }

.profile-input-edit {
    width: 100%; padding: 0.7rem 0.9rem; border-radius: 14px; background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15); color: var(--text-primary); font-family: inherit;
    font-size: 0.95rem; box-sizing: border-box; transition: all 0.3s ease;
}

.profile-input-edit:focus { outline: none; border-color: var(--accent-cyan); box-shadow: 0 0 18px rgba(0, 229, 255, 0.3); background: rgba(0, 0, 0, 0.6); }

.phone-edit-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    width: 100%;
}
.phone-edit-row .profile-input-edit {
    flex: 1;
    min-width: 0;
}

@media (max-width: 600px) {
    .phone-edit-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.65rem;
    }
    .phone-edit-row .btn-verify-phone-tg {
        width: 100%;
        margin-left: 0;
        justify-content: center;
    }
}

/* Phone Verify Button & Badge Right Alignment */
.btn-verify-phone-tg {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem;
    background: linear-gradient(135deg, rgba(0, 136, 204, 0.18), rgba(0, 229, 255, 0.12));
    border: 1px solid rgba(0, 136, 204, 0.45); color: #ffffff !important;
    padding: 0.55rem 1.15rem; border-radius: 50px; font-size: 0.9rem; font-weight: 600;
    cursor: pointer; transition: all 0.3s ease; text-decoration: none; margin-left: auto;
    box-shadow: 0 0 15px rgba(0, 136, 204, 0.15); white-space: nowrap;
}

.btn-verify-phone-tg:hover {
    background: linear-gradient(135deg, rgba(0, 136, 204, 0.3), rgba(0, 229, 255, 0.2));
    color: #ffffff !important; border-color: rgba(0, 229, 255, 0.6);
    box-shadow: 0 0 20px rgba(0, 136, 204, 0.35); transform: translateY(-1px);
}

.btn-verify-phone-tg i { color: #00e5ff !important; font-size: 1.05rem; }
.btn-verify-phone-tg span { color: #ffffff !important; font-weight: 600; }

.phone-verified-badge {
    display: inline-flex; align-items: center; gap: 0.35rem; color: #00e5ff;
    font-size: 1.05rem; filter: drop-shadow(0 0 6px rgba(0, 229, 255, 0.6));
}

.btn-reset-phone-tg {
    background: transparent; border: none; color: var(--text-secondary);
    font-size: 1.05rem; cursor: pointer; padding: 0.2rem 0.35rem; line-height: 1;
    transition: all 0.2s ease; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%; margin-left: 0.3rem;
}
.btn-reset-phone-tg:hover {
    color: #ff4d4d !important; background: rgba(255, 77, 77, 0.15); transform: scale(1.15);
}

/* Clear Input Button (X) */
.btn-input-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    font-size: 0.9rem;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    z-index: 10;
}

.btn-input-clear:hover {
    color: #ff4d4d !important;
    background: rgba(255, 77, 77, 0.15);
    transform: translateY(-50%) scale(1.12);
}

.phone-verifying-container {
    display: inline-flex; align-items: center; gap: 0.6rem; margin-left: auto;
}
.phone-verifying-badge {
    display: inline-flex; align-items: center; gap: 0.5rem; background: rgba(0, 229, 255, 0.08);
    border: 1px solid rgba(0, 229, 255, 0.25); color: #00e5ff; padding: 0.45rem 0.9rem;
    border-radius: 30px; font-size: 0.85rem; font-weight: 600; box-shadow: 0 0 12px rgba(0, 229, 255, 0.1);
    backdrop-filter: blur(8px);
}
.btn-cancel-verify-tg {
    display: inline-flex; align-items: center; gap: 0.35rem; background: rgba(255, 77, 77, 0.08);
    border: 1px solid rgba(255, 77, 77, 0.25); color: #ff6b6b !important; padding: 0.45rem 0.85rem;
    border-radius: 30px; font-size: 0.85rem; font-weight: 600; cursor: pointer; backdrop-filter: blur(8px);
    transition: all 0.25s ease;
}
.btn-cancel-verify-tg:hover {
    background: rgba(255, 77, 77, 0.22); border-color: rgba(255, 77, 77, 0.5); color: #ff4d4d !important;
    box-shadow: 0 0 12px rgba(255, 77, 77, 0.2); transform: translateY(-1px);
}

/* Custom Dropdown Select & Nova Poshta Dropdown Fix */
.profile-custom-select { position: relative; width: 100%; }

.profile-select-trigger {
    width: 100%; padding: 0.65rem 0.8rem; border-radius: 14px; background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15); color: var(--text-primary); font-size: 0.95rem;
    cursor: pointer; display: flex; justify-content: space-between; align-items: center;
    box-sizing: border-box; transition: all 0.3s ease; font-weight: 500; gap: 0.4rem;
}

.profile-select-trigger span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.88rem;
    flex: 1;
    min-width: 0;
}

.profile-select-trigger:hover, .profile-custom-select.open .profile-select-trigger {
    border-color: var(--accent-cyan); box-shadow: 0 0 15px rgba(0, 229, 255, 0.3); background: rgba(0, 0, 0, 0.6);
}

.profile-select-trigger i { color: var(--accent-cyan); transition: transform 0.3s ease; font-size: 0.85rem; }
.profile-custom-select.open .profile-select-trigger i { transform: rotate(180deg); }

.profile-select-options, body .np-dropdown {
    position: absolute !important; top: calc(100% + 6px) !important; left: 0 !important; right: 0 !important;
    background: #0b0f19 !important; border: 1px solid rgba(0, 229, 255, 0.4) !important;
    border-radius: 16px !important; z-index: 500 !important; overflow-y: auto !important;
    max-height: 200px !important; box-shadow: 0 12px 35px rgba(0, 0, 0, 0.95), 0 0 20px rgba(0, 229, 255, 0.25) !important;
    overscroll-behavior: contain !important; touch-action: pan-y !important; pointer-events: auto !important;
}

.profile-select-option, body .np-dropdown-item {
    padding: 0.75rem 1rem; color: var(--text-primary) !important; font-size: 0.92rem;
    cursor: pointer; transition: all 0.2s ease; background: #0b0f19 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.profile-select-option:hover, body .np-dropdown-item:hover {
    background: rgba(0, 229, 255, 0.15) !important; color: var(--accent-cyan) !important;
}

.profile-select-option.selected { background: rgba(0, 229, 255, 0.2) !important; color: var(--accent-cyan) !important; font-weight: 700; }

/* Empty Cart Drawer Styling */
.empty-cart-container {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; padding: 2.5rem 1.2rem;
}

.empty-cart-icon {
    width: 76px; height: 76px; background: rgba(0, 229, 255, 0.08);
    border: 1px solid rgba(0, 229, 255, 0.25); border-radius: 50%; display: flex;
    align-items: center; justify-content: center; font-size: 2.2rem; color: var(--accent-cyan);
    margin-bottom: 1.2rem; box-shadow: 0 0 25px rgba(0, 229, 255, 0.2);
    animation: emptyCartFloat 3s ease-in-out infinite;
}

@keyframes emptyCartFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.empty-cart-title { font-size: 1.25rem; font-weight: 800; color: var(--text-primary); margin: 0 0 0.4rem 0; }
.empty-cart-sub { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.5; margin: 0 0 1.6rem 0; max-width: 240px; }

.btn-empty-cart-catalog {
    display: inline-flex; align-items: center; gap: 0.6rem; background: rgba(0, 229, 255, 0.12);
    border: 1px solid rgba(0, 229, 255, 0.35); color: var(--accent-cyan); padding: 0.7rem 1.5rem;
    border-radius: 30px; font-weight: 700; font-size: 0.9rem; text-decoration: none; transition: all 0.3s ease;
}

.btn-empty-cart-catalog:hover {
    background: rgba(0, 229, 255, 0.25); border-color: var(--accent-cyan);
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.35); transform: translateY(-2px);
}

/* Support Tab */
.support-main-card {
    background: rgba(255, 255, 255, 0.02); border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 24px; padding: 2.5rem 2rem; text-align: center; display: flex; flex-direction: column;
    align-items: center; backdrop-filter: blur(10px); margin-bottom: 1.5rem; transition: all 0.3s ease;
}

.support-tg-icon {
    width: 70px; height: 70px; background: #0088cc; border-radius: 50%; display: flex;
    align-items: center; justify-content: center; font-size: 2.2rem; color: white; margin-bottom: 1.2rem;
    box-shadow: 0 0 25px rgba(0, 136, 204, 0.4);
}

.btn-tg-support {
    display: inline-flex; align-items: center; gap: 0.8rem; background: #0088cc; color: white;
    text-decoration: none; padding: 0.9rem 2.2rem; border-radius: 50px; font-weight: 700;
    font-size: 1rem; transition: all 0.3s ease; box-shadow: 0 4px 15px rgba(0,136,204,0.3);
}

.btn-tg-support:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(0,136,204,0.5); }

.contact-card-full {
    background: rgba(255, 255, 255, 0.02); border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px; padding: 2rem 1.5rem; text-align: center; display: flex; flex-direction: column;
    align-items: center; justify-content: center; backdrop-filter: blur(10px); transition: all 0.3s ease;
}

.contact-card-full i.fa-envelope { font-size: 2rem; color: var(--accent-cyan); margin-bottom: 0.6rem; }
.contact-card-full h4 { font-size: 1.1rem; color: var(--text-primary); font-weight: 700; margin: 0 0 0.4rem 0; }
.support-email-val { font-size: 1.15rem; color: var(--text-primary); font-weight: 700; margin-bottom: 1.2rem; word-break: break-all; }

.btn-copy-email {
    background: rgba(0, 229, 255, 0.1); border: 1px solid rgba(0, 229, 255, 0.3); color: var(--accent-cyan);
    padding: 0.5rem 1.4rem; border-radius: 30px; font-weight: 600; font-size: 0.9rem; cursor: pointer;
    display: inline-flex; align-items: center; gap: 0.5rem; transition: all 0.3s ease;
}

.btn-copy-email:hover { background: rgba(0, 229, 255, 0.22); border-color: var(--accent-cyan); box-shadow: 0 0 15px rgba(0, 229, 255, 0.3); transform: translateY(-1px); }

/* Responsive (Stack Navigation for Mobile) */
@media (max-width: 768px) {
    .profile-layout {
        flex-direction: column;
        gap: 0;
        align-items: stretch;
        width: 100%;
        padding: 0 1rem;
        box-sizing: border-box;
    }
    
    .profile-content {
        padding: 0;
        box-sizing: border-box;
        width: 100%;
    }
    
    /* Default Mobile State: Menu Active */
    .profile-layout.mobile-menu-active .profile-sidebar {
        display: block !important;
        position: static;
        width: 100%;
        box-sizing: border-box;
        border: none;
        background: transparent;
        backdrop-filter: none;
        padding: 0;
    }
    .profile-layout.mobile-menu-active .profile-content {
        display: none !important;
    }
    
    /* Content State Active */
    .profile-layout.mobile-content-active .profile-sidebar {
        display: none !important;
    }
    .profile-layout.mobile-content-active .profile-content {
        display: block !important;
    }

    /* Mobile Sidebar Styling */
    .profile-sidebar {
        padding: 0;
    }
    
    .sidebar-header {
        margin-bottom: 1.5rem;
        padding-bottom: 1rem;
        text-align: center;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }
    .sidebar-header h3 {
        font-size: 1.5rem;
    }
    
    .sidebar-nav {
        display: flex;
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .sidebar-nav-item {
        padding: 1.2rem 1.5rem;
        border-radius: 20px;
        font-size: 1.1rem;
        background: rgba(255, 255, 255, 0.02);
        border: 1px solid rgba(255, 255, 255, 0.06);
        color: var(--text-secondary);
    }
    
    .sidebar-nav-item.active {
        background: rgba(255, 255, 255, 0.02);
        color: var(--text-secondary);
        box-shadow: none;
        font-weight: 500;
        border-color: rgba(255, 255, 255, 0.06);
    }
    
    .sidebar-nav-item:active {
        background: rgba(255, 255, 255, 0.05);
    }
    
    .sidebar-nav-item i {
        font-size: 1.3rem;
        margin-right: 0.5rem;
    }
    
    .sidebar-footer {
        margin-top: 2rem;
        padding-top: 1.5rem;
        border-top: 1px solid rgba(255, 255, 255, 0.05);
    }
    
    .sidebar-logout-btn {
        padding: 1.2rem 1.5rem;
        border-radius: 20px;
        font-size: 1.1rem;
        justify-content: center;
    }

    /* Mobile Content Styling */
    .mobile-back-header {
        display: flex;
        align-items: center;
        gap: 1rem;
        margin-bottom: 1.5rem;
        padding-bottom: 1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }
    
    .mobile-back-btn {
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1);
        color: var(--text-primary);
        font-size: 1.1rem;
        padding: 0.8rem 1.2rem;
        border-radius: 50px;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        transition: all 0.3s ease;
    }
    
    .mobile-back-btn:hover {
        background: rgba(255, 255, 255, 0.1);
    }
    
    .mobile-back-btn span {
        font-weight: 600;
    }

    .profile-card {
        padding: 1.2rem;
        border-radius: 20px;
        width: 100%;
        box-sizing: border-box;
    }
    
    .profile-fields-grid {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }
    
    .content-title {
        display: none; /* We will use the back button header instead */
    }
}
