/* Style sheet for Smart Passport Photo ID Maker */

.hihi-photo-id-maker {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Checkerboard background for transparent backgrounds */
.bg-transparent-checkerboard {
    background-color: #ffffff;
    background-image: linear-gradient(45deg, #e2e8f0 25%, transparent 25%),
                      linear-gradient(-45deg, #e2e8f0 25%, transparent 25%),
                      linear-gradient(45deg, transparent 75%, #e2e8f0 75%),
                      linear-gradient(-45deg, transparent 75%, #e2e8f0 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
}

/* Crop workspace styling */
#photo-canvas-container {
    position: relative;
    user-select: none;
    -webkit-user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
}

#photo-crop-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Let clicks pass through to box and handles */
}

#photo-crop-box {
    box-sizing: border-box;
    pointer-events: auto; /* Active cursor dragging */
    box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.75); /* Darken surrounding area */
    border: 2px dashed #4f46e5;
    transition: none; /* Instant feedback on drag/resize */
}

/* Guide oval inside crop box representing face silhouette */
#photo-crop-box::after {
    content: '';
    position: absolute;
    width: 55%;
    height: 70%;
    top: 15%;
    left: 22.5%;
    border: 2px dashed rgba(255, 255, 255, 0.45);
    border-radius: 50% 50% 50% 50% / 50% 50% 50% 50%;
    pointer-events: none;
}

/* Resize handles positioning and touch safety size */
.crop-handle {
    width: 14px;
    height: 14px;
    background-color: #ffffff;
    border: 2px solid #4f46e5;
    border-radius: 50%;
    position: absolute;
    pointer-events: auto;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 100;
}

.crop-handle::before {
    content: '';
    position: absolute;
    top: -12px;
    left: -12px;
    right: -12px;
    bottom: -12px; /* Expand hit targets for fingers on mobile devices */
}

.crop-handle.top-left {
    top: -7px;
    left: -7px;
    cursor: nwse-resize;
}

.crop-handle.top-right {
    top: -7px;
    right: -7px;
    cursor: nesw-resize;
}

.crop-handle.bottom-left {
    bottom: -7px;
    left: -7px;
    cursor: nesw-resize;
}

.crop-handle.bottom-right {
    bottom: -7px;
    right: -7px;
    cursor: nwse-resize;
}

/* Range input styling overrides for Tailwind */
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #4f46e5;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    transition: transform 0.1s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border: none;
    border-radius: 50%;
    background: #4f46e5;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    transition: transform 0.1s;
}

input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.2);
}

/* Animations and modal helpers */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.animate-spin {
    animation: spin 1s linear infinite;
}
