/* Resize/Crop Video Tool Styles */
.resize-option-group {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.dimension-inputs, .crop-inputs {
    margin-top: 0.75rem;
}

.dimension-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    max-width: 400px;
}

.dimension-input-group {
    display: flex;
    flex-direction: column;
}

.dimension-input-group label {
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.dimension-input {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: var(--transition);
    text-align: center;
}

.dimension-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: var(--box-shadow-primary-light);
}

.dimension-input:hover {
    border-color: var(--primary-color);
}

.aspect-ratio-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: var(--surface-primary);
    border-radius: 6px;
}

.aspect-ratio-controls label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-primary);
    cursor: pointer;
    margin-bottom: 0;
}

/* Custom checkbox styling */
.aspect-ratio-controls input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    background: var(--surface-primary);
    cursor: pointer;
    position: relative;
    transition: var(--transition);
    flex-shrink: 0;
}

.aspect-ratio-controls input[type="checkbox"]:hover {
    border-color: var(--primary-color);
    background: var(--surface-hover);
}

.aspect-ratio-controls input[type="checkbox"]:checked {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.aspect-ratio-controls input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
    line-height: 1;
}

.aspect-ratio-controls input[type="checkbox"]:focus {
    outline: none;
    box-shadow: var(--box-shadow-primary-medium);
}

/* Video Preview and Crop Overlay Styles */
.video-preview-container {
    position: relative;
    margin: 1rem 0;
    max-width: 800px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000;
    border-radius: var(--border-radius);
    overflow: hidden;
    min-height: 300px;
}

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

.preview-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(0, 0, 0, 0.8);
}

.preview-placeholder i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.preview-placeholder p {
    font-size: 1.1rem;
    margin: 0;
}

.crop-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.crop-area {
    position: absolute;
    border: 2px solid var(--primary-color);
    background: var(--surface-secondary);
    pointer-events: all;
    cursor: move;
    min-width: 50px;
    min-height: 50px;
}

.crop-area::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 2px;
    pointer-events: none;
}

.crop-handle {
    position: absolute;
    background: var(--primary-color);
    border: 2px solid white;
    border-radius: 50%;
    pointer-events: all;
}

.crop-handle.corner {
    width: 12px;
    height: 12px;
}

.crop-handle.edge {
    background: var(--primary-color);
    border-radius: 2px;
}

.crop-handle.move {
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    cursor: move;
    background: var(--secondary-alpha-80);
    border: 2px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.crop-handle.move::after {
    content: '⋮⋮';
    color: white;
    font-size: 8px;
    line-height: 1;
    letter-spacing: -1px;
}

/* Corner handles */
.crop-handle.top-left {
    top: -6px;
    left: -6px;
    cursor: nw-resize;
}

.crop-handle.top-right {
    top: -6px;
    right: -6px;
    cursor: ne-resize;
}

.crop-handle.bottom-left {
    bottom: -6px;
    left: -6px;
    cursor: sw-resize;
}

.crop-handle.bottom-right {
    bottom: -6px;
    right: -6px;
    cursor: se-resize;
}

/* Edge handles */
.crop-handle.top {
    top: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 6px;
    cursor: n-resize;
}

.crop-handle.bottom {
    bottom: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 6px;
    cursor: s-resize;
}

.crop-handle.left {
    left: -3px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 20px;
    cursor: w-resize;
}

.crop-handle.right {
    right: -3px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 20px;
    cursor: e-resize;
}

/* Mobile-friendly touch targets */
@media (max-width: 768px) {
    .crop-handle.corner {
        width: 20px;
        height: 20px;
    }
    
    .crop-handle.top-left {
        top: -10px;
        left: -10px;
    }

    .crop-handle.top-right {
        top: -10px;
        right: -10px;
    }

    .crop-handle.bottom-left {
        bottom: -10px;
        left: -10px;
    }

    .crop-handle.bottom-right {
        bottom: -10px;
        right: -10px;
    }
    
    .crop-handle.top, .crop-handle.bottom {
        width: 40px;
        height: 12px;
    }
    
    .crop-handle.top {
        top: -6px;
    }
    
    .crop-handle.bottom {
        bottom: -6px;
    }
    
    .crop-handle.left, .crop-handle.right {
        width: 12px;
        height: 40px;
    }
    
    .crop-handle.left {
        left: -6px;
    }
    
    .crop-handle.right {
        right: -6px;
    }
    
    .crop-handle.move {
        width: 30px;
        height: 30px;
    }
    
    /* Prevent page scrolling when interacting with crop area */
    .video-preview-container {
        touch-action: none;
    }
    
    .crop-area {
        touch-action: none;
    }
    
    .crop-handle {
        touch-action: none;
    }
}

.crop-handle:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

.crop-handle.top:hover, .crop-handle.bottom:hover {
    transform: translateX(-50%) scale(1.1);
}

.crop-handle.left:hover, .crop-handle.right:hover {
    transform: translateY(-50%) scale(1.1);
}

.crop-handle.move:hover {
    transform: translate(-50%, -50%) scale(1.1);
    background: var(--secondary-alpha-90);
} 