/* ========== NAVIGATION & DROPDOWN ========== */
.profile-dropdown {
    position: relative;
    display: flex;
    align-items: center;
    z-index: 50;
}

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

.avatar-button {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid white;
    padding: 2px;
    background-color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-button img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.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-placeholder {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #f3f4f6;
    color: #16a34a;
    font-weight: 700;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.25);
    border-color: #dcfce7;
}

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

.dropdown-menu {
    position: absolute;
    top: 65px;
    right: 0;
    width: 240px;
    background: #ffffff;
    border: 1px solid #f3f4f6;
    border-radius: 16px;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.05),
        0 10px 15px -3px rgba(0, 0, 0, 0.1);
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.98);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: top right;
}

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

.dropdown-header {
    padding: 12px 16px;
    margin-bottom: 8px;
    border-bottom: 1px solid #f3f4f6;
}

.dropdown-header .user-name {
    display: block;
    font-weight: 700;
    color: #111827;
    font-size: 1rem;
    margin-bottom: 2px;
}

.dropdown-header .user-role {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #16a34a;
    background: #dcfce7;
    padding: 2px 8px;
    border-radius: 12px;
}

.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-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    color: #4b5563;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 8px;
    margin-bottom: 2px;
    transition: all 0.15s ease;
}

.dropdown-item:hover {
    background-color: #f9fafb;
    color: #111827;
    transform: translateX(3px);
}

.dropdown-divider {
    height: 1px;
    background-color: #f3f4f6;
    margin: 6px 0;
}

.logout-link:hover {
    background-color: #fef2f2;
    color: #dc2626;
}

.dropdown-item.partner-link {
    color: #0d9488;
}

.dropdown-item.partner-link:hover {
    background-color: #f0fdfa;
    color: #0f766e;
}

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

/* ========== LEGACY PROFILE CONTAINER (Can be kept as fallback) ========== */
.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;
}

/* ========== NEW PREMIUM FORM STYLES ========== */

/* Hide the ugly default browser file input */
.hidden-file-input {
    display: none !important;
}

/* Custom "Change Photo" Button */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    width: auto;
}

.button.white-outline {
    background-color: white;
    border-color: #d1d5db;
    color: #374151;
}

.button.white-outline:hover {
    background-color: #f9fafb;
    border-color: #9ca3af;
    color: #111827;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* Back Button Slide Effect */
.hover-slide svg.arrow {
    transition: transform 0.2s ease;
}

.hover-slide:hover svg.arrow {
    transform: translateX(-3px);
}

.hover-slide:hover {
    border-color: #d1d5db !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Form Layout Polish */
.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

/* Input Fields Styling */
.styled-form input[type="text"],
.styled-form input[type="email"],
.styled-form input[type="date"],
.styled-form input[type="number"],
.styled-form select,
.styled-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    background-color: white;
}

.styled-form input:focus,
.styled-form select:focus,
.styled-form textarea:focus {
    border-color: #16a34a;
    outline: none;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}

.styled-form textarea {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

/* Checkbox Styling */
input[type="checkbox"] {
    accent-color: #16a34a;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Mobile Responsiveness */
@media (max-width: 640px) {
    div[style*="grid-template-columns: 1fr 1fr"],
    .grid-2 {
        grid-template-columns: 1fr !important;
    }

    .avatar-button {
        width: 44px;
        height: 44px;
    }

    .dropdown-menu {
        right: -10px;
        width: 220px;
    }

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

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