/* ============================================================
   NAIL STUDIO — Virtual Nail Polish Try-On
   ============================================================ */

.nail-body {
    background: #080808;
    color: #fff;
    margin: 0;
    font-family: 'Outfit', sans-serif;
}

/* ── HERO ────────────────────────────────────────────────── */
.nail-hero {
    height: 40vh;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid rgba(255,51,102,0.2);
}

.nail-hero-bg {
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse at 50% 50%, rgba(255,51,102,0.15) 0%, transparent 60%),
        linear-gradient(180deg, #110005 0%, #080808 100%);
}

/* ── SIMULATOR LAYOUT ────────────────────────────────────── */
.simulator-container {
    display: flex;
    flex-wrap: wrap;
    max-width: 1400px;
    margin: 40px auto;
    padding: 0 20px;
    gap: 30px;
}

.simulator-left {
    flex: 1 1 600px;
    position: relative;
    background: #111;
    border-radius: 20px;
    border: 1px solid #222;
    overflow: hidden;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.simulator-right {
    flex: 1 1 350px;
    max-width: 450px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ── UPLOAD OVERLAY ──────────────────────────────────────── */
.upload-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    backdrop-filter: blur(5px);
}

.upload-content {
    text-align: center;
    padding: 40px;
    border: 2px dashed rgba(255,51,102,0.4);
    border-radius: 20px;
    background: rgba(0,0,0,0.5);
    max-width: 80%;
}

/* ── CANVAS AREA ─────────────────────────────────────────── */
.canvas-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    max-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    /* Zoom logic applied via JS */
}

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

/* ── THE CSS NAIL (PURE CSS REALISM) ─────────────────────── */
.css-nail {
    position: absolute;
    width: 30px;
    height: 50px;
    /* Almond/Oval default shape */
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    
    /* The base colour comes from inline style background-color */
    background-color: #ff1a1a;
    
    /* Use opacity instead of multiply so it shows up clearly on any photo */
    opacity: 0.85;
    
    /* 3D inset shadow gives depth and edge darkness */
    box-shadow: inset 0 -5px 10px rgba(0,0,0,0.6), inset 0 2px 5px rgba(255,255,255,0.3);
    
    cursor: move;
    user-select: none;
    touch-action: none;
    transform-origin: center center;
    z-index: 20;
    transition: box-shadow 0.2s ease, background-color 0.2s ease;
}

/* 
   The Glossy Highlight Pseudo-element 
   This sits *on top* of the nail to create a wet, shiny reflection
*/
.css-nail::after {
    content: '';
    position: absolute;
    top: 5%;
    left: 15%;
    width: 30%;
    height: 70%;
    border-radius: 50%;
    background: linear-gradient(to right, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0) 100%);
    mix-blend-mode: overlay;
    pointer-events: none;
    filter: blur(1px);
    opacity: 0.7;
}

/* Active selection state */
.css-nail.selected {
    outline: 2px dashed #fff;
    outline-offset: 4px;
    box-shadow: 
        inset 0 -5px 10px rgba(0,0,0,0.6), 
        inset 0 2px 5px rgba(255,255,255,0.3),
        0 0 15px rgba(255,255,255,0.5);
    z-index: 25;
}

/* ── CONTROLS ────────────────────────────────────────────── */
.control-panel {
    background: #111;
    border: 1px solid #222;
    border-radius: 20px;
    padding: 25px;
}

.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    font-size: 0.8rem;
    color: #fff;
}

.secondary-btn {
    background: transparent;
    color: #fff;
    border: 1px solid #444;
    padding: 12px;
    border-radius: 12px;
    width: 100%;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.secondary-btn:hover:not([disabled]) {
    border-color: #ff3366;
    color: #ff3366;
    background: rgba(255,51,102,0.05);
}

.secondary-btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── COLOUR PALETTE ──────────────────────────────────────── */
.palette-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.swatch {
    aspect-ratio: 1;
    border-radius: 50%;
    background-color: var(--swatch-color);
    cursor: pointer;
    border: 2px solid #333;
    transition: transform 0.2s, border-color 0.2s;
    /* Glossy swatch look */
    box-shadow: inset -2px -2px 6px rgba(0,0,0,0.4), inset 2px 2px 4px rgba(255,255,255,0.3);
}

.swatch:hover {
    transform: scale(1.1);
}

.swatch.active {
    border-color: #fff;
    transform: scale(1.15);
    box-shadow: 
        inset -2px -2px 6px rgba(0,0,0,0.4), 
        inset 2px 2px 4px rgba(255,255,255,0.3),
        0 0 10px var(--swatch-color);
}
