/* =================================================== */
/* STYLES FOR: profile.php
/* =================================================== */

.profile-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
}

/* ==================== PROFILE IMAGE CARD ==================== */
.profile-image-card {
    padding: 2.5rem;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    text-align: center;
}

.profile-image-preview {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 1.5rem auto;
    border: 4px solid var(--color-border);
    display: block;
}

[data-theme="dark"] .profile-image-preview {
    border-color: var(--color-background);
}

.profile-image-card .form__label {
    cursor: pointer;
    font-size: 1rem;
    padding: 0.8rem 1.5rem;
    background-color: var(--color-background);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    transition: var(--transition-smooth);
}

.profile-image-card .form__label:hover {
    background-color: var(--color-surface);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

/* Visually hide the file input, but keep it accessible */
.profile-image-card .form__input--file {
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    position: absolute;
    z-index: -1;
}

.profile-image-card .form__button {
    width: 100%;
    margin-top: 1rem;
}


/* ==================== PROFILE FORMS ==================== */
/* We can re-use the .auth-container styles from signup.css/login.css */
/* If those aren't global, you'd copy them here. */
/* Assuming .auth-container is available: */
.profile-form-container {
    padding: 2.5rem;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
}

.profile-form-container:not(:last-child) {
    margin-bottom: 2.5rem;
}

.profile-form-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 2rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-border);
}

/* Re-use form styles from signup/login */
.form__group {
    margin-bottom: 1.5rem;
}

.form__label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.95rem;
}

.form__input {
    width: 100%;
    padding: 0.9rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background-color: var(--color-background);
    color: var(--color-text);
    font-size: 1rem;
    transition: var(--transition-smooth);
}

.form__input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px hsla(var(--color-primary-hue), 100%, 50%, 0.2);
}

[data-theme="dark"] .form__input {
    background-color: var(--color-background);
}

.form__button {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    margin-top: 1rem;
}

/* Re-use message styles */
.auth-message {
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    font-size: 0.95rem;
    line-height: 1.5;
    border: 1px solid transparent;
}

.auth-message--success {
    background-color: hsl(145, 63%, 94%);
    color: hsl(145, 63%, 32%);
    border-color: hsl(145, 63%, 32%);
}

.auth-message--error {
    background-color: hsl(0, 100%, 97%);
    color: hsl(0, 72%, 51%);
    border-color: hsl(0, 72%, 51%);
}

/* ==================== IMAGE MODAL ==================== */
.image-modal {
    display: none;
    /* Hidden by default */
    position: fixed;
    /* Stay in place */
    z-index: 2000;
    /* Sit on top of everything */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    /* Enable scroll if needed */
    background-color: hsla(0, 0%, 0%, 0.85);
    /* Black background with opacity */
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.image-modal__content {
    margin: auto;
    display: block;
    width: 80%;
    max-height: 70vh;
    max-width: 700px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: var(--border-radius);
    animation: zoomIn 0.3s ease-out;
    /* Add a little animation */
}

/* Animation for the zoom */
@keyframes zoomIn {
    from {
        /* Start centered, scaled down, and invisible */
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }

    to {
        /* End centered, full size, and visible */
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

.image-modal__close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.image-modal__close:hover,
.image-modal__close:focus {
    color: #bbb;
    text-decoration: none;
}


/* ==================== MEDIA QUERIES ==================== */

@media screen and (min-width: 992px) {
    .profile-grid {
        /* 1fr 2fr means the right column is twice as wide */
        grid-template-columns: 1fr 2fr;
    }

    .profile-image-card {
        /* Make the image card sticky */
        position: sticky;
        top: 7.5rem;
        /* (header height + padding) */
    }
}