/* =========================================
   1. STUDIO LAYOUT & STAGE
   ========================================= */
body { overflow-x: hidden; } /* Prevent scroll from large images */

.studio-container {
    display: flex;
    min-height: 100vh;
    padding-top: 80px; /* Offset for fixed nav */
}

/* --- LEFT SIDE: PREVIEW STAGE --- */
.studio-stage {
    flex: 1.5;
    background: radial-gradient(circle at center, #1a1a1a 0%, #000 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    min-height: 60vh;
}

.card-stage {
    position: relative;
    z-index: 10;
    /* This container holds the canvas + hardware */
}

/* --- THE CANVAS WRAPPER (Handles Shape) --- */
.canvas-wrapper {
    box-shadow: 0 30px 60px rgba(0,0,0,0.8);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255,255,255,0.1);
    
    /* CRITICAL: Centers the canvas & cuts the circle */
    display: flex; 
    align-items: center; 
    justify-content: center;
    overflow: hidden !important; 
    position: relative;
    z-index: 1;
}

/* Instructions below stage */
.stage-instructions {
    margin-top: 20px; color: #666; font-size: 0.8rem;
    display: flex; gap: 10px; align-items: center;
    z-index: 5;
}

/* =========================================
   2. REALISTIC HARDWARE (HOLE & RING)
   ========================================= */

/* The Black Hole Cutout */
.hw-hole {
    position: absolute;
    top: 15px; /* Adjust distance from top */
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    
    /* Matches background to look transparent */
    background-color: #1a1a1a; 
    border-radius: 50%;
    
    /* Inner shadow creates depth */
    box-shadow: inset 1px 1px 4px rgba(0,0,0,0.9);
    
    z-index: 999; /* Sits ON TOP of canvas */
    pointer-events: none; /* Click-through */
    display: none; /* JS toggles this */
}

/* The Silver Metal Ring */
.hw-ring {
    position: absolute;
    top: -12px; /* Sticks out top */
    left: 50%;
    transform: translateX(-50%);
    width: 35px;
    height: 35px;
    
    /* Silver Metal styling */
    border: 4px solid #C0C0C0; 
    border-radius: 50%;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.5);
    
    /* Clips the bottom to look attached */
    clip-path: polygon(0 0, 100% 0, 100% 60%, 0 60%);
    
    z-index: 998; /* Below hole visual */
    pointer-events: none;
    display: none; /* JS toggles this */
}

/* =========================================
   3. RIGHT SIDE: CONTROLS
   ========================================= */
.studio-controls {
    flex: 1;
    background: rgba(10, 10, 10, 0.95);
    border-left: 1px solid rgba(255,255,255,0.1);
    padding: 40px;
    overflow-y: auto;
    max-width: 500px;
}

.studio-title { font-family: 'Syncopate', sans-serif; font-size: 1.8rem; margin-bottom: 5px; color: white; }
.control-group { margin-bottom: 30px; }
.control-group label { display: block; color: #D4AF37; font-size: 0.8rem; text-transform: uppercase; margin-bottom: 10px; letter-spacing: 1px; font-weight: 700; }

/* Toggle Switch (Card/Tag) */
.toggle-switch {
    display: flex; background: #222; border-radius: 8px; padding: 4px;
}
.toggle-btn {
    flex: 1; background: transparent; color: #888; border: none; padding: 12px;
    border-radius: 6px; cursor: pointer; transition: 0.3s; font-weight: 600;
}
.toggle-btn.active { background: #D4AF37; color: black; box-shadow: 0 4px 10px rgba(0,0,0,0.3); }

/* File Upload Button */
input[type="file"] { display: none; }
.upload-trigger {
    display: flex; justify-content: space-between; align-items: center;
    background: rgba(255,255,255,0.05); border: 1px dashed #555;
    padding: 15px 20px; border-radius: 8px; cursor: pointer;
    transition: 0.3s; color: white; font-size: 0.9rem;
}
.upload-trigger:hover { border-color: #D4AF37; background: rgba(212, 175, 55, 0.05); }

/* Dividers */
.divider { display: flex; align-items: center; margin: 30px 0; color: #444; font-size: 0.7rem; letter-spacing: 1px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: #222; }
.divider span { padding: 0 10px; }

/* Inputs & Selects */
.TAPD-input, .TAPD-select { 
    width: 100%; background: #222; border: 1px solid #444; 
    padding: 12px; color: white; border-radius: 6px; outline: none; 
    box-sizing: border-box;
}
.TAPD-input:focus, .TAPD-select:focus { border-color: #D4AF37; }

/* Control Buttons */
.add-text-btn {
    width: 100%; background: #222; color: white; border: 1px dashed #444;
    padding: 12px; border-radius: 6px; cursor: pointer; transition: 0.2s;
    font-size: 0.9rem; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 10px;
}
.add-text-btn:hover { border-color: #D4AF37; color: #D4AF37; background: rgba(212, 175, 55, 0.05); }

.delete-text-btn {
    width: 100%; background: rgba(255, 85, 85, 0.1); color: #ff5555;
    border: 1px solid rgba(255, 85, 85, 0.2); padding: 10px; margin-top: 15px;
    border-radius: 6px; cursor: pointer; font-size: 0.8rem; font-weight: bold;
}
.delete-text-btn:hover { background: #ff5555; color: white; }

/* Range Sliders */
.slider-group { margin-bottom: 20px; }
.slider-group label { display: flex; justify-content: space-between; color: #ccc; font-size: 0.75rem; margin-bottom: 8px; }
.slider-row { display: flex; gap: 20px; }

input[type=range] { width: 100%; -webkit-appearance: none; background: transparent; }
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none; height: 16px; width: 16px; border-radius: 50%;
    background: #D4AF37; cursor: pointer; margin-top: -6px;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}
input[type=range]::-webkit-slider-runnable-track { width: 100%; height: 4px; cursor: pointer; background: #333; border-radius: 2px; }

/* Action Area (Bottom) */
.action-area { margin-top: 50px; padding-top: 30px; border-top: 1px solid rgba(255,255,255,0.1); }
.price-display { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.add-cart-btn {
    width: 100%; background: #D4AF37; color: black; border: none;
    padding: 18px; font-size: 1.1rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: 1px;
    border-radius: 8px; cursor: pointer; transition: 0.3s;
    font-family: 'Syncopate', sans-serif;
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}
.add-cart-btn:hover { background: white; transform: translateY(-2px); box-shadow: 0 0 30px rgba(212, 175, 55, 0.3); }

/* Mobile Response */
@media (max-width: 900px) {
    .studio-container { flex-direction: column; padding-top: 60px; }
    .studio-stage { min-height: 50vh; }
    .studio-controls { width: 100%; max-width: none; border-left: none; border-top: 1px solid rgba(255,255,255,0.1); padding: 30px 20px; }
}
