/* --- REVIEW OVERRIDES --- */
/* body overflow: hidden scoped to .review-workspace only (was leaking into editor page) */

.review-workspace { display: flex; height: 100vh; width: 100vw; position: relative; overflow: hidden; background: #F5F5F7; }

/* CANVAS */
.preview-canvas { flex: 1; display: flex; flex-direction: column; align-items: center; overflow-y: auto; padding: 20px; background: #FFFFFF; }

/* BANNER */
.howto-banner {
    background: #E3F2FD; border: 1px solid #BBDEFB; color: #0D47A1;
    padding: 15px 30px; border-radius: 8px; margin-bottom: 30px;
    font-size: 0.95rem; max-width: 600px; text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05); line-height: 1.5;
}

/* CV PAPER */
#preview-wrapper {
    transition: transform 0.3s ease;
    padding-bottom: 20px;
    display: flex; 
    justify-content: center; 
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

#cv-preview {
    background: white; 
    width: 210mm; 
    max-width: 100%;
    min-height: 297mm;
    border: 3px solid var(--primary);
    border-radius: 12px;
    box-shadow: 0 15px 50px rgba(0, 122, 255, 0.2);
    overflow: visible;
    position: relative; 
    transform-origin: top center; 
    margin-top: 10px;
    box-sizing: border-box;
}

/* SETTINGS PANEL */
.settings-panel {
    width: 350px; background: #F2F2F7; border-left: 1px solid rgba(0,0,0,0.1);
    display: flex; flex-direction: column; z-index: 200;
    transition: margin-right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.settings-panel.closed { margin-right: -350px; }
.panel-header { padding: 20px; background: #fff; border-bottom: 1px solid #e5e5e5; font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
.panel-content { padding: 20px; overflow-y: auto; flex: 1; }

.settings-toggle {
    position: absolute; top: 20px; right: 20px; z-index: 300;
    background: white; width: 40px; height: 40px; border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1); display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 1.5rem; display: none;
}
.settings-panel.closed + .settings-toggle { display: flex; }

/* --- NICER DROPDOWNS (Cross-Browser Fix) --- */
.input-group {
    margin-bottom: 20px;
}

.styled-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 100%;
    padding: 12px 16px;
    padding-right: 40px; /* Space for arrow */
    border-radius: 12px;
    border: 1px solid #E5E5EA;
    background-color: #FFF;
    font-size: 0.95rem;
    color: #333;
    cursor: pointer;
    line-height: 1.3;
    /* Custom Arrow SVG */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
    transition: border-color 0.2s, box-shadow 0.2s;
}

/* Remove default arrow in IE */
.styled-select::-ms-expand { display: none; }

.styled-select:hover { border-color: #ccc; }
.styled-select:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0,122,255,0.1);
}

/* --- MOBILE FIXES --- */
@media (max-width: 900px) {
    body { overflow: auto; }
    .review-workspace { flex-direction: column; height: auto; overflow: visible; }
    .preview-canvas { padding: 0; background: white; overflow: visible; height: auto; display: block; }
    #preview-wrapper { display: block; padding-bottom: 20px; height: auto !important; }
    #cv-preview {
        width: 100% !important; min-height: auto !important; transform: none !important;
        border: none; border-radius: 0; box-shadow: none; padding: 15px !important; margin: 0;
    }
    .tpl-tech, .tpl-modern, .tpl-professional { display: flex; flex-direction: column; grid-template-columns: 1fr !important; padding: 10px !important; }
    .howto-banner { width: 90%; margin: 10px auto; }
    .settings-panel {
        width: 100%; height: auto; margin-right: 0 !important;
        border-left: none; border-top: 1px solid #ccc;
        position: relative; display: block;
    }
    .settings-panel.closed { display: none; }
    .settings-toggle {
        display: flex; position: fixed; bottom: 20px; right: 20px; top: auto;
        background: var(--primary); color: white;
    }
}
