/**
 * VerifyHuman Plugin Styles
 * Clean, modern UI for human verification modal
 */

/* Modal Base */
.verifyhuman-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.verifyhuman-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.verifyhuman-modal-content {
    position: relative;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    margin: 5vh auto;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    animation: verifyhuman-fadeInUp 0.3s ease-out;
}

@keyframes verifyhuman-fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Modal Header */
.verifyhuman-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.verifyhuman-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.verifyhuman-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.verifyhuman-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Modal Body */
.verifyhuman-modal-body {
    padding: 24px;
    min-height: 200px;
}

.verifyhuman-step {
    text-align: center;
}

.verifyhuman-step p {
    color: #666;
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 24px;
}

/* Buttons */
.verifyhuman-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    min-width: 120px;
    margin: 0 8px 8px 0;
}

.verifyhuman-btn:last-child {
    margin-right: 0;
}

.verifyhuman-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.verifyhuman-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.verifyhuman-btn-secondary {
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
}

.verifyhuman-btn-secondary:hover {
    background: #e9ecef;
    transform: translateY(-1px);
}

.verifyhuman-btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.verifyhuman-btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.verifyhuman-btn-light {
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

.verifyhuman-btn-light:hover {
    background: #e9ecef;
}

.verifyhuman-icon {
    margin-right: 8px;
    font-size: 16px;
}

/* Options Layout */
.verifyhuman-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 280px;
    margin: 0 auto;
}

@media (min-width: 480px) {
    .verifyhuman-options {
        flex-direction: row;
        max-width: none;
        justify-content: center;
    }
}

/* Webcam */
.verifyhuman-webcam-container {
    position: relative;
    margin-bottom: 20px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

#verifyhuman-video {
    width: 100%;
    height: auto;
    border-radius: 8px;
    background: #000;
    max-height: 300px;
    object-fit: cover;
}

.verifyhuman-webcam-controls {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.verifyhuman-help-text {
    font-size: 14px;
    color: #6c757d;
    margin: 16px 0 0 0;
}

/* File Upload */
.verifyhuman-upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 40px 20px;
    margin-bottom: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #f8f9fa;
}

.verifyhuman-upload-area:hover,
.verifyhuman-upload-area.verifyhuman-drag-over {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.verifyhuman-upload-content {
    text-align: center;
}

.verifyhuman-upload-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 16px;
    opacity: 0.6;
}

.verifyhuman-upload-area p {
    margin: 0;
    color: #6c757d;
    font-size: 16px;
}

/* Preview */
.verifyhuman-preview-container {
    margin-bottom: 20px;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

#verifyhuman-preview-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-height: 300px;
    object-fit: cover;
}

.verifyhuman-preview-controls {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Loading */
.verifyhuman-loading {
    padding: 40px 20px;
    text-align: center;
}

.verifyhuman-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: verifyhuman-spin 1s linear infinite;
}

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

.verifyhuman-loading p {
    color: #6c757d;
    font-size: 16px;
    margin: 0;
}

/* Success */
.verifyhuman-success {
    padding: 40px 20px;
    text-align: center;
}

.verifyhuman-success-icon {
    display: block;
    font-size: 64px;
    color: #28a745;
    margin-bottom: 20px;
    animation: verifyhuman-bounce 0.6s ease-out;
}

@keyframes verifyhuman-bounce {
    0% { transform: scale(0.3); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.verifyhuman-success h4 {
    color: #28a745;
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 12px 0;
}

.verifyhuman-success p {
    color: #6c757d;
    font-size: 16px;
    margin: 0;
}

/* Error */
.verifyhuman-error {
    padding: 40px 20px;
    text-align: center;
}

.verifyhuman-error-icon {
    display: block;
    font-size: 64px;
    color: #dc3545;
    margin-bottom: 20px;
}

.verifyhuman-error h4 {
    color: #dc3545;
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 12px 0;
}

.verifyhuman-error p {
    color: #6c757d;
    font-size: 16px;
    margin: 0 0 24px 0;
}

/* Responsive Design */
@media (max-width: 576px) {
    .verifyhuman-modal-content {
        width: 95%;
        margin: 2.5vh auto;
        max-height: 95vh;
    }
    
    .verifyhuman-modal-header {
        padding: 16px 20px;
    }
    
    .verifyhuman-modal-header h3 {
        font-size: 16px;
    }
    
    .verifyhuman-modal-body {
        padding: 20px;
    }
    
    .verifyhuman-btn {
        padding: 10px 16px;
        font-size: 14px;
        min-width: 100px;
    }
    
    .verifyhuman-options {
        gap: 8px;
    }
    
    .verifyhuman-webcam-controls {
        gap: 8px;
    }
    
    .verifyhuman-preview-controls {
        gap: 8px;
    }
    
    .verifyhuman-upload-area {
        padding: 30px 15px;
    }
    
    .verifyhuman-upload-icon {
        font-size: 36px;
        margin-bottom: 12px;
    }
}

/* High DPI / Retina Support */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .verifyhuman-spinner {
        border-width: 2px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .verifyhuman-modal-content {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .verifyhuman-step p {
        color: #a0aec0;
    }
    
    .verifyhuman-btn-secondary {
        background: #4a5568;
        color: #e2e8f0;
        border-color: #2d3748;
    }
    
    .verifyhuman-btn-secondary:hover {
        background: #2d3748;
    }
    
    .verifyhuman-btn-light {
        background: #4a5568;
        color: #e2e8f0;
        border-color: #2d3748;
    }
    
    .verifyhuman-btn-light:hover {
        background: #2d3748;
    }
    
    .verifyhuman-upload-area {
        background: #4a5568;
        border-color: #2d3748;
    }
    
    .verifyhuman-upload-area:hover,
    .verifyhuman-upload-area.verifyhuman-drag-over {
        background: rgba(102, 126, 234, 0.1);
    }
    
    .verifyhuman-upload-area p {
        color: #a0aec0;
    }
    
    .verifyhuman-loading p {
        color: #a0aec0;
    }
    
    .verifyhuman-success p {
        color: #a0aec0;
    }
    
    .verifyhuman-error p {
        color: #a0aec0;
    }
    
    .verifyhuman-help-text {
        color: #a0aec0;
    }
}

/* Accessibility */
.verifyhuman-btn:focus,
.verifyhuman-close:focus,
.verifyhuman-upload-area:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .verifyhuman-modal-content {
        animation: none;
    }
    
    .verifyhuman-spinner {
        animation: none;
        border: 3px solid #667eea;
    }
    
    .verifyhuman-success-icon {
        animation: none;
    }
    
    .verifyhuman-btn {
        transition: none;
    }
    
    .verifyhuman-btn:hover {
        transform: none;
    }
}

/* Print Styles */
@media print {
    .verifyhuman-modal {
        display: none !important;
    }
}