.profile-dropdown {
    position: relative;
    display: inline-block;
    z-index: 10;
}

.profile-dropdown,
.auth-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.avatar-button {
    position: relative;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    padding: 0;
    background-color: rgba(21, 156, 78, 0.05);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.avatar-button img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid #159c4e;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.avatar-toggle-group {
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
}

.caret-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    width: 18px;
    height: 18px;
    margin-top: 2px;
}

.avatar-toggle-group[aria-expanded="true"] .caret-wrapper {
    transform: rotate(180deg);
}

.caret-svg {
    width: 100%;
    height: 100%;
    fill: #f0f8ea;
}

.avatar-button:hover {
    background-color: rgba(21, 156, 78, 0.12);
    transform: scale(1.02);
}

.avatar-button:hover img {
    border-color: #11793b;
    box-shadow: 0 0 0 3px rgba(21, 156, 78, 0.3);
}

.dropdown-menu {
    position: absolute;
    top: 60px;
    right: 0;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
    min-width: 190px;
    z-index: 100;
    padding: 0.5rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}


.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-greeting {
    font-weight: bold;
    font-size: 0.95rem;
    padding: 0.6rem 1rem 0.3rem;
    border-bottom: 1px solid #eee;
    margin-bottom: 0.25rem;
}

.dropdown-menu a {
    display: block;
    padding: 0.6rem 1rem;
    text-decoration: none;
    color: #333;
    transition: background-color 0.2s;
}

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

@media (max-width: 600px) {
    .avatar-button {
        width: 44px;
        height: 44px;
    }

    .dropdown-menu {
        right: 8px;
    }
}

.profile-container {
    max-width: 860px;
    margin: 3rem auto;
    padding: 2rem;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
}

.section-title {
    font-size: 1.8rem;
    color: #159c4e;
    border-bottom: 2px solid #159c4e;
    margin-bottom: 1.5rem;
    padding-bottom: 0.4rem;
}

.messages .alert {
    background: #d4edda;
    border-left: 5px solid #159c4e;
    padding: 0.8rem 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
    font-size: 0.95rem;
}

.profile-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-section {
    background: #f9f9f9;
    padding: 1rem 1.5rem;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem 1.5rem;
}

.profile-form label {
    font-weight: 600;
    display: block;
    margin-bottom: 0.25rem;
}

.profile-form input,
.profile-form select,
.profile-form textarea {
    width: 100%;
    padding: 0.6rem;
    border-radius: 4px;
    border: 1px solid #ccc;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.profile-form input:focus,
.profile-form select:focus,
.profile-form textarea:focus {
    border-color: #159c4e;
    box-shadow: 0 0 0 2px rgba(21, 156, 78, 0.2);
    outline: none;
}

.profile-form button[type="submit"] {
    background-color: #159c4e;
    color: #fff;
    padding: 0.75rem 1.5rem;
    font-weight: bold;
    font-size: 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.profile-form button[type="submit"]:hover {
    background-color: #11793b;
}

.profile-image-preview {
    text-align: center;
    margin-top: 1rem;
}

.profile-image-preview img {
    border-radius: 50%;
    border: 3px solid #ccc;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

@media (max-width: 600px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }

    .profile-container {
        padding: 1.5rem 1rem;
    }

    .form-section {
        padding: 1rem;
    }
}

.inline-field {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.inline-field label {
    margin: 0;
    white-space: nowrap;
}

