/**
 * Cropper TwoMates - Estilos
 *
 * @package CropperTwoMates
 */

.ctm-media-field {
    max-width: 400px;
}

.ctm-preview {
    border: 2px dashed #ddd;
    border-radius: 4px;
    padding: 20px;
    text-align: center;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
    margin-bottom: 10px;
}

.ctm-preview.has-image {
    border-style: solid;
    border-color: #0073aa;
    padding: 10px;
    background: #fff;
}

.ctm-preview img {
    max-width: 100%;
    max-height: 200px;
    height: auto;
    display: block;
}

.ctm-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.ctm-preset-info {
    color: #666;
    font-style: italic;
    margin: 0;
}

/* Modal de Crop */
.ctm-crop-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 100100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ctm-crop-modal {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ctm-crop-modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ctm-crop-modal-header h3 {
    margin: 0;
    font-size: 16px;
}

.ctm-crop-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    line-height: 1;
}

.ctm-crop-modal-close:hover {
    color: #d63638;
}

.ctm-crop-modal-body {
    padding: 20px;
    overflow: auto;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ctm-crop-container {
    max-width: 800px;
    max-height: 60vh;
}

.ctm-crop-container img {
    max-width: 100%;
    display: block;
}

.ctm-crop-modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #ddd;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.ctm-crop-modal-footer .button-primary {
    min-width: 150px;
}

/* Loading state */
.ctm-media-field.is-loading .ctm-preview {
    opacity: 0.5;
    pointer-events: none;
}

.ctm-media-field.is-loading .ctm-actions button {
    pointer-events: none;
    opacity: 0.5;
}

/* Cropper.js overrides */
.cropper-view-box,
.cropper-face {
    border-radius: 0;
}

.cropper-view-box {
    outline: 3px dashed #00e5ff;
    outline-offset: -3px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.7), 0 0 0 4px rgba(0, 229, 255, 0.3), 0 0 20px rgba(0, 0, 0, 0.4);
}

.cropper-line,
.cropper-point {
    background-color: #00e5ff;
}

.cropper-line {
    opacity: 0.9;
}

.cropper-point {
    width: 10px;
    height: 10px;
    opacity: 1;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.7), 0 0 8px rgba(0, 229, 255, 0.8);
}

.cropper-modal {
    background-color: rgba(0, 0, 0, 0.5);
}

/* Modal de confirmação customizado */
.ctm-confirm-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 100200;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: ctmFadeIn 0.2s ease;
}

@keyframes ctmFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.ctm-confirm-modal {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 420px;
    width: 90%;
    overflow: hidden;
    animation: ctmSlideUp 0.3s ease;
}

@keyframes ctmSlideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.ctm-confirm-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e5e5e5;
}

.ctm-confirm-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1d2327;
}

.ctm-confirm-modal-body {
    padding: 24px;
}

.ctm-confirm-modal-body p {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: #50575e;
}

.ctm-confirm-modal-footer {
    padding: 16px 24px;
    background: #f6f7f7;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.ctm-confirm-modal-footer .button {
    min-width: 120px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
}

.ctm-confirm-modal-footer .button-secondary {
    background: #fff;
    border-color: #c3c4c7;
    color: #2c3338;
}

.ctm-confirm-modal-footer .button-secondary:hover {
    background: #f6f7f7;
    border-color: #8c8f94;
}

.ctm-confirm-modal-footer .button-primary {
    background: #d63638;
    border-color: #d63638;
}

.ctm-confirm-modal-footer .button-primary:hover {
    background: #b32d2e;
    border-color: #b32d2e;
}
