.profile-container, form {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding-inline: 20px;
    box-sizing: border-box;
}

.messages p {
    padding: 0.5rem 1rem;
    border-radius: 5px;
    margin-bottom: 10px;
}

.messages .success {
    background-color: #d4edda;
    color: #155724;
}

.messages .error {
    background-color: #f8d7da;
    color: #721c24;
}

.profile-header {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    height: auto;
    display: flex;
    border: 1px solid #00000067;
    background-color: #ffffff97;
    border-radius: 6px;
    transition: box-shadow 0.2s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.671);
    padding: 20px;
    position: relative;
}

.profile-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    flex: 1;
    width: auto;
    min-width: 0;
}

.profile {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 50%;
    margin-bottom: 0.5rem;
    border: 2px solid #ccc;
}

.profile-info {
    padding: 10px;
    text-align: left;
    min-width: 0;
}

.profile-info h1 {
    overflow-wrap: break-word;
}

.profile-menu {
    position: absolute;
    top: 20px;
    right: 20px;
}

.menu-btn {
    font-size: 24px;
    background: none;
    border: none;
    color: rgb(0, 0, 0);
    cursor: pointer;
}

.menu-btn:hover {
    background-color: rgb(218, 218, 218);
    text-wrap-style: balance;
}

/* Sidebar (dropdown) */
.menu-dropdown {
    position: absolute;
    right: 0;
    top: 40px;
    width: 180px;
    display: none;
    flex-direction: column;
    padding: 10px;
    background-color: #f1f1f1;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 100;
}

.menu-dropdown.active {
    display: flex;
}

.menu-dropdown a {
    padding: 10px;
    text-decoration: none;
    color: #333;
    border-radius: 4px;
}

.menu-dropdown a:hover {
    background-color: #f0f0f0;
}

.menu-dropdown .delete-user {
    color: red;
}

/* Description */
.profile-section {
    width: 100%;
    max-width: 900px;
    margin: 10px auto;
    height: auto;
    display: flex;
    flex-direction: column;
    border: 1px solid #00000067;
    background-color: #fffdfd97;
    border-radius: 6px;     
    transition: box-shadow 0.2s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.671);
    padding: 20px;
    max-height: none;
    gap: 15px;
}

.profile-section h3 {
    border-bottom: 1px solid #00000063;
    color: #0073b1;
    padding: 10px;
    align-self: flex-start;
    width: 100%;
    text-align: left;
}

.profile-section p {
    padding: 10px;
}

.skills-list {
    padding: 10px;
    border-radius: 20px;
}

.profile-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    padding-bottom: 20px;
    margin-top: 15px;
}

.profile-actions a {
    background-color: #0073b1;
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-weight: bold;
    text-decoration: none;
    transition: background 0.2s;
}

.profile-actions a:hover {
    background-color: #0073b19f;
}

.profile-actions .report {
    padding: 6px 6px;
    background-color: rgb(153, 49, 49);
    align-items: right;
}

.profile-actions .report:hover {
    background-color: rgba(153, 49, 49, 0.731);
}

.profile-picture-field {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    
}

.profile-preview {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 50%; /* circle like Facebook */
    margin-bottom: 0.5rem;
    border: 2px solid #ccc;
}

.profile-section form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    align-items: center;
}

.profile-section input,
.profile-section textarea,
.profile-section select {
    width: 100%;
    padding: 10px;
    font-size: 16px;
    border-radius: 6px;
    border: 1px solid #ccc;
    box-sizing: border-box;
}

.profile-section textarea {
    min-height: 150px;
    resize: none;
}

.save-changes {
    display: block;
    margin: 20px auto 0;
    padding: 10px 25px;
    border-radius: 6px;
    font-size: 16px;
}

.upload-btn {
    display: inline-block;          /* critical */
    justify-content: space-between;
    width: 70%;
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-size: 1rem;
    text-align: center;      /* center text */
    cursor: pointer;        /* makes it feel clickable */
    background-color: #0073b1;
    color: white;
}

#id_profile_picture {
    position: absolute;
    left: -9999px;
}

/* BACK LINK */
.back-link {
    text-align: center;
    margin-top: 20px;
}

.back-link a {
    color: #555;
    text-decoration: none;
}

.back-link a:hover {
    text-decoration: underline;
}

@media (max-width: 480px) {
    .profile-header,
    .profile-section {
        width: 100%;
        max-width: 900px;
    } 

   .profile-actions {
        flex-direction: column;
    }

    .profile-actions a {
        font-size: 14px;
    }

    .profile {
        width: 100px;
        height: 100px;
    }
} 

@media (max-width: 600px) {
    .profile-header,
    .profile-section {
        width: 100%;
        max-width: 900px;
    }

    .profile-header {
        flex-direction: column;
        align-items: center;
    }

    .profile-left {
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    .profile-actions {
        flex-direction: column;
    }

    .profile-actions a {
        width: 100%;
        text-align: center;
    }

    .profile-menu {
        position: static;
        margin-top: 10px;
        align-self: flex-end;
    }
}

@media (max-width: 768px) {
    .profile-header,
    .profile-section {
        width: 100%;
        max-width: 900px;
    }

    .profile-header {
        display: column;
        align-items: center;
    }

    .profile-left {
        flex-direction: column;
    }

    .profile-actions {
        flex-direction: column;
    }

    .profile-actions a{
        width: 100%;
        text-align: center;
    }

    .profile-menu {
        position: static;
        margin-top: 10px;
        align-self: flex-end;
    }
}