:root {
    --accent: #2563eb;
}

body,
html {
    height: 100%;
    margin: 0;
    overflow: hidden;
    background-color: #f8fafc;
    color: #0f172a;
    display: flex;
    flex-direction: column;
}

/* Dropzone area */
#dropzone {
    transition: background-color 0.2s, border-color 0.2s;
}

#dropzone.dragover {
    background-color: #eff6ff;
    border-color: var(--accent);
}

/* Workspace and Crop Overlay */
#image-container {
    display: none;
    position: relative;
    flex: 1;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 20px;
}

#target-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    pointer-events: none;
    user-select: none;
}

#crop-area {
    position: absolute;
    display: none;
    touch-action: none;
}

/* Dark overlays to dim uncropped area */
.overlay-mask {
    position: absolute;
    background: rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

#mask-top {
    top: 0;
    left: 0;
    right: 0;
}

#mask-bottom {
    bottom: 0;
    left: 0;
    right: 0;
}

#mask-left {
    top: 0;
    bottom: 0;
    left: 0;
}

#mask-right {
    top: 0;
    bottom: 0;
    right: 0;
}

/* Crop Box */
#crop-box {
    position: absolute;
    border: 2px solid var(--accent);
    cursor: move;
    box-sizing: border-box;
    background: transparent;
}

/* Grid lines */
#crop-box::before,
#crop-box::after {
    content: '';
    position: absolute;
    pointer-events: none;
}

#crop-box::before {
    top: 33.33%;
    bottom: 33.33%;
    left: 0;
    right: 0;
    border-top: 1px dashed rgba(255, 255, 255, 0.5);
    border-bottom: 1px dashed rgba(255, 255, 255, 0.5);
}

#crop-box::after {
    left: 33.33%;
    right: 33.33%;
    top: 0;
    bottom: 0;
    border-left: 1px dashed rgba(255, 255, 255, 0.5);
    border-right: 1px dashed rgba(255, 255, 255, 0.5);
}

/* Handles */
.crop-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background-color: var(--accent);
    border: 1px solid white;
    box-sizing: border-box;
}

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

.n {
    top: -6px;
    left: calc(50% - 6px);
    cursor: ns-resize;
}

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

.e {
    top: calc(50% - 6px);
    right: -6px;
    cursor: ew-resize;
}

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

.s {
    bottom: -6px;
    left: calc(50% - 6px);
    cursor: ns-resize;
}

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

.w {
    top: calc(50% - 6px);
    left: -6px;
    cursor: ew-resize;
}

.support-card {
    display: block;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}

.support-card:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
    transform: translateY(-1px);
}
