/* Image Cropper Tool Styles */
.tool-container {
    padding: 120px 0 60px;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.tool-header {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.tool-title {
    font-size: var(--text-4xl);
    font-weight: 700;
    margin: var(--space-lg) 0 var(--space-md);
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tool-description {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Upload Section */
.upload-section {
    margin-bottom: var(--space-2xl);
}

.file-dropzone {
    border: 3px dashed var(--border-medium);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-primary);
    max-width: 500px;
    margin: 0 auto;
}

.file-dropzone:hover {
    border-color: var(--accent-primary);
    background: var(--bg-secondary);
}

.file-dropzone.dragover {
    border-color: var(--accent-primary);
    background: var(--accent-primary);
    color: white;
}

.file-dropzone.dragover .dropzone-icon,
.file-dropzone.dragover h3,
.file-dropzone.dragover p,
.file-dropzone.dragover .file-types {
    color: white;
}

.dropzone-content .dropzone-icon {
    font-size: 3rem;
    margin-bottom: var(--space-md);
}

.dropzone-content h3 {
    font-size: var(--text-xl);
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
}

.dropzone-content p {
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.file-types {
    font-size: var(--text-sm);
    color: var(--text-tertiary);
}

/* Editor Section */
.editor-section {
    margin-bottom: var(--space-2xl);
}

.editor-container {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: var(--space-xl);
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-md);
}

.image-container {
    position: relative;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.crop-overlay {
    position: relative;
    display: inline-block;
}

#previewCanvas {
    max-width: 100%;
    max-height: 500px;
    display: block;
}

.crop-area {
    position: absolute;
    border: 2px solid #3b82f6;
    background: rgba(59, 130, 246, 0.1);
    cursor: move;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.3);
}

.crop-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #3b82f6;
    border: 2px solid white;
    border-radius: 50%;
}

.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;
}

.crop-handle.center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    cursor: move;
    width: 20px;
    height: 20px;
    background: transparent;
    border: 2px dashed #3b82f6;
}

/* Controls Panel */
.controls-panel {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    border: 1px solid var(--border-light);
}

.control-group h4 {
    margin-bottom: var(--space-md);
    color: var(--text-primary);
    font-weight: 600;
}

.control-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
}

.control-row label {
    font-weight: 500;
    color: var(--text-secondary);
    min-width: 80px;
}

.control-row input,
.control-row select {
    width: 120px;
    padding: var(--space-sm);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
}

.control-row input:focus,
.control-row select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.action-buttons {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-xl);
}

.btn-primary {
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: var(--space-md) var(--space-lg);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
}

.btn-primary:hover {
    background: var(--accent-secondary);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    padding: var(--space-md) var(--space-lg);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
}

.btn-secondary:hover {
    background: var(--border-light);
    border-color: var(--accent-primary);
}

/* Result Section */
.result-section {
    margin-bottom: var(--space-2xl);
}

.result-container {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-md);
    text-align: center;
}

.result-container h3 {
    margin-bottom: var(--space-lg);
    color: var(--text-primary);
    font-size: var(--text-xl);
}

.result-preview {
    margin-bottom: var(--space-lg);
}

#resultCanvas {
    max-width: 100%;
    max-height: 400px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.result-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
    align-items: end;
}

.result-stats {
    text-align: left;
}

.result-stats span {
    display: block;
    margin-bottom: var(--space-sm);
    color: var(--text-secondary);
}

.result-stats span span {
    display: inline;
    font-weight: 600;
    color: var(--text-primary);
}

.download-options {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.download-options label {
    font-weight: 500;
    color: var(--text-secondary);
    text-align: left;
}

.download-options select {
    padding: var(--space-sm);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
}

/* Instructions */
.tool-instructions {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    border: 1px solid var(--border-light);
}

.tool-instructions h3 {
    margin-bottom: var(--space-lg);
    color: var(--text-primary);
}

.tool-instructions ol {
    margin-left: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.tool-instructions li {
    margin-bottom: var(--space-sm);
    color: var(--text-secondary);
    line-height: 1.6;
}

.privacy-note {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    color: var(--text-primary);
}

/* Responsive */
@media (max-width: 768px) {
    .editor-container {
        grid-template-columns: 1fr;
    }
    
    .result-info {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .control-row {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-sm);
    }
    
    .control-row input,
    .control-row select {
        width: 100%;
    }
}

.hidden {
    display: none !important;
}