/**
 * User Modals and Profile Styles
 * Beautiful and playful styling for authentication and profile features
 */

/* ===== USER MODAL BASE ===== */
.user-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(43, 95, 95, 0.8);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.user-modal.show {
    opacity: 1;
    visibility: visible;
}

.user-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.user-modal-content {
    background: white;
    border-radius: 25px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    transform: scale(0.8);
    transition: transform 0.3s ease;
    max-width: 90vw;
    max-height: 90vh;
    overflow: auto;
}

.user-modal.show .user-modal-content {
    transform: scale(1);
}

.user-modal-close {
    position: absolute;
    top: 20px;
    right: 25px;
    background: rgba(255, 107, 107, 0.1);
    color: var(--color-coral);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1;
}

.user-modal-close:hover {
    background: var(--color-coral);
    color: white;
    transform: scale(1.1);
}

/* ===== AUTHENTICATION MODAL ===== */
.auth-modal-content {
    width: 450px;
    padding: 2rem;
}

.auth-tabs {
    display: flex;
    margin-bottom: 2rem;
    border-radius: 15px;
    background: var(--color-sand);
    padding: 6px;
}

.auth-tab {
    flex: 1;
    background: transparent;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--color-ocean-deep);
}

.auth-tab.active {
    background: white;
    color: var(--color-primary);
    box-shadow: 0 2px 8px rgba(78, 205, 196, 0.2);
}

.auth-form {
    animation: fadeInUp 0.3s ease;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.auth-header h2 {
    color: var(--color-ocean-deep);
    margin: 0 0 0.5rem 0;
    font-size: 1.8rem;
    font-weight: 700;
}

.auth-header p {
    color: var(--color-primary);
    margin: 0;
    font-size: 1rem;
}

.form-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.form-group input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid var(--color-sand);
    border-radius: 15px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.1);
}

.form-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-primary);
    font-size: 1.1rem;
}

.auth-btn {
    width: 100%;
    padding: 1rem 2rem;
    border: none;
    border-radius: 15px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.login-btn {
    background: var(--gradient-ocean);
    color: white;
}

.register-btn {
    background: var(--gradient-sunset);
    color: white;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.auth-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.auth-footer {
    text-align: center;
    color: var(--color-ocean-deep);
}

.auth-footer a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* ===== PROFILE MODAL ===== */
.profile-modal-content {
    width: 520px;
    padding: 0;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.profile-header {
    background: var(--gradient-tropical);
    color: white;
    padding: 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.profile-large-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.3);
    object-fit: cover;
}

.profile-info h2 {
    margin: 0 0 0.5rem 0;
    font-size: 1.8rem;
    font-weight: 700;
}

.profile-info p {
    margin: 0 0 1rem 0;
    opacity: 0.9;
    font-size: 1rem;
}

.profile-level {
    display: flex;
    gap: 1rem;
}

.level-badge,
.discount-badge {
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.level-badge {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.discount-badge {
    background: var(--color-sunshine);
    color: white;
}

.points-section {
    padding: 2rem;
    text-align: center;
    background: linear-gradient(135deg, var(--color-coconut) 0%, var(--color-sand) 100%);
}

.points-section h3 {
    margin: 0 0 1.5rem 0;
    color: var(--color-ocean-deep);
    font-size: 1.3rem;
}

.points-display {
    margin-bottom: 2rem;
}

.points-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1;
}

.points-label {
    color: var(--color-ocean-deep);
    font-size: 1rem;
    opacity: 0.8;
}

.level-progress {
    background: white;
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.progress-info span:first-child {
    color: var(--color-ocean-deep);
}

.progress-info span:last-child {
    color: var(--color-primary);
}

.progress-bar {
    height: 12px;
    background: var(--color-sand);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-ocean);
    border-radius: 10px;
    transition: width 0.6s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.profile-stats {
    padding: 1.5rem 2rem;
    display: flex;
    gap: 2rem;
    background: white;
}

.stat-item {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-item i {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--gradient-ocean);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.stat-info {
    flex: 1;
}

.stat-value {
    display: block;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-ocean-deep);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--color-primary);
    opacity: 0.8;
}

/* ===== PROFILE TABS ===== */
.profile-tabs {
    display: flex;
    background: var(--color-sand);
    padding: 0;
    margin: 0;
}

.profile-tab {
    flex: 1;
    background: transparent;
    border: none;
    padding: 1rem 1.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--color-ocean-deep);
    border-bottom: 3px solid transparent;
}

.profile-tab.active {
    background: white;
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.profile-tab:hover:not(.active) {
    background: rgba(255, 255, 255, 0.5);
}

.profile-tab-content {
    padding: 0;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

/* ===== ORDERS SECTION ===== */
.orders-section {
    padding: 2rem;
    max-height: 400px;
    overflow-y: auto;
}

.orders-section h3 {
    margin: 0 0 1.5rem 0;
    color: var(--color-ocean-deep);
    font-size: 1.3rem;
}

.no-orders {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--color-ocean-deep);
}

.no-orders h3 {
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.order-card {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-left: 4px solid var(--color-primary);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-sand);
}

.order-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.order-id {
    font-weight: 700;
    color: var(--color-ocean-deep);
    font-size: 1.1rem;
}

.order-date {
    color: var(--color-primary);
    font-size: 0.9rem;
}

.order-status {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.status-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.confirmed {
    background: rgba(78, 205, 196, 0.1);
    color: var(--color-primary);
}

.order-total {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-coral);
}

.order-items {
    margin-bottom: 1rem;
}

.order-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.order-item:last-child {
    border-bottom: none;
}

.order-item img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
}

.item-details {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.item-name {
    font-weight: 600;
    color: var(--color-ocean-deep);
}

.item-quantity {
    color: var(--color-primary);
    font-size: 0.9rem;
}

.item-price {
    font-weight: 600;
    color: var(--color-coral);
}

.order-points {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-sunshine);
    font-weight: 600;
    font-size: 0.9rem;
}

.order-points i {
    color: var(--color-sunshine);
}

/* ===== SETTINGS SECTION ===== */
.settings-section {
    padding: 2rem;
}

.settings-section h3 {
    margin: 0 0 1.5rem 0;
    color: var(--color-ocean-deep);
    font-size: 1.3rem;
}

.shipping-form .form-group {
    margin-bottom: 1rem;
}

.shipping-form input {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--color-sand);
    border-radius: 15px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
    box-sizing: border-box;
}

.shipping-form input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1rem;
}

.profile-btn-primary {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--gradient-ocean);
    color: white;
    margin-bottom: 2rem;
}

.profile-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(78, 205, 196, 0.3);
}

.danger-zone {
    background: rgba(255, 107, 107, 0.05);
    border: 2px solid rgba(255, 107, 107, 0.2);
    border-radius: 15px;
    padding: 2rem;
    margin-top: 2rem;
}

.danger-zone h3 {
    color: var(--color-coral);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.danger-zone p {
    color: var(--color-ocean-deep);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

/* ===== SETTINGS MENU ===== */
.settings-menu {
    padding: 1rem;
}

.settings-option {
    display: flex;
    align-items: center;
    padding: 1.5rem;
    margin-bottom: 0.5rem;
    background: white;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid transparent;
}

.settings-option:hover {
    background: var(--color-sand);
    border-color: var(--color-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(78, 205, 196, 0.1);
}

.settings-option:last-child {
    margin-bottom: 0;
}

.setting-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--gradient-ocean);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    font-size: 1.2rem;
}

.setting-details {
    flex: 1;
}

.setting-details h4 {
    margin: 0 0 0.25rem 0;
    color: var(--color-ocean-deep);
    font-size: 1.1rem;
    font-weight: 600;
}

.setting-details p {
    margin: 0;
    color: var(--color-primary);
    font-size: 0.9rem;
    opacity: 0.8;
}

.setting-arrow {
    color: var(--color-primary);
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.settings-option:hover .setting-arrow {
    transform: translateX(3px);
}

/* ===== SETTINGS DETAIL ===== */
.settings-detail {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.settings-header {
    display: flex;
    align-items: center;
    padding: 1.5rem 2rem 1rem 2rem;
    background: var(--color-sand);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.back-btn {
    background: none;
    border: none;
    color: var(--color-primary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    margin-right: 1rem;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: rgba(78, 205, 196, 0.1);
    transform: scale(1.1);
}

.settings-header h3 {
    margin: 0;
    color: var(--color-ocean-deep);
    font-size: 1.3rem;
    font-weight: 700;
}

.settings-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

/* ===== PROFILE FORM STYLES ===== */
.profile-form .form-group {
    margin-bottom: 1.5rem;
}

.profile-form label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--color-ocean-deep);
    font-weight: 600;
    font-size: 0.9rem;
}

.profile-form input {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--color-sand);
    border-radius: 15px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
    box-sizing: border-box;
}

.profile-form input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.1);
}

.profile-form input[readonly] {
    background: var(--color-sand);
    color: var(--color-ocean-deep);
    opacity: 0.7;
}

.profile-form small {
    color: var(--color-primary);
    font-size: 0.8rem;
    margin-top: 0.25rem;
    display: block;
}

/* ===== PRIVACY OPTIONS ===== */
.privacy-option {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.privacy-option h4 {
    margin: 0 0 0.5rem 0;
    color: var(--color-ocean-deep);
    font-size: 1.1rem;
}

.privacy-option p {
    margin: 0 0 1rem 0;
    color: var(--color-primary);
    font-size: 0.9rem;
}

/* ===== ACCOUNT ACTIONS ===== */
.account-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.action-card {
    display: flex;
    align-items: center;
    padding: 1.5rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border-left: 4px solid var(--color-primary);
}

.danger-card {
    border-left-color: var(--color-coral);
}

.action-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    font-size: 1.2rem;
}

.logout-icon {
    background: rgba(78, 205, 196, 0.1);
    color: var(--color-primary);
}

.danger-icon {
    background: rgba(255, 107, 107, 0.1);
    color: var(--color-coral);
}

.action-details {
    flex: 1;
}

.action-details h4 {
    margin: 0 0 0.25rem 0;
    color: var(--color-ocean-deep);
    font-size: 1.1rem;
}

.action-details p {
    margin: 0;
    color: var(--color-primary);
    font-size: 0.9rem;
    opacity: 0.8;
}

.profile-actions {
    padding: 1.5rem 2rem;
    background: var(--color-sand);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    display: none; /* Hidden now that logout is in settings */
}

.profile-btn-secondary,
.profile-btn-danger {
    flex: 1;
    padding: 1rem;
    border: none;
    border-radius: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.profile-btn-secondary {
    background: var(--color-primary);
    color: white;
}

.profile-btn-secondary:hover {
    background: var(--color-ocean-deep);
    transform: translateY(-2px);
}

.profile-btn-danger {
    background: var(--color-coral);
    color: white;
}

.profile-btn-danger:hover {
    background: #d32f2f;
    transform: translateY(-2px);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes levelUpBounce {
    0% { 
        transform: translate(-50%, -50%) scale(0.3); 
        opacity: 0; 
    }
    50% { 
        transform: translate(-50%, -50%) scale(1.1); 
    }
    100% { 
        transform: translate(-50%, -50%) scale(1); 
        opacity: 1; 
    }
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .auth-modal-content,
    .profile-modal-content {
        width: 95vw;
        max-width: 400px;
    }
    
    .profile-header {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem;
    }
    
    .profile-large-avatar {
        width: 100px;
        height: 100px;
    }
    
    .profile-stats {
        flex-direction: column;
        gap: 1rem;
    }
    
    .profile-actions {
        flex-direction: column;
    }
    
    .points-number {
        font-size: 2.5rem;
    }
}