/* User Profile Dropdown Styles */
.user-profile-container {
    position: relative;
    display: flex;
    align-items: center;
    margin-left: 1rem;
}

.user-profile-button {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    margin: 0 -0.5rem 0 0.5rem;
}

.user-profile-button:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
    background-size: cover;
    background-position: center;
}

.user-profile-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    width: 250px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 1000;
    overflow: hidden;
}

.user-profile-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-profile-dropdown::before {
    content: "";
    position: absolute;
    top: -8px;
    right: 15px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid white;
}

.user-profile-item {
    display: flex;
    align-items: center;
    padding: 0.8rem 1rem;
    color: #333;
    text-decoration: none;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s;
}

.user-profile-item:hover {
    background-color: #f5f5f5;
}

.user-profile-item i {
    margin-right: 0.8rem;
    color: #4a7c59;
    width: 1.2rem;
    text-align: center;
}

.user-profile-divider {
    height: 1px;
    background-color: #eee;
}

.user-profile-header {
    padding: 1rem;
    background-color: #f8f9fa;
}

.user-profile-name {
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.user-profile-email {
    font-size: 0.8rem;
    color: #666;
    word-break: break-all;
}

/* Animation for dropdown */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Modern Profile Modal Styles */
.profile-modal {
    padding: 2rem;
    z-index: 3200;
}

.profile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
}

.profile-avatar-container {
    position: relative;
}

.profile-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background-color: #4a7c59;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 2rem;
    margin: 0 auto;
    background-size: cover;
    background-position: center;
    border: 3px solid #f8f9fa;
}

.avatar-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.avatar-actions button {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-upload {
    background-color: #e9ecef;
    color: #495057;
    border: 1px solid #ced4da;
}

.btn-upload:hover {
    background-color: #dee2e6;
}

.btn-remove {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.btn-remove:hover {
    background-color: #f1c1c6;
}

.btn-remove:disabled {
    background-color: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
}

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

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
    font-size: inherit;
}

.editProfileModal.active .editProfileModal-content {
    animation: modalFadeIn 0.3s ease-out;
}

.modern-profile-modal {
    position: relative;
    width: 100%;
    max-width: 600px;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 0;
    animation: modalFadeIn 0.3s ease-out;
}

.profile-header-container {
    position: relative;
    height: 180px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.profile-picture-container {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-50%);
    z-index: 2;
}

.profile-picture-wrapper {
    position: relative;
    width: 120px;
    height: 120px;
}

.profile-picture {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: #4a7c59;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 2.5rem;
    border: 4px solid white;
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.profile-picture-actions {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.profile-picture:hover .profile-picture-actions {
    opacity: 1;
}

.profile-picture-actions button,
.profile-picture-actions label {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #4a7c59;
}

.profile-picture-actions button:hover,
.profile-picture-actions label:hover {
    background: white;
    transform: scale(1.1);
    color: #28a745;
}

.profile-picture-actions button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.profile-picture-actions i {
    font-size: 1.1rem;
}

.profile-info-container {
    margin-top: 1.5rem;
    text-align: center;
}

.profile-modal-title {
    margin: 0;
    color: #333;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.profile-modal-icon {
    color: #4a7c59;
}

.editProfileModal-close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 3;
    color: #666;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s;
}

.editProfileModal-close-btn:hover {
    color: #333;
    transition: color 0.3s;
}

.profile-form {
    padding: 0 2rem 2rem;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #495057;
}

.form-group input,
.form-group textarea {
    padding: 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: #4a7c59;
    outline: none;
    box-shadow: 0 0 0 2px rgba(74, 124, 89, 0.2);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.btn-submit {
    background-color: #4a7c59;
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-submit:hover {
    background-color: #3a6249;
}

.btn-cancel {
    background-color: #f8f9fa;
    color: #495057;
    padding: 0.75rem 1.5rem;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cancel:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .user-profile-dropdown {
        width: 220px;
        right: -10px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .profile-picture-wrapper {
        width: 100px;
        height: 100px;
    }

    .profile-picture {
        font-size: 2rem;
    }

    .profile-header-container {
        height: 150px;
    }

    .profile-avatar {
        width: 80px;
        height: 80px;
        font-size: 1.5rem;
    }
}

/* Animation for modal */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Spinner animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spinner {
    display: inline-block;
    animation: spin 1s linear infinite;
}

/* Image Crop Modal Styles */
.image-crop-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.45);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    animation: modalFadeIn 0.3s ease-out;
}

.crop-modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
}

.crop-modal-header {
    padding: 1.2rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.crop-modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #333;
    font-weight: 600;
}

.crop-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 0.3rem;
    border-radius: 50%;
    transition: color 0.2s;
}

.crop-modal-close:hover {
    color: #333;
    transition: color 0.2s;
}

.crop-modal-body {
    padding: 1.5rem;
    flex-grow: 1;
    overflow: hidden;
}

.cropper-wrapper {
    width: 100%;
    height: 350px;
    max-height: 70vh;
}

.cropper-wrapper img {
    max-width: 100%;
    display: block;
}

cropper-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.crop-modal-footer {
    padding: 1.2rem;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 0.8rem;
}

.crop-modal-footer .btn-cancel {
    background-color: #f8f9fa;
    color: #333;
    padding: 0.6rem 1.2rem;
    border: 1px solid #eee;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.crop-modal-footer .btn-cancel:hover {
    background-color: #f5f5f5;
}

.crop-modal-footer .btn-submit {
    background-color: var(--primary-color);
    color: white;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.crop-modal-footer .btn-submit:hover {
    background-color: #3a6249;
}

/* Animation for crop modal */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Responsive adjustments for crop modal */
@media (max-width: 768px) {
    .crop-modal-body {
        padding: 0.5rem;
    }
    
    .crop-modal-content {
        width: 95%;
        margin: 0 10px;
    }

    .cropper-container {
        height: 280px;
    }
}