/* Avatar Cropper - Stylesheet */

/* Tool-specific variables */
:root {
    --success: #22c55e;
    --drop-zone-bg: #1a1a2e;
    --drop-zone-border: #3a3a50;
}

[data-theme="light"] {
    --drop-zone-bg: #ffffff;
    --drop-zone-border: #cbd5e1;
}

/* Drop zone */
.drop-zone {
    background: var(--drop-zone-bg);
    border: 2px dashed var(--drop-zone-border);
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
    margin-bottom: 1.5rem;
}

.drop-zone:hover {
    border-color: var(--accent);
}

.drop-zone.drag-over {
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.1);
}

.drop-zone-content {
    pointer-events: none;
}

.drop-icon {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.drop-text {
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.drop-subtext {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Editor */
.editor {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.editor-canvas-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    min-height: 300px;
    overflow: hidden;
}

#editor-canvas {
    max-width: 100%;
    max-height: 500px;
    display: block;
}

.crop-overlay {
    position: absolute;
    border: 2px solid var(--accent);
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
    cursor: move;
    touch-action: none;
}

.crop-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    border: 1px dashed rgba(255, 255, 255, 0.3);
}

/* Resize handles */
.crop-overlay::after {
    content: '';
    position: absolute;
    bottom: -6px;
    right: -6px;
    width: 12px;
    height: 12px;
    background: var(--accent);
    border-radius: 2px;
    cursor: se-resize;
}

.editor-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    border-top: 1px solid var(--border);
    background: var(--bg-primary);
}

.preview-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

#preview-canvas {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.editor-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem;
    border-top: 1px solid var(--border);
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-secondary {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--accent);
}

/* Result */
.result {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.result-preview {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.result-preview img {
    width: 256px;
    height: 256px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.result-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.result-stat {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Responsive - tool specific */
@media (max-width: 640px) {
    .drop-zone {
        padding: 2rem 1rem;
    }

    .result-preview img {
        width: 200px;
        height: 200px;
    }

    .editor-actions {
        flex-direction: column;
    }

    .editor-actions .btn {
        width: 100%;
        justify-content: center;
    }
}
