/**
 * BuddyPress Custom Avatar Plugin Styles
 */

.bp-custom-avatar-form {
    max-width: 600px;
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Current Avatar Section */
.bp-custom-avatar-current {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.bp-custom-avatar-current h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    font-size: 18px;
}

.avatar-preview {
    margin-bottom: 15px;
}

.avatar-preview img {
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Upload Methods Section */
.bp-custom-avatar-methods {
    margin-bottom: 30px;
}

.bp-custom-avatar-methods h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 18px;
}

/* Tab Navigation */
.bp-custom-avatar-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.tab-button {
    background: none;
    border: none;
    padding: 12px 20px;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.tab-button:hover {
    color: #333;
    background: #f5f5f5;
}

.tab-button.active {
    color: #0073aa;
    border-bottom-color: #0073aa;
    background: #f5f5f5;
}

/* Tab Content */
.tab-content {
    display: none;
    padding: 20px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.tab-content.active {
    display: block;
}

/* Upload Area */
.upload-area {
    text-align: center;
}

.upload-dropzone {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 40px 20px;
    margin-bottom: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafafa;
}

.upload-dropzone:hover {
    border-color: #0073aa;
    background: #f0f8ff;
}

.upload-dropzone.dragover {
    border-color: #0073aa;
    background: #e6f3ff;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.6;
}

.upload-dropzone p {
    margin: 10px 0;
    color: #666;
}

.upload-info {
    font-size: 12px;
    color: #999;
}

/* Progress Bars */
.upload-progress,
.crop-progress {
    margin: 20px 0;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #03989e, #027378);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 10px;
}

.progress-text {
    text-align: center;
    margin: 0;
    color: #666;
    font-size: 14px;
}

/* Webcam Section */
.webcam-container {
    text-align: center;
}

#webcam-preview {
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
    background: #000;
    position: relative;
}

#webcam-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.webcam-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Crop Section */
.bp-custom-avatar-crop {
    margin-top: 30px;
    padding: 20px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.bp-custom-avatar-crop h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    font-size: 18px;
}

.crop-container {
    text-align: center;
}

.crop-preview {
    margin-bottom: 20px;
    max-height: 400px;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.crop-preview img {
    max-width: 100%;
    height: auto;
    display: block;
}

.crop-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Messages */
.bp-custom-avatar-messages {
    margin: 20px 0;
}

.avatar-message {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 10px;
    font-size: 14px;
}

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

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

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

/* Buttons */
.button {
    display: inline-block;
    padding: 8px 16px;
    margin: 4px;
    background: #f7f7f7;
    border: 1px solid #ccc;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.4;
    transition: all 0.3s ease;
}

.button:hover {
    background: #e6e6e6;
    border-color: #999;
    color: #333;
}

.button-primary {
    background: #03989e;
    border-color: #03989e;
    color: #fff;
}

.button-primary:hover {
    background: #027378;
    border-color: #027378;
    color: #fff;
}

.button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.bp-custom-avatar-delete {
    background: #dc3545;
    border-color: #dc3545;
    color: #fff;
}

.bp-custom-avatar-delete:hover {
    background: #c82333;
    border-color: #bd2130;
    color: #fff;
}

/* Responsive Design */
@media (max-width: 768px) {
    .bp-custom-avatar-form {
        max-width: 100%;
        margin: 10px 0;
    }
    
    .bp-custom-avatar-tabs {
        flex-direction: column;
    }
    
    .tab-button {
        text-align: left;
        border-bottom: 1px solid #e0e0e0;
        border-right: none;
    }
    
    .tab-button.active {
        border-bottom-color: #e0e0e0;
        border-left: 3px solid #0073aa;
    }
    
    .upload-dropzone {
        padding: 20px 10px;
    }
    
    .webcam-controls,
    .crop-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .button {
        width: 100%;
        max-width: 200px;
        text-align: center;
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus States */
.button:focus,
.tab-button:focus,
.upload-dropzone:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .upload-dropzone {
        border-width: 3px;
    }
    
    .button {
        border-width: 2px;
    }
    
    .avatar-message {
        border-width: 2px;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .button,
    .tab-button,
    .upload-dropzone,
    .progress-fill {
        transition: none;
    }
    
    .loading::after {
        animation: none;
    }
}

