/**
 * GW Profile Wizard Avatar Styles
 */

/* Avatar container */
.gw-profile-wizard-avatar-container {
    margin: 30px 0;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
    position: relative;
}

.gw-profile-wizard-avatar-container.loading:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.7);
    z-index: 1;
    border-radius: 8px;
}

.gw-profile-wizard-avatar-container.loading:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--bb-primary-color, #385DFF);
    border-radius: 50%;
    z-index: 2;
    animation: avatar-spin 1s linear infinite;
}

@keyframes avatar-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Avatar message */
.gw-profile-wizard-avatar-message {
    margin-bottom: 15px;
    font-weight: bold;
    color: #333;
    text-align: center;
    min-height: 20px;
}

/* Current avatar */
.gw-profile-wizard-avatar-current {
    text-align: center;
    margin-bottom: 20px;
}

.gw-profile-wizard-avatar-image {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    object-fit: cover;
}

/* Avatar buttons */
.gw-profile-wizard-avatar-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

/* Webcam interface */
.gw-profile-wizard-avatar-webcam-interface {
    text-align: center;
}

.gw-profile-wizard-avatar-webcam {
    margin: 0 auto 20px;
    max-width: 320px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.gw-profile-wizard-avatar-webcam-preview {
    margin: 0 auto 20px;
    max-width: 320px;
}

.gw-profile-wizard-avatar-webcam-preview img {
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.gw-profile-wizard-avatar-webcam-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* Crop interface */
.gw-profile-wizard-avatar-crop-interface {
    text-align: center;
}

.gw-profile-wizard-avatar-crop-container {
    margin: 0 auto 20px;
    display: inline-block;
    position: relative;
}

.gw-profile-wizard-avatar-crop-image {
    display: block;
    max-width: none !important;
    max-height: none !important;
}

.gw-profile-wizard-avatar-crop-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

/* Success interface */
.gw-profile-wizard-avatar-success-interface {
    text-align: center;
}

.gw-profile-wizard-avatar-success-message {
    margin-bottom: 20px;
    font-weight: bold;
    color: #4caf50;
}

.gw-profile-wizard-avatar-preview {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 20px;
}

.gw-profile-wizard-avatar-full,
.gw-profile-wizard-avatar-thumb {
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    object-fit: cover;
}

.gw-profile-wizard-avatar-full {
    width: 150px;
    height: 150px;
}

.gw-profile-wizard-avatar-thumb {
    width: 50px;
    height: 50px;
}

/* Jcrop-specific styles to prevent conflicts */
.gw-profile-wizard-avatar-crop-container .jcrop-holder {
    margin: 0 auto;
    text-align: left;
}

.gw-profile-wizard-avatar-crop-container .jcrop-holder img {
    max-width: none !important;
    max-height: none !important;
}

/* Ensure Jcrop elements don't get affected by theme styles */
.jcrop-tracker,
.jcrop-handle,
.jcrop-dragbar {
    box-sizing: content-box !important;
}

/* Responsive styles */
@media (max-width: 768px) {
    .gw-profile-wizard-avatar-buttons,
    .gw-profile-wizard-avatar-webcam-buttons,
    .gw-profile-wizard-avatar-crop-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .gw-profile-wizard-avatar-preview {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
}
