/* assets/css/profile-dashboard.css */
/* Profile Dashboard - EatSure Style Layout */

/* ========= MAIN LAYOUT ========= */
.profile-main {
    min-height: calc(100vh - 80px);
    background: #f5f5f5;
    padding: 24px 0;
}

.profile-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

/* ========= SIDEBAR ========= */
.profile-sidebar {
    width: 320px;
    flex-shrink: 0;
    position: sticky;
    top: 100px;
}

.profile-sidebar-inner {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

/* User Card */
.profile-photo-trigger { appearance: none; position: relative; flex-shrink: 0; padding: 0; border: 0; border-radius: 50%; background: transparent; box-shadow: none; outline: none; cursor: pointer; }
.profile-photo-trigger:focus-visible { outline: 3px solid var(--ud-primary); outline-offset: 4px; }
.profile-photo-form { display: flex; align-items: flex-start; gap: 20px; padding-bottom: 24px; margin-bottom: 24px; border-bottom: 1px solid #eee; }
.profile-photo-preview { width: 72px !important; height: 72px !important; }
.profile-photo-controls { min-width: 0; flex: 1; }
.profile-photo-hint { font-size: 12px; color: #6b7280; line-height: 1.6; margin: 8px 0 12px; }
.profile-photo-status { font-size: 13px; color: #16703e; line-height: 1.5; margin: 12px 0 0; }
.profile-photo-status:empty { display: none; }
.profile-photo-status.is-error { color: #b42318; }
@media (max-width: 480px) { .profile-photo-form { flex-direction: column; } .profile-photo-controls { width: 100%; } }

.profile-user-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 24px;
    border-bottom: 1px solid #f0f0f0;
}

.profile-user-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    color: #9ca3af;
}

.profile-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar-initial {
    font-size: 22px;
    font-weight: 600;
    color: var(--ud-primary);
}

.profile-user-info {
    flex: 1;
    min-width: 0;
}

.profile-user-name {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-user-phone {
    font-size: 13px;
    color: #6b7280;
    margin: 0 0 8px 0;
}

.profile-nav-arrow .ud-ui-icon { width: 16px; height: 16px; }

/* Navigation Menu */
.profile-nav {
    display: flex;
    flex-direction: column;
}

.profile-nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    color: #374151;
    text-decoration: none;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.15s ease;
    position: relative;
}

.profile-nav-item:last-child {
    border-bottom: none;
}

.profile-nav-item:hover {
    background: var(--ud-primary-soft);
}

.profile-nav-item.active {
    background: var(--ud-primary);
    color: #ffffff;
}

.profile-nav-item.active .profile-nav-icon,
.profile-nav-item.active .profile-nav-arrow {
    color: #ffffff;
}

.profile-nav-item.active .profile-nav-subtext {
    color: rgba(255, 255, 255, 0.8);
}

.profile-nav-item.active .profile-nav-badge {
    background: #ffffff;
    color: var(--ud-primary);
}

.profile-nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    flex-shrink: 0;
}

.profile-nav-text {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

.profile-nav-text-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.profile-nav-text-wrapper .profile-nav-text {
    flex: none;
}

.profile-nav-subtext {
    font-size: 11px;
    color: #9ca3af;
    font-weight: 400;
}

.profile-nav-badge {
    padding: 2px 8px;
    background: var(--ud-primary);
    color: #ffffff;
    font-size: 10px;
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-nav-arrow {
    color: #9ca3af;
    flex-shrink: 0;
}

/* ========= CONTENT AREA ========= */
.profile-content {
    flex: 1;
    min-width: 0;
}

.profile-section {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.profile-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
}

.profile-section-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

/* Add Button */
.profile-add-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--ud-primary);
    color: var(--ud-primary);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.profile-add-btn:hover {
    background: var(--ud-primary);
    color: #ffffff;
}

/* Empty State */
.profile-empty-state {
    text-align: center;
    padding: 48px 24px;
}

.profile-empty-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    color: #d1d5db;
}

.profile-empty-state h3 {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 8px 0;
}

.profile-empty-state p {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 20px 0;
}

/* Action Button */
.profile-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    background: var(--ud-primary);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}

.profile-action-btn:hover {
    background: var(--ud-primary-dark);
}

/* Loading State */
.profile-loading {
    text-align: center;
    padding: 32px;
    color: #6b7280;
    font-size: 14px;
}

/* ========= WALLET SECTION ========= */
.profile-wallet-balance {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background: linear-gradient(135deg, #f8f4ff 0%, #f0e8ff 100%);
    border-bottom: 1px solid #f0f0f0;
}

.profile-wallet-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--ud-primary);
    border-radius: 8px;
    color: #ffffff;
}

.profile-wallet-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.profile-wallet-label {
    font-size: 13px;
    color: #6b7280;
}

.profile-wallet-amount {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
}

/* Transactions */
.profile-transactions {
    padding: 20px 24px;
}

.profile-transactions-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.profile-transactions-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.profile-transactions-count {
    font-size: 13px;
    color: #6b7280;
    flex: 1;
}

.profile-transactions-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #6b7280;
}

.profile-transactions-filter select {
    padding: 6px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 13px;
    color: #374151;
    background: #ffffff;
    cursor: pointer;
}

.profile-transactions-list {
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    min-height: 100px;
}

/* ========= POINTS SECTION ========= */
.profile-points-balance {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px;
    background: linear-gradient(135deg, #fff9e6 0%, #fff3cc 100%);
    border-bottom: 1px solid #f0f0f0;
}

.profile-points-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: #f59e0b;
    border-radius: 50%;
    color: #ffffff;
}

.profile-points-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.profile-points-label {
    font-size: 13px;
    color: #6b7280;
}

.profile-points-amount {
    font-size: 32px;
    font-weight: 700;
    color: #111827;
}

.profile-points-history {
    padding: 20px 24px;
}

/* ========= ORDERS LIST ========= */
.profile-orders-list {
    padding: 16px;
}

.profile-order-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 12px;
    transition: box-shadow 0.2s ease;
}

.profile-order-card:last-child {
    margin-bottom: 0;
}

.profile-order-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.profile-order-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.profile-order-id {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}

.profile-order-status {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.profile-order-status.status-pending {
    background: #fef3c7;
    color: #d97706;
}

.profile-order-status.status-confirmed,
.profile-order-status.status-processing {
    background: #dbeafe;
    color: #2563eb;
}

.profile-order-status.status-delivered,
.profile-order-status.status-completed {
    background: #d1fae5;
    color: #059669;
}

.profile-order-status.status-cancelled {
    background: #fee2e2;
    color: #dc2626;
}

.profile-order-restaurant {
    font-size: 15px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
}

.profile-order-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: #6b7280;
}

.profile-order-total {
    font-weight: 600;
    color: #111827;
}

/* ========= EDIT PROFILE FORM ========= */
.profile-edit-form {
    padding: 24px;
    max-width: 480px;
}

.profile-form-group {
    margin-bottom: 20px;
}

.profile-form-label {
    display: block;
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 8px;
}

.profile-form-input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    color: #111827;
    background: #ffffff;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.profile-form-input:focus {
    outline: none;
    border-color: var(--ud-primary);
}

/* Gender Options */
.profile-gender-options {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.profile-gender-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.profile-gender-option input {
    display: none;
}

.profile-gender-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    transition: all 0.2s ease;
}

.profile-gender-option input:checked + .profile-gender-icon {
    border-color: var(--ud-primary);
    color: var(--ud-primary);
    background: var(--ud-primary-soft);
}

.profile-gender-text {
    font-size: 13px;
    color: #6b7280;
}

.profile-gender-option input:checked ~ .profile-gender-text {
    color: var(--ud-primary);
}

/* Submit Button */
.profile-submit-btn {
    width: 100%;
    padding: 16px 24px;
    background: var(--ud-primary);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 12px;
}

.profile-submit-btn:hover {
    background: var(--ud-primary-dark);
}

.profile-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Message */
.profile-message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    display: none;
}

.profile-message.success {
    background: #d1fae5;
    color: #065f46;
    display: block;
}

.profile-message.error {
    background: #fee2e2;
    color: #991b1b;
    display: block;
}

/* ========= NOT LOGGED IN STATE ========= */
.profile-not-logged-in {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.profile-login-prompt {
    text-align: center;
    padding: 48px 24px;
}

.profile-login-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    color: #d1d5db;
}

.profile-login-prompt h2 {
    font-size: 22px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 8px 0;
}

.profile-login-prompt p {
    font-size: 15px;
    color: #6b7280;
    margin: 0 0 24px 0;
}

/* ========= RESPONSIVE ========= */
@media (max-width: 900px) {
    .profile-wrapper {
        flex-direction: column;
        padding: 0 16px;
    }

    .profile-sidebar {
        width: 100%;
        position: static;
    }

    .profile-sidebar-inner {
        border-radius: 12px;
    }

    .profile-content {
        width: 100%;
    }
}

@media (max-width: 540px) {
    .profile-main {
        padding: 16px 0;
    }

    .profile-wrapper {
        padding: 0 12px;
        gap: 16px;
    }

    .profile-user-card {
        padding: 20px;
    }

    .profile-nav-item {
        padding: 14px 16px;
    }

    .profile-section-header {
        padding: 16px 20px;
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .profile-add-btn {
        width: 100%;
        justify-content: center;
    }

    .profile-empty-state {
        padding: 32px 20px;
    }

    .profile-edit-form {
        padding: 20px;
    }

    .profile-gender-options {
        justify-content: space-between;
    }

    .profile-wallet-balance,
    .profile-points-balance {
        padding: 16px 20px;
    }

    .profile-transactions {
        padding: 16px 20px;
    }

    .profile-transactions-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .profile-orders-list {
        padding: 12px;
    }

    .profile-order-card {
        padding: 14px;
    }
}
