/* General Styling for Profile Modal */
.profile-modal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #fff; /* Solid white background as requested */
    z-index: 501; /* Ensure it's above other content but below other modals if any */
    display: flex;
    flex-direction: column;
    transform: translateX(100%); /* Start off-screen to the right */
    transition: transform 0.3s ease-out; /* Smooth slide-in/out */
    overflow-y: auto; /* Allow scrolling for content */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    padding-bottom: 7em;
}

.profile-modal-container.open {
    transform: translateX(0); /* Slide into view */
}



/* Header */
.profile-header {
    display: flex;
    align-items: center;
    padding: 1rem;
background-color: rgb(255, 255, 255, 0.5);
backdrop-filter: blur(10px);
    color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 10; /* Keep header on top when scrolling */
}

.profile-header .back-button {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%; /* Make it round */
    transition: background-color 0.2s ease-in-out;
    z-index: 10; /* Ensure back button is above other content */
}

.profile-header .back-button:hover {
    background-color: rgba(255,255,255,0.1);
}

.profile-header .back-button svg {
    width: 24px;
    height: 24px;
    fill: #222;
}

.profile-header-title {
    flex-grow: 1;
    text-align: center;
    margin-left: -2.5rem; /* Counteract back button padding for centering */
    font-size: 1.25rem;
    font-weight: 600;
}

/* Main Content Area */
.profile-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: relative; /* For z-index of popups */
}

/* Image Carousel */
.profile-image-carousel {
    position: relative;
    width: 100%;
    max-width: 400px; /* Limit width for desktop viewing */
    margin: 0 auto;
    height: 300px; /* Fixed height for carousel */
    background-color: #eee;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.carousel-inner {
    display: flex;
    height: 100%;
    transition: transform 0.5s ease-in-out;
}

.carousel-item {
    min-width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden; /* Ensure image doesn't overflow */
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Cover the area, crop if necessary */
    border-radius: 12px; /* Inherit from container */
}

.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgb(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    color: #222;
    border: none;
    padding: 0.5rem;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease-in-out;
    z-index: 5;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.carousel-nav:hover {
    background-color: rgba(255, 255, 255, 0.8); /* Slightly more opaque on hover */
}

.carousel-nav.prev-btn {
    left: 10px;
}

.carousel-nav.next-btn {
    right: 10px;
}

.carousel-item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    border-radius: 12px;
}

.carousel-item:hover .carousel-item-overlay,
.carousel-item-overlay:focus-within {
    opacity: 1;
}

.carousel-item-overlay .btn-small {
    background-color: #005fee; /* Accent blue */
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.carousel-item-overlay .btn-small:hover {
    background-color: #004ac9; /* Darker blue on hover */
}

.carousel-item-overlay .btn-destructive {
    background-color: #dc3545; /* Red for destructive action */
}
.carousel-item-overlay .btn-destructive:hover {
    background-color: #c82333;
}


/* Profile Info Section */
.profile-info-section {
    background-color: #ffffff;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.profile-field {
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.75rem;
    position: relative;
}

.profile-field:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.profile-field label {
    font-weight: 600;
    color: #333;
    min-width: 120px; /* Align labels */
}

.profile-field span,
.profile-field p {
    flex-grow: 1;
    color: #555;
    line-height: 1.5;
}

.profile-field .small-text {
    font-size: 0.8rem;
    color: #888;
    margin-left: auto;
}

.edit-button {
    background: none;
    border: none;
    cursor: pointer;
    color: #005fee; /* Accent blue */
    padding: 5px;
    border-radius: 50%;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.edit-button:hover {
    background-color: rgba(0, 95, 238, 0.1);
}

.edit-button svg {
    width: 18px;
    height: 18px;
}

.interests-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.interests-list li {
    background-color: #e0f2fe; /* Light blue */
    color: #005fee;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Edit Popups (common styles) */
.edit-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 503; /* Above profile modal */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.edit-popup.active {
    opacity: 1;
    visibility: visible;
}

.edit-popup-content {
    background-color: #fff;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    max-width: 400px;
    width: 90%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.edit-popup.active .edit-popup-content {
    transform: translateY(0);
    max-height: 90vh;
    overflow: scroll;
}

.edit-popup h3 {
    font-size: 1.2rem;
    color: #005fee; /* Accent blue */
    margin-bottom: 1rem;
}

.edit-popup input[type="text"],
.edit-popup textarea {
    width: calc(100% - 20px);
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s ease;
}

.edit-popup input[type="text"]:focus,
.edit-popup textarea:focus {
    border-color: #005fee;
    box-shadow: 0 0 0 3px rgba(0, 95, 238, 0.2);
}

.edit-popup textarea {
    resize: vertical;
    min-height: 80px;
}

.options-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 1rem;
}

.checkbox-label,
.radio-label {
    background-color: #e0f2fe;
    border: 1px solid #a8dcfc;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.checkbox-label:hover,
.radio-label:hover {
    background-color: #c9e8fb;
}

.checkbox-label input[type="checkbox"],
.radio-label input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #005fee;
    border-radius: 4px;
    display: inline-block;
    position: relative;
    cursor: pointer;
}

.radio-label input[type="radio"] {
    border-radius: 50%; /* Make radio buttons round */
}

.checkbox-label input[type="checkbox"]:checked,
.radio-label input[type="radio"]:checked {
    background-color: #005fee;
    border-color: #005fee;
}

/* Checkmark/Dot for selected checkboxes/radios */
.checkbox-label input[type="checkbox"]:checked::after {
    content: '✔';
    color: white;
    font-size: 12px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.radio-label input[type="radio"]:checked::after {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: white;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}


.popup-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 1rem;
}

.btn-primary,
.btn-secondary {
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: hsla(240,75%,67%,1); /* Accent blue */
    color: white;
    border: none;
}
.add-photo-area button {
    display: flex
;
    align-items: center;
    gap: 1em;
}
.btn-primary:hover {
    background-color: hsla(240,75%,57%,1); /* Darker blue on hover */
}

.btn-secondary {
    background-color: #e0e0e0;
    color: #333;
    border: 1px solid #ccc;
}

.btn-secondary:hover {
    background-color: #d0d0d0;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .profile-modal-container {
        padding: 0;
    }

    .profile-header-title {
        font-size: 1.1rem;
    }

    .profile-content {
        padding: 1rem;
        padding-bottom: 7em !important;
    }

    .profile-image-carousel {
        height: 250px;
    }

    .carousel-nav {
        padding: 0.3rem;
    }

    .profile-info-section {
        padding: 1rem;
    }

    .profile-field label {
        min-width: 90px;
        font-size: 0.95rem;
    }

    .profile-field span,
    .profile-field p {
        font-size: 0.9rem;
    }

    .edit-button svg {
        width: 16px;
        height: 16px;
    }

    .interests-list li {
        font-size: 0.85rem;
        padding: 5px 10px;
    }

    .edit-popup-content {
        padding: 1.5rem;
    }
    .edit-popup input[type="text"],
    .edit-popup textarea {
        padding: 8px;
        font-size: 0.95rem;
    }
    .btn-primary, .btn-secondary {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .profile-header {
        padding: 0.75rem;
    }
    .profile-header .back-button {
        padding: 0.4rem;
    }
    .profile-header-title {
        font-size: 1rem;
        margin-left: -2rem;
    }
    .profile-content {
        padding: 0.75rem;
        gap: 1rem;
    }
    .profile-image-carousel {
        height: 220px;
        border-radius: 8px;
    }
    .carousel-nav {
        padding: 0.2rem;
    }
    .carousel-item-overlay .btn-small {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
    .profile-info-section {
        padding: 0.75rem;
        border-radius: 8px;
        gap: 0.75rem;
    }
    .profile-field {
        flex-wrap: wrap;
        padding-bottom: 0.5rem;
    }
    .profile-field label {
        min-width: 80px;
        font-size: 0.9rem;
    }
    .profile-field span,
    .profile-field p {
        font-size: 0.85rem;
        width: auto; /* Allow content to wrap naturally */
    }
    .edit-button {
        align-self: flex-end; /* Align edit button to the end if content wraps */
    }
    .interests-list {
        gap: 6px;
    }
    .interests-list li {
        font-size: 0.8rem;
        padding: 4px 8px;
    }
    .edit-popup-content {
        padding: 1rem;
        border-radius: 8px;
    }
    .edit-popup input[type="text"],
    .edit-popup textarea {
        padding: 6px;
        font-size: 0.9rem;
    }
    .btn-primary, .btn-secondary {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
}
h2.profile-header-title {
    background: linear-gradient(45deg, black, transparent);
    color: transparent;
    background-clip: text;
}