/* ==========================================================================
   Passport Photo Validator Pro – Frontend Styles
   ========================================================================== */

/* --- Upload wrapper ----------------------------------------------------- */
.ppv-upload-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

/* --- Feedback message --------------------------------------------------- */
.ppv-feedback {
    margin-top: 8px;
    padding: 10px 14px;
    border-radius: 4px;
    font-size: 0.9em;
    line-height: 1.5;
    display: none;
    border-left: 4px solid transparent;
}

.ppv-feedback.ppv-checking {
    background: #f0f8ff;
    border-color: #0073aa;
    color: #0073aa;
}

.ppv-feedback.ppv-valid {
    background: #edfaee;
    border-color: #46b450;
    color: #1a6b20;
}

.ppv-feedback.ppv-invalid {
    background: #fdecea;
    border-color: #dc3232;
    color: #8b1a1a;
}

/* --- Check list inside feedback ---------------------------------------- */
.ppv-check-list {
    list-style: none;
    margin: 6px 0 0;
    padding: 0;
}

.ppv-check-list li {
    padding: 2px 0;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.88em;
}

.ppv-check-list .ppv-pass::before { content: "✅"; }
.ppv-check-list .ppv-fail::before { content: "❌"; }

/* --- Cropper modal ------------------------------------------------------- */
.ppv-cropper-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.75);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.ppv-cropper-modal {
    background: #fff;
    border-radius: 6px;
    max-width: 780px;
    width: 100%;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0,0,0,.4);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

.ppv-cropper-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid #eee;
    background: #f6f7f7;
}

.ppv-cropper-header h3 {
    margin: 0;
    font-size: 1em;
}

.ppv-cropper-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5em;
    color: #666;
    line-height: 1;
    padding: 0;
}

.ppv-cropper-close:hover { color: #dc3232; }

.ppv-cropper-body {
    display: flex;
    gap: 16px;
    padding: 16px 20px;
    overflow: auto;
    flex: 1;
}

.ppv-cropper-canvas-wrap {
    flex: 1;
    min-width: 0;
    position: relative;
    background: #222;
    border-radius: 4px;
    overflow: hidden;
    min-height: 300px;
}

.ppv-cropper-canvas-wrap img {
    display: block;
    max-width: 100%;
}

.ppv-cropper-sidebar {
    width: 180px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Face guide overlay */
.ppv-face-guide {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 46%;
    padding-top: 55%;   /* ~4:5 oval (fallback before JS runs) */
    border: 2px dashed rgba(255,255,255,.8);
    border-radius: 50%;
    pointer-events: none;
    z-index: 10;
    transition: left .08s linear, top .08s linear,
                width .08s linear, height .08s linear;
}

/* Preview box */
.ppv-crop-preview-label {
    font-size: 0.8em;
    color: #666;
    margin-bottom: 4px;
}

.ppv-crop-preview {
    width: 160px;
    height: 160px;
    overflow: hidden;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f6f7f7;
}

.ppv-crop-preview img {
    max-width: none;
    display: block;
}

/* Zoom controls */
.ppv-crop-zoom-wrap,
.ppv-crop-brightness-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ppv-crop-zoom-wrap label,
.ppv-crop-brightness-wrap label {
    font-size: 0.8em;
    color: #666;
}

.ppv-crop-zoom-wrap input[type="range"],
.ppv-crop-brightness-wrap input[type="range"] {
    width: 100%;
}

/* Footer buttons */
.ppv-cropper-footer {
    padding: 12px 20px;
    border-top: 1px solid #eee;
    background: #f6f7f7;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.ppv-btn {
    display: inline-block;
    padding: 8px 18px;
    border-radius: 3px;
    font-size: 0.9em;
    cursor: pointer;
    border: 1px solid transparent;
    font-weight: 500;
    line-height: 1.4;
    transition: background .15s, border-color .15s;
    text-align: center;
}

.ppv-btn-primary {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.ppv-btn-primary:hover { background: #005f8b; border-color: #005f8b; }

.ppv-btn-secondary {
    background: #f6f7f7;
    color: #333;
    border-color: #c3c4c7;
}

.ppv-btn-secondary:hover { background: #eee; }

/* --- Resize button inside feedback ------------------------------------- */
.ppv-resize-btn {
    display: inline-block;
    margin-top: 10px;
}

/* --- Brighten tip inside failure feedback ------------------------------ */
.ppv-brighten-tip {
    margin: 8px 0 0;
    font-size: 0.85em;
    color: #555;
    line-height: 1.4;
}

/* --- Spinner ------------------------------------------------------------ */
.ppv-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(0,115,170,.3);
    border-top-color: #0073aa;
    border-radius: 50%;
    animation: ppv-spin .7s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

@keyframes ppv-spin {
    to { transform: rotate(360deg); }
}

/* --- Responsive --------------------------------------------------------- */
@media (max-width: 600px) {
    .ppv-cropper-body    { flex-direction: column; }
    .ppv-cropper-sidebar { width: 100%; flex-direction: row; flex-wrap: wrap; }
    .ppv-crop-preview    { width: 120px; height: 120px; }
}
