/* =============================================================================
   Profile Page Styles
   ============================================================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--hh-type-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
    background: var(--hh-color-base-offWhite, #f8f9fa);
    min-height: 100vh;
}

.profile-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 24px 16px;
    padding-top: 80px; /* Account for navbar */
}

/* Header */
.profile-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.back-link {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--hh-color-base-white, #fff);
    border-radius: 50%;
    color: var(--hh-color-text-primary, #1a1a1a);
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.2s ease;
}

.back-link:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.profile-header h1 {
    font-size: 24px;
    font-weight: 600;
    color: var(--hh-color-text-primary, #1a1a1a);
}

/* Cards */
.profile-card {
    background: var(--hh-color-base-white, #fff);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

/* User Info Card */
.user-info-card {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-avatar {
    width: 56px;
    height: 56px;
    background: var(--hh-color-base-cloud, #f5f5f5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--hh-color-text-secondary, #666);
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.user-email {
    font-size: 16px;
    font-weight: 600;
    color: var(--hh-color-text-primary, #1a1a1a);
}

.user-since {
    font-size: 14px;
    color: var(--hh-color-text-secondary, #666);
}

/* Section */
.profile-section {
    margin-top: 32px;
}

.section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--hh-color-text-secondary, #666);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    padding-left: 4px;
}

/* Preference Cards */
.preference-card {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 4px 12px;
    align-items: center;
}

.preference-header {
    display: flex;
    align-items: center;
    gap: 8px;
    grid-column: 1;
}

.preference-icon {
    font-size: 18px;
}

.preference-label {
    font-size: 14px;
    color: var(--hh-color-text-secondary, #666);
}

.preference-value {
    grid-column: 1;
    font-size: 16px;
    font-weight: 500;
    color: var(--hh-color-text-primary, #1a1a1a);
}

.preference-value.not-set {
    color: var(--hh-color-text-tertiary, #999);
    font-style: italic;
}

.edit-btn {
    grid-column: 2;
    grid-row: 1 / 3;
    width: 40px;
    height: 40px;
    border: none;
    background: var(--hh-color-base-cloud, #f5f5f5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--hh-color-text-secondary, #666);
    transition: all 0.2s ease;
}

.edit-btn:hover {
    background: var(--hh-color-brand-primary, #F47853);
    color: white;
}

/* Action Buttons */
.profile-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    margin-bottom: 12px;
}

.restart-btn {
    background: var(--hh-color-base-white, #fff);
    color: var(--hh-color-brand-primary, #F47853);
    border: 1.5px solid var(--hh-color-brand-primary, #F47853);
}

.restart-btn:hover {
    background: rgba(244, 120, 83, 0.08);
}

.logout-btn {
    background: var(--hh-color-base-white, #fff);
    color: var(--hh-color-error, #dc2626);
    border: 1.5px solid var(--hh-color-borders-default, #e0e0e0);
}

.logout-btn:hover {
    background: rgba(220, 38, 38, 0.08);
    border-color: var(--hh-color-error, #dc2626);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 24px;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    width: 100%;
    max-width: 480px;
    background: var(--hh-color-base-white, #fff);
    border-radius: 20px;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

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

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--hh-color-borders-default, #e0e0e0);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--hh-color-text-primary, #1a1a1a);
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--hh-color-text-secondary, #666);
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--hh-color-base-cloud, #f5f5f5);
}

.modal-body {
    padding: 24px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--hh-color-borders-default, #e0e0e0);
}

.modal-btn {
    flex: 1;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-btn.cancel {
    background: var(--hh-color-base-cloud, #f5f5f5);
    color: var(--hh-color-text-primary, #1a1a1a);
    border: none;
}

.modal-btn.cancel:hover {
    background: var(--hh-color-borders-default, #e0e0e0);
}

.modal-btn.save {
    background: var(--hh-color-brand-primary, #F47853);
    color: white;
    border: none;
}

.modal-btn.save:hover {
    background: var(--hh-color-brand-primary-600, #e06640);
}

/* Modal Form Elements */
.modal-input {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid var(--hh-color-borders-default, #e0e0e0);
    border-radius: 10px;
    font-size: 16px;
    margin-bottom: 12px;
    transition: all 0.2s ease;
}

.modal-input:focus {
    outline: none;
    border-color: var(--hh-color-brand-primary, #F47853);
}

.modal-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.modal-chip {
    padding: 10px 16px;
    border: 1.5px solid var(--hh-color-borders-default, #e0e0e0);
    border-radius: 100px;
    background: var(--hh-color-base-white, #fff);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-chip:hover {
    border-color: var(--hh-color-brand-primary, #F47853);
}

.modal-chip.selected {
    background: var(--hh-color-brand-primary, #F47853);
    border-color: var(--hh-color-brand-primary, #F47853);
    color: white;
}

.modal-range-group {
    margin-bottom: 16px;
}

.modal-range-label {
    font-size: 14px;
    color: var(--hh-color-text-secondary, #666);
    margin-bottom: 8px;
    display: block;
}

.modal-range-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 16px;
    font-size: 20px;
    font-weight: 600;
    color: var(--hh-color-brand-primary, #F47853);
}

.range-separator {
    font-size: 14px;
    color: var(--hh-color-text-secondary, #666);
    font-weight: 400;
}

/* Debug Section */
.debug-section {
    margin-top: 48px;
    opacity: 0.6;
}

.debug-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 14px;
    color: var(--hh-color-text-secondary, #666);
}

/* Modal Field Styles */
.modal-field {
    margin-bottom: 16px;
}

.modal-field label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--hh-color-text-secondary, #666);
    margin-bottom: 8px;
}

.modal-hint {
    font-size: 13px;
    color: var(--hh-color-text-tertiary, #999);
    margin-top: 4px;
}

/* Modal Selector (for beds/baths buttons) */
.modal-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.modal-selector-btn {
    padding: 12px 20px;
    border: 1.5px solid var(--hh-color-borders-default, #e0e0e0);
    border-radius: 10px;
    background: var(--hh-color-base-white, #fff);
    font-size: 15px;
    font-weight: 500;
    color: var(--hh-color-text-primary, #1a1a1a);
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 60px;
    text-align: center;
}

.modal-selector-btn:hover {
    border-color: var(--hh-color-brand-primary, #F47853);
    background: rgba(244, 120, 83, 0.05);
}

.modal-selector-btn.selected {
    background: var(--hh-color-brand-primary, #F47853);
    border-color: var(--hh-color-brand-primary, #F47853);
    color: white;
}

/* Financial Slider in Modal */
.financial-slider {
    width: 100%;
    height: 8px;
    appearance: none;
    -webkit-appearance: none;
    background: var(--hh-color-borders-default, #e0e0e0);
    border-radius: 4px;
    outline: none;
    margin: 16px 0 8px;
}

.financial-slider::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 28px;
    height: 28px;
    background: var(--hh-color-brand-primary, #F47853);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(244, 120, 83, 0.4);
    transition: transform 0.2s ease;
}

.financial-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.financial-slider::-moz-range-thumb {
    width: 28px;
    height: 28px;
    background: var(--hh-color-brand-primary, #F47853);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(244, 120, 83, 0.4);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--hh-color-text-tertiary, #999);
    margin-bottom: 8px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .profile-container {
        padding-top: 72px;
    }

    .profile-header {
        margin-bottom: 20px;
    }

    .profile-card {
        padding: 16px;
    }
}
