/* Avatar Manager Styles */

.avatar-manager-container {
    margin-bottom: 20px;
}

.avatar-display-section {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    background-color: #fafbfc;
}

.avatar-preview {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #e1e5e9;
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #6c757d;
    background-color: #f8f9fa;
}

.avatar-placeholder .avatar-icon {
    font-size: 40px;
    margin-bottom: 5px;
}

.avatar-placeholder span {
    font-size: 12px;
    font-weight: 500;
}

.avatar-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.avatar-status {
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 4px;
    font-weight: 500;
}

.avatar-status.uploaded {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.avatar-status.external {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.avatar-status.none {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.avatar-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.avatar-btn {
    padding: 8px 16px;
    border: 1px solid;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: #fff;
    text-align: center;
    white-space: nowrap;
}

.avatar-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.avatar-btn:active {
    transform: translateY(0);
}

.avatar-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.avatar-btn.primary {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

.avatar-btn.primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

.avatar-btn.secondary {
    background-color: #6c757d;
    color: white;
    border-color: #6c757d;
}

.avatar-btn.secondary:hover {
    background-color: #545b62;
    border-color: #545b62;
}

.avatar-btn.danger {
    background-color: #dc3545;
    color: white;
    border-color: #dc3545;
}

.avatar-btn.danger:hover {
    background-color: #c82333;
    border-color: #c82333;
}

/* Crop Modal Styles */
.avatar-crop-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.avatar-crop-content {
    background-color: white;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.avatar-crop-header {
    display: flex;
    justify-content: between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e1e5e9;
}

.avatar-crop-header h3 {
    margin: 0;
    flex: 1;
    font-size: 18px;
    font-weight: 600;
}

.avatar-crop-header .close-button {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.avatar-crop-header .close-button:hover {
    background-color: #f8f9fa;
}

.avatar-crop-body {
    flex: 1;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    max-height: 400px;
    overflow: hidden;
}

.avatar-crop-body img {
    max-width: 100%;
    max-height: 100%;
}

.avatar-crop-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid #e1e5e9;
}

/* Avatar Messages */
.avatar-message {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
}

.avatar-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.avatar-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.avatar-message.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Cropper.js Custom Styles */
.cropper-container {
    font-size: 0;
    line-height: 0;
    position: relative;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    direction: ltr !important;
    -ms-touch-action: none;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
}

.cropper-crop-box {
    border: 2px solid #007bff;
}

.cropper-view-box {
    border: 1px solid #007bff;
    outline: 1px solid rgba(255, 255, 255, 0.75);
    outline-color: rgba(255, 255, 255, 0.75);
}

/* Responsive Design */
@media (max-width: 768px) {
    .avatar-display-section {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .avatar-actions {
        justify-content: center;
    }

    .avatar-crop-content {
        width: 95%;
        margin: 10px;
    }

    .avatar-crop-body {
        min-height: 250px;
        max-height: 300px;
    }

    .avatar-crop-footer {
        flex-direction: column;
    }

    .avatar-crop-footer .avatar-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .avatar-preview {
        width: 100px;
        height: 100px;
    }

    .avatar-btn {
        padding: 10px 16px;
        font-size: 13px;
    }

    .avatar-crop-header,
    .avatar-crop-body,
    .avatar-crop-footer {
        padding: 15px;
    }
}