﻿:root {
	--primary: #6366f1;
	--bg-sidebar: #ffffff;
	--bg-app: #f8fafc;
	--text-main: #1e293b;
	--text-muted: #64748b;
	--border-color: #e2e8f0;
	--accent-red: #ff4757;
}

.app-container { display: grid; grid-template-columns: 350px 1fr; width: 100%; align-items: start;}

.controls-sidebar {  
	padding-right: 20px; 
	overflow-y: auto;
	z-index: 8;
}

.control-card { background: #fff; border: 1px solid var(--border-color); border-radius: 12px; padding: 14px; margin-bottom: 12px; }
.card-title { display: flex; flex-direction: column; margin-bottom: 12px; }
.card-title label { font-weight: 700; font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; }

.btn-group { display: inline-flex; background: #f1f5f9; padding: 3px; border-radius: 8px; gap: 2px; }
.btn-group button { border: none; background: transparent; padding: 6px 12px; border-radius: 6px; font-size: 12px; cursor: pointer; font-weight: 600; color: var(--text-muted); transition: 0.2s; }
.btn-group button.active { background: #fff; color: var(--primary); box-shadow: 0 2px 4px rgba(0,0,0,0.05); }

.btn-group-s { display: flex; width:100%; background: #f1f5f9; padding: 3px; border-radius: 8px; gap: 2px; }
.btn-group-s button { flex: 1; border: none; background: transparent; padding: 6px 12px; border-radius: 6px; font-size: 12px; cursor: pointer; font-weight: 600; color: var(--text-muted); transition: 0.2s; }
.btn-group-s button.active { background: #fff; color: var(--primary); box-shadow: 0 2px 4px rgba(0,0,0,0.05); }


.slider-row { display: grid; grid-template-columns: 1fr 40px; grid-template-rows: auto auto; align-items: center; margin-bottom: 8px; font-size: 12px; touch-action: none; }
input[type="range"] { accent-color: var(--primary); cursor: pointer; width: 100%; height: 24px; grid-column: 1 / -1;}
.badge { background: #eef2ff; color: var(--primary); font-size: 10px; font-weight: 700; padding: 4px; border-radius: 6px; text-align: center; border: 1px solid #e0e7ff; }

.styled-select { width: 100%; padding: 8px; border-radius: 8px; border: 1px solid var(--border-color); font-size: 14px; background: #fff; cursor: pointer; margin-bottom: 5px; }
.styled-select:focus {
  outline: none;
  box-shadow: none;
}

.preview-area { 
	position: relative;
    height: 100%;
    display: flex;
    justify-content: center; 
	background-image: radial-gradient(circle, #cbd5e1 1px, transparent 1px); 
	background-size: 20px 20px;
}

#previewBox { position: sticky;
  top: 8rem; margin:4rem 0; width: 300px; height: 300px; background: #fff;  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.1); }

.corner-indicator { position: absolute; opacity: 0; pointer-events: none; z-index: 1; transition: opacity 0.15s; }
.corner-indicator::before, .corner-indicator::after { content: ''; position: absolute; background: var(--accent-red); }
.corner-indicator.active-viz { opacity: 1 !important; }

.ind-tl::before { top: -5px; left: -5px; width: 100%; height: 2px; } .ind-tl::after { top: -5px; left: -5px; width: 2px; height: 100%; }
.ind-tr::before { top: -5px; right: -5px; width: 100%; height: 2px; } .ind-tr::after { top: -5px; right: -5px; width: 2px; height: 100%; }
.ind-br::before { bottom: -5px; right: -5px; width: 100%; height: 2px; } .ind-br::after { bottom: -5px; right: -5px; width: 2px; height: 100%; }
.ind-bl::before { bottom: -5px; left: -5px; width: 100%; height: 2px; } .ind-bl::after { bottom: -5px; left: -5px; width: 2px; height: 100%; }

.corner-label { position: absolute; background: var(--accent-red); color: white; font-size: 12px; padding: 1px 6px; border-radius: 4px; font-family: monospace; white-space: nowrap; }
.ind-tl .corner-label { top: -30px; left: -5px; } .ind-tr .corner-label { top: -30px; right: -5px; }
.ind-br .corner-label { bottom: -30px; right: -5px; } .ind-bl .corner-label { bottom: -30px; left: -5px; }

.axis-divider { font-size: 11px; color: var(--primary); text-transform: uppercase; font-weight: 800; text-align: center; margin: 15px 0; border-bottom: 1px solid #f1f5f9; line-height: 0.1em; }
.axis-divider span { background: #fff; padding: 0 10px; }
		
.color-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 10px; }
.color-item { display: flex; flex-direction: column; gap: 4px; font-size: 10px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; }
.color-item input { width: 100%; height: 30px; border: 1px solid var(--border-color); padding: 2px; cursor: pointer; background: #fff; }
		
.hidden { display: none !important; }
.mt-10 { margin-top: 10px; }

.menu-btn { display: none; }

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
  z-index: 998;
}

.sidebar-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.sidebar-close {
  position: absolute;
  top: 0px;
  right: 0px;
  padding: 4px 5px;
  border-radius: 4px;
  border: none;
  background: #d90036;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  display: none;

}

.sidebar-close:hover {
  background: #000;
}

.sidebar-close:hover {
  opacity: 1;
}

@media (max-width: 850px) {
	.sidebar-close {
		display: block;
	}
    .menu-btn {
        display: block;  z-index: 8;
        background: #4d4cff; color: white; border: none; padding: 1px 15px;
        border-radius: 6px; cursor: pointer;
		font-size:0.85em;
    }

    .app-container { grid-template-columns: 1fr; }

    .controls-sidebar {
        position: fixed; top: 0; left: -320px;
        width: 320px; height: 100vh; z-index: 999; background:white;padding:10px;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 10px 0 20px rgba(0,0,0,0.1);
    }

    .controls-sidebar.open {
        transform: translateX(320px);
    }

}