/**
 * GN3D STUDIO - Custom Styles
 * Dark Mode Industrial/Technical Theme
 */

/* ===== ROOT VARIABLES ===== */
:root {
    /* Colors */
    --neon-primary: #00D2A3;
    --neon-bright: #00E6B8;
    --neon-glow: rgba(0, 210, 163, 0.3);
    --bg-dark: #121212;
    --bg-dark-subtle: #18191A;
    --bg-card: #242526;
    --text-light: #E4E6EB;
    --text-muted: #B0B3B8;
    --text-heading: #FFFFFF;
    --border-color: #3A3B3C;
    
    /* Spacing System (8px base) */
    --space-1: 0.25rem;  /* 4px */
    --space-2: 0.5rem;   /* 8px */
    --space-3: 0.75rem;  /* 12px */
    --space-4: 1rem;     /* 16px */
    --space-5: 1.25rem;  /* 20px */
    --space-6: 1.5rem;   /* 24px */
    --space-8: 2rem;     /* 32px */
    --space-10: 2.5rem;  /* 40px */
    --space-12: 3rem;    /* 48px */
    --space-16: 4rem;    /* 64px */
    --space-20: 5rem;    /* 80px */
    
    /* Border Radius */
    --radius-sm: 0.5rem;   /* 8px */
    --radius-md: 0.75rem;  /* 12px */
    --radius-lg: 1rem;     /* 16px */
    --radius-xl: 1.25rem;  /* 20px */
    
    /* Form Control Border Radius - Unified for all form elements */
    --form-radius: 0.5rem; /* 8px - Consistent across all form controls */
    
    /* Container Max Width */
    --container-sm: 640px;
    --container-md: 768px;
    --container-lg: 1024px;
    --container-xl: 1280px;
    --container-max: 1600px; /* Maximum width for ultra-wide screens */
}

/* ===== GLOBAL STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-light);
    line-height: 1.6;
    overflow-x: hidden;
}

html {
    scroll-behavior: smooth;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    letter-spacing: -0.5px;
    color: var(--text-heading);
}

.text-neon {
    color: var(--neon-primary) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

p, .lead {
    color: var(--text-light);
}
LAYOUT MAX-WIDTH CONSTRAINTS ===== */
/* Prevent layout from stretching on ultra-wide screens */
.container,
.container-fluid {
    max-width: var(--container-max) !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Main content wrapper */
.main-content {
    max-width: var(--container-max);
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

/* Hero and full-width sections */
.hero-section,
.footer {
    max-width: 100%;
}

.hero-section > .container,
.footer > .container {
    max-width: var(--container-max) !important;
}

/* ===== 
/* ===== NAVBAR ===== */
.navbar {
    background-color: rgba(18, 18, 18, 0.95) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: var(--space-4) 0;
}

.navbar-brand {
    font-size: 1.5rem;
    color: var(--text-heading) !important;
    font-weight: 700;
    transition: all 0.3s ease;
}

.navbar-brand:hover {
    transform: scale(1.05);
}

.navbar-brand svg {
    transition: all 0.3s ease;
    filter: drop-shadow(0 0 8px rgba(0, 210, 163, 0.3));
}

.navbar-brand:hover svg {
    filter: drop-shadow(0 0 12px rgba(0, 210, 163, 0.6));
    transform: translateY(-2px);
}

.gradient-text {
    background: linear-gradient(135deg, #00E676 0%, #00D2A3 50%, #00BCD4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}


.navbar-brand i {
    color: var(--neon-primary);
}

.navbar-brand:hover {
    color: var(--neon-primary) !important;
}

.nav-link {
    color: var(--text-light) !important;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: var(--space-2) var(--space-3);
    margin: 0 var(--space-1);
}

.nav-link:hover,
.nav-link.active {
    color: var(--neon-primary) !important;
}

.nav-link.quote-link {
    color: var(--neon-primary) !important;
    font-weight: 600;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    min-height: 100vh;
    padding-top: 70px;
}

/* ===== BUTTONS ===== */
.btn-neon {
    background-color: var(--neon-primary);
    color: #000000;
    border: none;
    font-weight: 600;
    padding: var(--space-3) var(--space-8);
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 210, 163, 0.2);
    border-radius: var(--form-radius);
}

.btn-neon:hover {
    background-color: var(--neon-bright);
    color: #000000;
    box-shadow: 0 6px 20px rgba(0, 210, 163, 0.4);
    transform: translateY(-2px);
}

.btn-outline-neon {
    border: 2px solid var(--neon-primary);
    color: var(--neon-primary);
    background: transparent;
    font-weight: 600;
    padding: var(--space-3) var(--space-8);
    transition: all 0.3s ease;
    border-radius: var(--form-radius);
}

.btn-outline-neon:hover {
    background-color: var(--neon-primary);
    color: #000000;
    box-shadow: 0 4px 12px rgba(0, 210, 163, 0.3);
    transform: translateY(-2px);
}

.badge.bg-neon {
    background-color: var(--neon-primary) !important;
    color: #000000;
    font-weight: 600;
}

/* ===== FORMS ===== */
.form-control,
.form-select {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-light);
    transition: all 0.3s ease;
    border-radius: var(--form-radius);
}

.form-control:not(.form-control-sm),
.form-select:not(.form-select-sm) {
    padding: var(--space-3) var(--space-4);
}

.form-control-sm, 
.form-select-sm, 
.btn-sm, 
.input-group-sm > .form-control,
.input-group-sm > .input-group-text,
.input-group-sm > .btn {
    height: 38px; /* Đặt chiều cao thống nhất cho các control nhỏ */
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
    font-size: 0.875rem;
    line-height: 1.5;
}

.form-range {
    height: 38px; /* Cân bằng với các input khác */
    display: flex;
    align-items: center;
}

.form-control:focus,
.form-select:focus {
    background-color: var(--bg-card);
    border-color: var(--neon-primary);
    color: var(--text-light);
    box-shadow: 0 0 0 0.2rem rgba(0, 210, 163, 0.2);
}

.form-label {
    color: var(--text-light);
    font-weight: 500;
    margin-bottom: var(--space-2);
}

/* ===== UNIFIED BORDER RADIUS FOR ALL FORM CONTROLS ===== */
/* Ensuring consistent border-radius across all interactive elements */

.btn,
.btn-sm,
.btn-lg,
.form-control,
.form-control-sm,
.form-select,
.form-select-sm,
.input-group .btn,
.input-group .form-control,
.input-group .input-group-text,
.badge {
    border-radius: var(--form-radius) !important;
}

/* Button Groups - All buttons get consistent border-radius */
.btn-group > .btn,
.btn-group-sm > .btn {
    border-radius: var(--form-radius) !important;
}

/* Input Groups - All elements get consistent border-radius */
.input-group > *,
.input-group-sm > * {
    border-radius: var(--form-radius) !important;
}

/* Cards in form section */
.quote-page .card,
.config-section .card {
    border-radius: var(--form-radius) !important;
}

/* ===== HERO SECTION ===== */
.hero-section {
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-dark-subtle) 100%);
    position: relative;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><path d="M0 0h60v60H0z"/><path d="M30 30L0 0v60l30-30zm0 0l30 30V0L30 30z" stroke="%233A3B3C" stroke-width="0.5" opacity="0.15"/></g></svg>');
    opacity: 0.3;
}

.hero-section .container {
    position: relative;
    z-index: 1;
}

.hero-image-placeholder {
    text-align: center;
    padding: var(--space-16);
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 2px solid var(--border-color);
}

/* ===== HERO CAROUSEL - BOOTSTRAP STANDARD ===== */

/* Hero Carousel Wrapper */
.hero-carousel-wrapper {
    position: relative;
}

/* Carousel Styling */
#heroCarousel,
#printerCarousel {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
}

#heroCarousel .carousel-inner,
#printerCarousel .carousel-inner {
    border-radius: var(--radius-lg);
}

/* Carousel Images */
.hero-printer-image {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-lg);
    object-fit: cover;
    background: linear-gradient(135deg, #1a1a1a 0%, #242526 100%);
}

/* Carousel Indicators */
#heroCarousel .carousel-indicators,
#printerCarousel .carousel-indicators {
    bottom: -35px;
    margin-bottom: 0;
}

#heroCarousel .carousel-indicators button,
#printerCarousel .carousel-indicators button {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.4);
    border: none;
    transition: all 0.3s ease;
}

#heroCarousel .carousel-indicators button.active,
#printerCarousel .carousel-indicators button.active {
    background-color: var(--neon-primary);
    width: 12px;
    height: 12px;
}

#heroCarousel .carousel-indicators button:hover,
#printerCarousel .carousel-indicators button:hover {
    background-color: rgba(0, 210, 163, 0.7);
}

/* Carousel Controls */
#heroCarousel .carousel-control-prev,
#heroCarousel .carousel-control-next,
#printerCarousel .carousel-control-prev,
#printerCarousel .carousel-control-next {
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    opacity: 0;
    transition: all 0.3s ease;
}

#heroCarousel:hover .carousel-control-prev,
#heroCarousel:hover .carousel-control-next,
#printerCarousel:hover .carousel-control-prev,
#printerCarousel:hover .carousel-control-next {
    opacity: 1;
}

#heroCarousel .carousel-control-prev:hover,
#heroCarousel .carousel-control-next:hover,
#printerCarousel .carousel-control-prev:hover,
#printerCarousel .carousel-control-next:hover {
    background: rgba(0, 210, 163, 0.8);
}

#heroCarousel .carousel-control-prev-icon,
#heroCarousel .carousel-control-next-icon,
#printerCarousel .carousel-control-prev-icon,
#printerCarousel .carousel-control-next-icon {
    width: 24px;
    height: 24px;
}

/* Carousel Caption */
#heroCarousel .carousel-caption,
#printerCarousel .carousel-caption {
    bottom: 15px;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 15px;
    border-radius: var(--radius-sm);
    left: 10%;
    right: 10%;
}

#heroCarousel .carousel-caption h5,
#printerCarousel .carousel-caption h5 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--neon-primary);
    margin: 0;
}

/* Bootstrap Carousel Fade - Standard */
.carousel-fade .carousel-item {
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
}

.carousel-fade .carousel-item.active {
    opacity: 1;
}

/* Legacy styles kept for compatibility */
.hero-image-container {
    text-align: center;
    padding: var(--space-8);
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

.hero-image-container:hover {
    border-color: var(--neon-primary);
    box-shadow: 0 0 20px rgba(0, 210, 163, 0.3);
    transform: translateY(-5px);
}

.bg-dark-subtle {
    background-color: var(--bg-dark-subtle) !important;
}

.bg-gradient-neon {
    background: linear-gradient(135deg, var(--neon-primary) 0%, #00B88C 100%);
    color: #000000 !important;
}

.bg-gradient-neon h2,
.bg-gradient-neon p,
.bg-gradient-neon .lead {
    color: #000000 !important;
    font-weight: 600;
}

/* ===== FEATURE CARDS ===== */
.feature-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: var(--space-8);
    transition: all 0.3s ease;
    height: 100%;
}

.feature-card:hover {
    border-color: var(--neon-primary);
    box-shadow: 0 8px 24px rgba(0, 210, 163, 0.15);
    transform: translateY(-5px);
    background-color: #2A2B2C;
}

.feature-icon {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== MATERIAL CARDS ===== */
.material-card {
    background-color: var(--bg-card);
    padding: var(--space-8);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    height: 100%;
}

.material-card:hover {
    border-color: var(--neon-primary);
    transform: translateY(-5px);
}

.material-detail-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    overflow: hidden;
}

.material-detail-card .card-body {
    padding: var(--space-6);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.material-detail-card:hover {
    border-color: var(--neon-primary);
    box-shadow: 0 8px 24px rgba(0, 210, 163, 0.15);
    background-color: #2A2B2C;
}

.material-icon {
    text-align: center;
    padding: var(--space-8) 0;
    background: rgba(0, 210, 163, 0.08);
}

.material-description {
    min-height: 220px;
}

.material-specs {
    border-top: 1px solid var(--border-color);
    padding-top: var(--space-4);
    margin-top: var(--space-4);
}

.spec-item {
    margin-bottom: var(--space-3);
}

.material-button-wrapper {
    margin-top: auto;
}

.color-badges .badge {
    margin: var(--space-1);
}

/* ===== GALLERY ===== */
.gallery-card,
.gallery-item-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all 0.3s ease;
}

.gallery-card .p-3,
.gallery-item-card .card-body {
    padding: var(--space-6) !important;
}

.gallery-card:hover,
.gallery-item-card:hover {
    border-color: var(--neon-primary);
    box-shadow: 0 8px 24px rgba(0, 210, 163, 0.15);
    transform: translateY(-5px);
    background-color: #2A2B2C;
}

.gallery-image-placeholder,
.gallery-item-image {
    height: 250px;
    background: rgba(0, 210, 163, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.featured-badge {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    z-index: 10;
}

/* ===== QUOTE PAGE ===== */
.quote-page {
    min-height: 100vh;
    padding-top: 70px;
}

.viewer-section {
    background-color: var(--bg-dark);
    border-right: 1px solid var(--border-color);
    min-height: calc(100vh - 70px);
    position: relative;
}

.viewer-container {
    height: calc(100vh - 70px);
    display: flex;
    flex-direction: column;
}

.viewer-toolbar {
    padding: var(--space-4) var(--space-6);
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.threejs-viewer {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.viewer-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 1;
}

.viewer-info {
    padding: var(--space-4) var(--space-6);
    background-color: var(--bg-card);
    border-top: 1px solid var(--border-color);
}

.info-item {
    min-width: 0; /* Allow flex items to shrink below content size */
}

.info-item small {
    font-size: 0.75rem;
    opacity: 0.8;
}

.config-section {
    background-color: var(--bg-dark-subtle);
    min-height: calc(100vh - 70px);
    overflow-y: auto;
}

.config-container {
    padding: var(--space-8);
    max-width: var(--container-md);
    margin: 0 auto;
}

/* Color Selector */
.color-selector {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
}

.color-option {
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.color-option:hover {
    transform: scale(1.1);
}

.color-option.active .color-circle {
    border-color: var(--neon-primary);
    box-shadow: 0 0 12px rgba(0, 210, 163, 0.4);
}

.color-circle {
    width: 36px; /* Tăng lên chút để match với 38px của input */
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    margin-bottom: 2px;
    transition: all 0.3s ease;
    display: inline-block;
}

/* Fix button group size consistency */
.btn-group-sm > .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    height: 38px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    line-height: 1.1;
}

.color-circle.transparent {
    background: linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%, #ccc),
                linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%, #ccc);
    background-size: 10px 10px;
    background-position: 0 0, 5px 5px;
}

/* Size Control Panel */
.size-control-panel {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.size-control-panel:hover {
    border-color: var(--neon-primary);
}

.size-control-panel h6 {
    color: var(--neon-primary);
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: var(--space-4);
}

.form-range {
    background: transparent;
    height: 6px;
}

.form-range::-webkit-slider-thumb {
    background: var(--neon-primary);
    border: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 8px rgba(0, 210, 163, 0.5);
}

.form-range::-moz-range-thumb {
    background: var(--neon-primary);
    border: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 8px rgba(0, 210, 163, 0.5);
}

.form-range::-webkit-slider-runnable-track {
    background: var(--border-color);
    border-radius: 3px;
    height: 6px;
}

.form-range::-moz-range-track {
    background: var(--border-color);
    border-radius: 3px;
    height: 6px;
}

#printabilityStatus .badge {
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
}

#printabilityWarning {
    padding: var(--space-3);
    background-color: rgba(255, 193, 7, 0.1);
    border-left: 3px solid #ffc107;
    border-radius: var(--radius-sm);
}

#printabilityWarning small {
    display: block;
}

#printabilityWarning .btn-link {
    color: var(--neon-primary);
    text-decoration: none;
    font-size: 0.85rem;
    padding: 0;
    margin-left: var(--space-2);
}

#printabilityWarning .btn-link:hover {
    text-decoration: underline;
}

#scaleWarning {
    padding: var(--space-1) var(--space-2);
    background-color: rgba(255, 193, 7, 0.1);
    border-left: 2px solid #ffc107;
    border-radius: var(--radius-sm);
}

#scaleWarning small {
    font-size: 0.7rem;
    line-height: 1.2;
}

/* Price Display */
.price-display {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    border: 1px solid var(--border-color);
}

.price-item {
    text-align: center;
}

.total-price {
    background: linear-gradient(135deg, rgba(0, 210, 163, 0.12) 0%, rgba(0, 210, 163, 0.06) 100%);
    border-radius: var(--radius-md);
    border: 1px solid var(--neon-primary);
    padding: var(--space-4);
}

/* ===== CONTACT PAGE ===== */
.contact-info-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: var(--space-8);
    transition: all 0.3s ease;
    height: 100%;
}

.contact-info-card:hover {
    border-color: var(--neon-primary);
}

.contact-form-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: var(--space-8);
}

/* ===== FOOTER ===== */
.footer {
    background-color: var(--bg-dark) !important;
    border-top: 1px solid var(--border-color);
    margin-top: var(--space-20);
    padding: var(--space-12) 0 var(--space-8) 0;
}

.footer a:hover {
    color: var(--neon-primary) !important;
}

/* ===== ALERTS ===== */
.alert {
    border-radius: var(--form-radius);
    border: none;
    padding: var(--space-4) var(--space-6);
    margin-bottom: var(--space-4);
}

.alert-success {
    background-color: rgba(0, 210, 163, 0.12);
    color: var(--neon-bright);
    border: 1px solid var(--neon-primary);
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.12);
    color: #F87171;
    border: 1px solid #EF4444;
}

.alert-warning {
    background-color: rgba(251, 191, 36, 0.12);
    color: #FCD34D;
    border: 1px solid #FBBF24;
}

.alert-info {
    background-color: var(--bg-card);
    color: var(--text-light);
    border: 1px solid var(--border-color);
}

/* ===== MATERIAL SELECT STYLING ===== */
.material-select {
    font-size: 0.8125rem; /* Slightly smaller for fitting more text */
    line-height: 1.3;
}

.material-select option {
    padding: 0.5rem;
    line-height: 1.5;
}

#materialInfoPanel {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--form-radius);
}

#materialInfoPanel small {
    font-size: 0.8125rem;
    line-height: 1.4;
    color: var(--text-light);
}

#materialInfoPanel i {
    color: var(--text-muted);
    flex-shrink: 0;
}

/* ===== CTA BOX ===== */
.cta-box {
    background-color: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 2px solid var(--border-color);
    padding: var(--space-8);
}

/* ===== PROGRESS BARS ===== */
.progress {
    background-color: var(--bg-card);
    border-radius: var(--form-radius);
    height: 8px;
}

.progress-bar.bg-neon {
    background-color: var(--neon-primary) !important;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* ===== CUSTOM SPACING UTILITIES ===== */
/* Padding */
.py-section { padding-top: var(--space-20); padding-bottom: var(--space-20); }
.py-container { padding-top: var(--space-12); padding-bottom: var(--space-12); }
.py-card { padding-top: var(--space-8); padding-bottom: var(--space-8); }
.px-container { padding-left: var(--space-6); padding-right: var(--space-6); }
.p-card { padding: var(--space-8); }
.p-card-sm { padding: var(--space-6); }

/* Margin */
.mb-section { margin-bottom: var(--space-12); }
.mb-lg { margin-bottom: var(--space-8); }
.mb-md { margin-bottom: var(--space-6); }
.mb-sm { margin-bottom: var(--space-4); }
.mb-xs { margin-bottom: var(--space-2); }
.mt-section { margin-top: var(--space-12); }
.mt-lg { margin-top: var(--space-8); }
.mt-md { margin-top: var(--space-6); }

/* Gap */
.gap-lg { gap: var(--space-6); }
.gap-md { gap: var(--space-4); }
.gap-sm { gap: var(--space-2); }

/* Sections */
.section-dark { background-color: var(--bg-dark-subtle); }
.section-gradient { background: linear-gradient(135deg, rgba(0, 210, 163, 0.08) 0%, rgba(0, 210, 163, 0.02) 100%); }

/* ===== RESPONSIVE ===== */

/* Ultra-Wide Screens (> 1600px) - Ensure proper spacing when content hits max-width */
@media (min-width: 1600px) {
    .container,
    .container-fluid {
        padding-left: var(--space-8);
        padding-right: var(--space-8);
    }
    
    /* Hero and full-width sections maintain padding */
    .hero-section,
    .footer {
        padding-left: var(--space-8);
        padding-right: var(--space-8);
    }
    
    /* Navbar maintains proper padding */
    .navbar .container-fluid {
        padding-left: var(--space-8);
        padding-right: var(--space-8);
    }
}

/* Large Desktop (1200px - 1600px) */
@media (min-width: 1200px) and (max-width: 1599.98px) {
    .container,
    .container-fluid {
        max-width: 1400px !important;
    }
}

/* Tablet and Below */
@media (max-width: 991.98px) {
    .viewer-section {
        min-height: 50vh;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .viewer-container {
        height: 50vh;
    }

    .config-section {
        min-height: auto;
    }

    .hero-section .row {
        min-height: auto !important;
    }
}

@media (max-width: 767.98px) {
    .navbar-brand {
        font-size: 1.2rem;
    }

    .display-3 {
        font-size: 2.5rem;
    }

    .display-4 {
        font-size: 2rem;
    }

    .btn-neon,
    .btn-outline-neon {
        padding: var(--space-2) var(--space-6);
        font-size: 0.9rem;
    }
    
    .feature-card,
    .material-card,
    .contact-info-card,
    .contact-form-card {
        padding: var(--space-6);
    }
    
    .config-container {
        padding: var(--space-4);
    }
}

/* ===== SCROLLBAR STYLING ===== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--neon-primary);
}

/* ===== UTILITIES ===== */
.text-decoration-none:hover {
    text-decoration: none !important;
}

.cursor-pointer {
    cursor: pointer;
}

.border-neon {
    border-color: var(--neon-primary) !important;
}

/* ===== TECHNOLOGY SECTION ===== */
.tech-spec-card {
    transition: all 0.3s ease;
}

.tech-spec-card:hover {
    background: var(--bg-dark) !important;
    border-color: var(--neon-primary) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--neon-glow) !important;
}

.technology-image-wrapper {
    position: relative;
}

.technology-content .lead {
    line-height: 1.8;
}

/* ===== MULTI-VIEWER GRID LAYOUT ===== */
.multi-viewer-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: min-content; /* Ensure rows fit content/aspect-ratio */
    gap: 20px; /* Safer gap */
    padding: 16px;
    background: var(--bg-dark-subtle);
    min-height: 400px;
    max-height: calc(100vh - 300px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--neon-primary) transparent;
}

/* Single column on mobile */
@media (max-width: 768px) {
    .multi-viewer-grid {
        grid-template-columns: 1fr;
    }
}

.multi-viewer-grid::-webkit-scrollbar {
    width: 6px;
}

.multi-viewer-grid::-webkit-scrollbar-track {
    background: transparent;
}

.multi-viewer-grid::-webkit-scrollbar-thumb {
    background: var(--neon-primary);
    border-radius: 3px;
}

/* Empty state placeholder */
.viewer-placeholder-empty {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    text-align: center;
}

/* Individual Part Viewer Card */
.part-viewer-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    /* Removed animation to prevent layout thrashing/overlap */
    transition: box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    aspect-ratio: 1 / 1; /* Always square */
    width: 100%;
    height: auto; /* Ensure height respects aspect ratio */
}

/* Part Viewer Header */
.part-viewer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px; /* Increased padding */
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.part-viewer-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.part-delete-btn {
    padding: 4px 10px; /* Increased active area */
    font-size: 0.85rem;
    margin-left: 8px; /* Safe distance from title */
    opacity: 0.7;
    transition: opacity 0.2s;
}

.part-viewer-card:hover .part-delete-btn {
    opacity: 1;
}

/* Canvas Container */
.part-canvas-container {
    position: relative;
    width: 100%;
    flex: 1; /* Allow it to grow and fill available space */
    min-height: 0; /* Allow shrinking to fit square aspect ratio */
    background: #0a0a0a;
    flex-shrink: 0; 
}

.part-canvas-container canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

/* Part Viewer Controls */
.part-viewer-controls {
    display: flex;
    gap: 2px; /* Thinner gap */
    padding: 2px 4px; /* Minimal padding */
    background: rgba(0, 0, 0, 0.2);
    margin-top: auto; 
    z-index: 10;
    position: relative;
    flex-shrink: 0;
}

.part-control-btn {
    flex: 1;
    padding: 2px 4px; /* Smaller buttons */
    font-size: 0.70rem; 
    height: 24px; /* Compact height */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

/* Part Info Footer */
.part-viewer-info {
    padding: 2px 8px; /* Compact padding */
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid var(--border-color);
    flex-shrink: 0; 
}

.part-info-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
}

.part-info-label {
    color: var(--text-muted);
}

.part-info-value {
    color: var(--neon-primary);
    font-weight: 600;
}

/* ===== MULTI-FILE UPLOAD - PARTS LIST (LEGACY - CAN BE REMOVED) ===== */
#partsListSection {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#partsList {
    scrollbar-width: thin;
    scrollbar-color: var(--neon-primary) transparent;
}

#partsList::-webkit-scrollbar {
    width: 4px;
}

#partsList::-webkit-scrollbar-track {
    background: transparent;
}

#partsList::-webkit-scrollbar-thumb {
    background: var(--neon-primary);
    border-radius: 2px;
}

.part-item {
    transition: all 0.2s ease;
    cursor: pointer;
}

.part-item:hover {
    background: rgba(255, 255, 255, 0.06) !important;
    transform: translateX(2px);
}

.part-item .form-check-input:checked {
    background-color: var(--neon-primary);
    border-color: var(--neon-primary);
}

.part-item .btn-outline-danger {
    opacity: 0.7;
    transition: opacity 0.2s;
}

.part-item:hover .btn-outline-danger {
    opacity: 1;
}

#partsListSection .border-top {
    border-color: rgba(255, 255, 255, 0.1) !important;
}
