/* ==========================================================================
   AURA 3D T-SHIRT STUDIO - DESIGN SYSTEM & LUXURY STYLES
   ========================================================================== */

:root {
    --bg-dark: #09090b;
    --bg-card: rgba(18, 18, 22, 0.75);
    --bg-panel: rgba(24, 24, 28, 0.85);
    --bg-hover: rgba(255, 255, 255, 0.08);
    --border-glass: rgba(255, 255, 255, 0.12);
    --border-accent: rgba(217, 119, 6, 0.5);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --accent-gold: #f59e0b;
    --accent-amber: #d97706;
    --accent-blue: #38bdf8;
    --accent-red: #ef4444;
    
    --font-heading: 'Cinzel', serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
    
    --sidebar-width: 420px;
    --header-height: 70px;
    --radius-lg: 16px;
    --radius-md: 10px;
    --radius-sm: 6px;
    
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --shadow-glow: 0 0 20px rgba(245, 158, 11, 0.2);
    --blur-glass: backdrop-filter: blur(16px) saturate(180%);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow: hidden;
    user-select: none;
    -webkit-font-smoothing: antialiased;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-gold);
}

/* ==========================================================================
   APP CONTAINER & HEADER
   ========================================================================== */

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
}

.app-header {
    height: var(--header-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 100;
    backdrop-filter: blur(12px);
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-logo {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent-amber), #b45309);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
    box-shadow: var(--shadow-glow);
}

.brand-text h1 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 2px;
}

.brand-text h1 span {
    color: var(--accent-gold);
    font-weight: 400;
}

.brand-text p {
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 1.5px;
}

/* Camera Angle Quick Bar */
.camera-bar {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.4);
    padding: 4px;
    border-radius: 12px;
    border: 1px solid var(--border-glass);
    gap: 4px;
}

.cam-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 8px 14px;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cam-btn:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.cam-btn.active {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(217, 119, 6, 0.3));
    color: var(--accent-gold);
    border: 1px solid var(--border-accent);
}

/* Header Buttons */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.icon-action-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    padding: 9px 14px;
    border-radius: 8px;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s;
}

.icon-action-btn:hover, .icon-action-btn.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
}

.sec-action-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    padding: 9px 16px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.sec-action-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.primary-action-btn {
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-amber));
    border: none;
    color: #000;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-glow);
}

.primary-action-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.1);
}

/* ==========================================================================
   VIEWPORT & SIDEBAR LAYOUT
   ========================================================================== */

.studio-viewport {
    display: flex;
    flex: 1;
    position: relative;
    overflow: hidden;
}

#canvas-container {
    flex: 1;
    position: relative;
    background: radial-gradient(circle at center, #18181b 0%, #09090b 100%);
    overflow: hidden;
}

#canvas-container canvas {
    width: 100% !important;
    height: 100% !important;
    outline: none;
}

/* Studio Loader */
.studio-loader {
    position: absolute;
    inset: 0;
    background: var(--bg-dark);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 50;
    gap: 16px;
    transition: opacity 0.4s ease;
}

.studio-loader.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent-gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.studio-loader p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

/* Viewport Hints overlay */
.viewport-hints {
    position: absolute;
    bottom: 20px;
    left: 20px;
    display: flex;
    gap: 16px;
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid var(--border-glass);
    pointer-events: none;
    backdrop-filter: blur(8px);
}

.viewport-hints span {
    font-size: 0.72rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Sidebar Panel */
.control-sidebar {
    width: var(--sidebar-width);
    background: var(--bg-panel);
    border-left: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(20px);
    z-index: 10;
}

.sidebar-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid var(--border-glass);
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 16px 10px;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
}

.tab-btn i {
    font-size: 1.1rem;
}

.tab-btn:hover {
    color: var(--text-secondary);
    background: var(--bg-hover);
}

.tab-btn.active {
    color: var(--accent-gold);
    border-bottom-color: var(--accent-gold);
    background: rgba(245, 158, 11, 0.05);
}

.tab-content-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.tab-pane {
    display: none;
    flex-direction: column;
    gap: 24px;
}

.tab-pane.active {
    display: flex;
}

/* Panel Sections */
.panel-section {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.panel-section h3 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.5px;
}

.panel-section h3 i {
    color: var(--accent-gold);
}

/* Color Pickers & Swatches */
.color-picker-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

input[type="color"] {
    -webkit-appearance: none;
    border: 1px solid var(--border-glass);
    width: 44px;
    height: 44px;
    border-radius: 10px;
    cursor: pointer;
    background: none;
    padding: 0;
    overflow: hidden;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 8px;
}

.hex-display {
    font-family: monospace;
    font-size: 0.9rem;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.4);
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-glass);
}

.mini-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    padding: 8px 12px;
    font-size: 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    margin-left: auto;
    transition: all 0.2s;
}

.mini-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
}

.swatches-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.color-swatches {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.swatch {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.15);
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s;
}

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

.swatch.active {
    border-color: var(--accent-gold);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

/* Fabric Presets Grid */
.fabric-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.fabric-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.fabric-card i {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.fabric-card h4 {
    font-size: 0.8rem;
    font-weight: 600;
}

.fabric-card p {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.fabric-card:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background: var(--bg-hover);
}

.fabric-card.active {
    border-color: var(--accent-gold);
    background: rgba(245, 158, 11, 0.08);
}

.fabric-card.active i, .fabric-card.active h4 {
    color: var(--accent-gold);
}

/* Form Controls & Range Sliders */
.control-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.control-group label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
}

.control-group label span {
    color: var(--accent-gold);
    font-weight: 600;
}

input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 5px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.15);
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-gold);
    cursor: pointer;
    transition: transform 0.15s;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* Custom Select Dropdown */
.custom-select {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    padding: 10px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.8rem;
    outline: none;
}

.custom-select option {
    background: var(--bg-dark);
    color: var(--text-primary);
}

/* Toggle Switch */
.switch-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.switch-toggle input {
    display: none;
}

.slider {
    width: 36px;
    height: 20px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    position: relative;
    transition: 0.3s;
}

.slider:before {
    content: "";
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    left: 3px;
    top: 3px;
    background-color: white;
    transition: 0.3s;
}

input:checked + .slider {
    background-color: var(--accent-amber);
}

input:checked + .slider:before {
    transform: translateX(16px);
}

.toggle-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* ==========================================================================
   PRINT PLANES & DECAL ZONE EDITOR
   ========================================================================== */

.zone-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.zone-btn {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    padding: 10px;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.zone-btn:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.zone-btn.active {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(217, 119, 6, 0.2));
    border-color: var(--accent-gold);
    color: var(--accent-gold);
}

.zone-editor-box {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.zone-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 10px;
}

.zone-header h3 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-gold);
}

/* Upload Dropzone */
.upload-dropzone {
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    padding: 20px 10px;
    text-align: center;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    background: rgba(0, 0, 0, 0.2);
}

.upload-dropzone:hover {
    border-color: var(--accent-gold);
    background: rgba(245, 158, 11, 0.05);
}

.upload-dropzone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.upload-dropzone i {
    font-size: 1.8rem;
    color: var(--accent-gold);
    margin-bottom: 8px;
}

.upload-dropzone p {
    font-size: 0.8rem;
    margin-bottom: 4px;
}

.upload-dropzone span {
    font-size: 0.68rem;
    color: var(--text-muted);
}

/* Preset Graphics Library */
.preset-graphics-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 10px;
    margin-bottom: 8px;
}

.preset-graphics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.preset-gfx-card {
    aspect-ratio: 1;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    padding: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.preset-gfx-card img, .preset-gfx-card svg {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.preset-gfx-card:hover {
    transform: scale(1.08);
    border-color: var(--accent-gold);
}

.preset-gfx-card.active {
    border-color: var(--accent-gold);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

/* Zone Actions */
.zone-action-row {
    display: flex;
    gap: 10px;
    margin-top: 6px;
}

.mini-action-btn {
    flex: 1;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    padding: 8px;
    font-size: 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.mini-action-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
}

.mini-action-btn.danger:hover {
    background: rgba(239, 68, 68, 0.2);
    color: var(--accent-red);
    border-color: var(--accent-red);
}

/* Lighting Presets Grid */
.preset-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.preset-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.preset-card i {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.preset-card h4 {
    font-size: 0.78rem;
    font-weight: 600;
}

.preset-card p {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.preset-card:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background: var(--bg-hover);
}

.preset-card.active {
    border-color: var(--accent-gold);
    background: rgba(245, 158, 11, 0.08);
}

.preset-card.active i, .preset-card.active p {
    color: var(--accent-gold);
}

/* Studio Gallery Grid & Cards */
.studio-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
}

.studio-gallery-card {
    background: rgba(24, 24, 27, 0.6);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.studio-gallery-card:hover {
    border-color: var(--accent-gold);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
    background: rgba(245, 158, 11, 0.08);
}

.studio-gallery-card.active {
    border-color: var(--accent-gold);
    background: rgba(245, 158, 11, 0.15);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.25);
}

.studio-gallery-card img {
    width: 100%;
    height: 90px;
    object-fit: contain;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    padding: 6px;
    box-sizing: border-box;
}

.studio-gallery-card h4 {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
}

.studio-gallery-card span {
    font-size: 0.68rem;
    color: var(--accent-gold);
    font-weight: 500;
}

/* ==========================================================================
   EXPORT MODAL
   ========================================================================== */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 600px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: var(--shadow-glass);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--accent-gold);
    display: flex;
    align-items: center;
    gap: 10px;
}

.close-modal-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.close-modal-btn:hover {
    color: #fff;
}

.modal-body textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    padding: 12px;
    color: #38bdf8;
    font-family: monospace;
    font-size: 0.8rem;
    outline: none;
    resize: none;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}
