/* Crop Image specific styles */

main {
    padding: 20px;
}

.tool-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Upload Section */
.upload-section {
    margin-bottom: 30px;
}

.upload-area {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    background: #fafafa;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover {
    border-color: #007bff;
    background: #f0f8ff;
}

.upload-area.dragover {
    border-color: #007bff;
    background: #e3f2fd;
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

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

.upload-content h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
}

.upload-content p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

/* Crop Section */
.crop-section {
    margin-bottom: 30px;
}

.crop-controls {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.control-group label {
    font-weight: 500;
    font-size: 14px;
    color: #333;
}

.control-group select,
.control-group input[type="range"] {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.control-group input[type="range"] {
    width: 120px;
}

/* Crop Workspace */
.crop-workspace {
    margin-bottom: 20px;
}

.crop-container {
    position: relative;
    display: inline-block;
    max-width: 100%;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: #f9f9f9;
}

.image-container {
    position: relative;
    display: inline-block;
}

.image-container img {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Crop Overlay */
.crop-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.crop-box {
    position: absolute;
    border: 2px solid #007bff;
    background: rgba(0, 123, 255, 0.1);
    cursor: move;
    pointer-events: all;
    min-width: 20px;
    min-height: 20px;
}

.crop-box::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

/* Crop Handles */
.crop-handle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #007bff;
    border: 2px solid #fff;
    border-radius: 50%;
    pointer-events: all;
}

.crop-handle.nw {
    top: -6px;
    left: -6px;
    cursor: nw-resize;
}

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

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

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

.crop-handle.n {
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    cursor: n-resize;
}

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

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

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

/* Crop Actions */
.crop-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Result Section */
.result-section {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.result-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
}

.result-container {
    text-align: center;
    margin-bottom: 15px;
}

.result-container img {
    max-width: 100%;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.result-info {
    text-align: center;
    color: #666;
    font-size: 14px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #1e7e34;
}

/* Responsive Design */
@media (max-width: 768px) {
    .crop-controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .control-group {
        flex-direction: row;
        align-items: center;
        gap: 10px;
    }
    
    .control-group label {
        min-width: 120px;
    }
    
    .crop-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 200px;
    }
}
