/* --- CORE STYLES --- */
body { background-color: #050505; color: #e4e4e7; font-family: 'Inter', sans-serif; overflow: hidden; height: 100vh; margin: 0; }

/* Custom UI Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #09090b; }
::-webkit-scrollbar-thumb { background: #3f3f46; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #dc2626; }

/* Layout */
.app-container { display: flex; height: 100vh; width: 100vw; }

/* Sidebar Styling */
.sidebar { 
    width: 450px; 
    background: #09090b; 
    border-right: 1px solid #27272a; 
    display: flex; 
    flex-direction: column; 
    z-index: 20; 
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

@media (max-width: 768px) {
    .sidebar { position: absolute; height: 100%; transform: translateX(-100%); width: 90%; }
    .sidebar.mobile-open { transform: translateX(0); }
}

.sidebar-header { padding: 20px; border-bottom: 1px solid #27272a; background: rgba(9,9,11,0.95); backdrop-filter: blur(5px); }
.sidebar-scroll { flex: 1; overflow-y: auto; padding: 20px; }

/* TABS Styling */
.tabs-nav { 
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; 
    background: #18181b; padding: 4px; border-radius: 8px; margin-bottom: 24px; border: 1px solid #27272a; 
}
.tab-btn { 
    padding: 8px 4px; text-align: center; font-size: 0.65rem; cursor: pointer; 
    border-radius: 6px; color: #a1a1aa; transition: all 0.2s; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.tab-btn i { font-size: 14px; margin-bottom: 4px; }
.tab-btn:hover { color: #fff; background: rgba(255,255,255,0.05); }
.tab-btn.active { background: #dc2626; color: #fff; box-shadow: 0 2px 10px rgba(220, 38, 38, 0.3); }

.tab-pane { display: none; animation: slideIn 0.3s ease-out; }
.tab-pane.active { display: block; }

/* Form Controls */
.control-group { margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px dashed #27272a; }
.control-group:last-child { border-bottom: none; }

.lbl { 
    font-size: 0.75rem; font-weight: 700; color: #dc2626; text-transform: uppercase; 
    margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; letter-spacing: 0.5px; 
}

input[type="text"], input[type="number"], select, textarea { 
    width: 100%; background: #000; border: 1px solid #3f3f46; color: white; 
    padding: 10px; border-radius: 6px; font-size: 0.85rem; margin-bottom: 8px; transition: all 0.2s; 
}
input:focus, select:focus, textarea:focus { border-color: #dc2626; outline: none; box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.2); }

/* Checkbox Groups */
.chk-group { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; padding: 8px; background: #121212; border-radius: 4px; border: 1px solid #27272a; }
.chk-group span { font-size: 0.75rem; color: #ccc; }
.chk-group input { width: auto; margin: 0; accent-color: #dc2626; transform: scale(1.2); cursor: pointer; }

/* Range Slider Styling */
input[type=range] { -webkit-appearance: none; width: 100%; background: transparent; cursor: pointer; margin: 10px 0; }
input[type=range]::-webkit-slider-runnable-track { width: 100%; height: 6px; background: #27272a; border-radius: 3px; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; height: 16px; width: 16px; border-radius: 50%; background: #dc2626; margin-top: -5px; transition: transform 0.1s; }
input[type=range]::-webkit-slider-thumb:hover { transform: scale(1.2); }

/* Order Input Styling */
.order-input-group { display: flex; gap: 5px; align-items: center; margin-bottom: 5px; }
.order-input-group span { width: 80px; font-size: 0.75rem; color: #aaa; }
.order-input-group input { width: 50px !important; text-align: center; margin-bottom: 0 !important; }

/* Color Picker Improved */
.color-wrapper { 
    display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; 
    background: #18181b; padding: 8px 12px; border-radius: 6px; border: 1px solid #27272a; transition: border 0.2s;
}
.color-wrapper:hover { border-color: #52525b; }
input[type="color"] { -webkit-appearance: none; border: none; width: 28px; height: 28px; padding: 0; background: none; cursor: pointer; border-radius: 4px; overflow: hidden; }

/* Modal */
#modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 50; backdrop-filter: blur(8px); animation: fadeIn 0.2s; }
#modal-box { 
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); 
    width: 95%; max-width: 700px; max-height: 90vh; overflow-y: auto;
    background: #09090b; border: 1px solid #333; border-radius: 12px; 
    box-shadow: 0 25px 60px rgba(0,0,0,0.9); display: flex; flex-direction: column;
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Preview Area */
.preview-area { flex: 1; background: #000; display: flex; flex-direction: column; position: relative; }
.preview-content { 
    flex: 1; padding: 40px; overflow: hidden; display: flex; align-items: center; justify-content: center; 
    background-image: radial-gradient(#27272a 1px, transparent 1px); background-size: 24px 24px; 
}
#preview-wrapper { transition: width 0.4s cubic-bezier(0.25, 0.8, 0.25, 1); width: 100%; margin: 0 auto; min-height: 200px; max-height: 100%; overflow: hidden; display: flex; align-items: center; }

/* Helper Utility for Visibility */
.hidden-opt { display: none !important; }

/* Animations */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp { from { opacity: 0; transform: translate(-50%, -45%); } to { opacity: 1; transform: translate(-50%, -50%); } }