/**
 * Image Cropper Modal Styles
 * Sistema de crop circular para fotos e logos
 * v1.0.0
 */

/* Modal Overlay */
.wc-crop-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.wc-crop-modal-overlay.active {
    display: flex;
}

/* Modal Container */
.wc-crop-modal {
    background: #fff;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

/* Modal Header */
.wc-crop-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wc-crop-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 8px;
}

.wc-crop-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    transition: color 0.2s;
}

.wc-crop-close-btn:hover {
    color: #1f2937;
}

/* Modal Body */
.wc-crop-modal-body {
    padding: 24px;
    max-height: calc(90vh - 180px);
    overflow-y: auto;
}

/* Cropper Container - NOVO com Canvas */
.wc-crop-container,
.wc-crop-container-new {
    position: relative;
    width: 100%;
    height: 400px;
    background: 
        repeating-conic-gradient(#f0f0f0 0% 25%, transparent 0% 50%) 
        50% / 20px 20px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.wc-crop-container img {
    max-width: 100%;
    display: block;
}

/* Canvas do Crop */
#wc-crop-canvas {
    cursor: move;
    border-radius: 8px;
}

/* Overlay visual para indicar área de crop circular */
.wc-crop-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300px;
    height: 300px;
    transform: translate(-50%, -50%);
    border: 3px dashed rgba(4, 30, 66, 0.5);
    border-radius: 50%;
    pointer-events: none;
    z-index: 5;
}

/* Zoom Value Display */
.wc-crop-zoom-value {
    min-width: 50px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #041E42;
}

/* Helper Text */
.wc-crop-helper-text {
    padding: 12px 16px;
    background: #f0f9ff;
    border-radius: 8px;
    font-size: 13px;
    color: #1e40af;
    text-align: center;
    border: 1px solid #bfdbfe;
}

/* Controles de Zoom */
.wc-crop-controls {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.wc-crop-control-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wc-crop-control-label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    min-width: 50px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.wc-crop-slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #e5e7eb;
    outline: none;
    -webkit-appearance: none;
}

.wc-crop-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #041E42;
    cursor: pointer;
    transition: transform 0.2s;
}

.wc-crop-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.wc-crop-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #041E42;
    cursor: pointer;
    border: none;
    transition: transform 0.2s;
}

.wc-crop-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
}

/* Botões de Zoom */
.wc-crop-zoom-btns {
    display: flex;
    gap: 8px;
}

.wc-crop-zoom-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #d1d5db;
    background: #fff;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wc-crop-zoom-btn:hover {
    background: #f9fafb;
    border-color: #041E42;
    color: #041E42;
}

/* Botões de Rotação */
.wc-crop-rotate-btns {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.wc-crop-rotate-btn {
    padding: 8px 16px;
    border: 1px solid #d1d5db;
    background: #fff;
    border-radius: 6px;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.wc-crop-rotate-btn:hover {
    background: #f9fafb;
    border-color: #041E42;
    color: #041E42;
}

/* Modal Footer */
.wc-crop-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: #f9fafb;
}

.wc-crop-btn-cancel,
.wc-crop-btn-save {
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.wc-crop-btn-cancel {
    background: #fff;
    color: #6b7280;
    border: 1px solid #d1d5db;
}

.wc-crop-btn-cancel:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.wc-crop-btn-save {
    background: #041E42;
    color: #fff;
}

.wc-crop-btn-save:hover {
    background: #03172e;
}

.wc-crop-btn-save:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

/* Loading State */
.wc-crop-loading {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.wc-crop-loading.active {
    display: flex;
}

.wc-crop-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e5e7eb;
    border-top-color: #041E42;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Ajustes no preview da foto existente */
.wc-foto-preview,
.wc-logo-preview {
    position: relative;
}

.wc-foto-preview img,
.wc-logo-preview-img {
    border-radius: 50%;
    object-fit: cover;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsivo */
@media (max-width: 640px) {
    .wc-crop-modal {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .wc-crop-container {
        height: 300px;
    }
    
    .wc-crop-modal-body {
        max-height: calc(100vh - 180px);
    }
    
    .wc-crop-control-group {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .wc-crop-control-label {
        min-width: auto;
    }
    
    .wc-crop-slider {
        width: 100%;
    }
}
