:root {
    --accent-color: #00f3ff; /* Electric Neon Blue */
    --accent-hover: #00c3cc;
    --bg-dark: #0a0a0f;
    --bg-panel: rgba(15, 15, 20, 0.7);
    --border-subtle: rgba(0, 243, 255, 0.2);
    --text-main: #f0f0f0;
    --text-muted: #888899;
    --white: #ffffff;
    --error: #ff4a4a;
    --glass-blur: blur(15px);
}

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

body {
    font-family: 'Rubik', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    direction: rtl;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    transition: all 0.3s;
}

/* Accessibility Modes */
body.high-contrast {
    --bg-dark: #000;
    --bg-panel: #000;
    --border-subtle: #fff;
    --accent-color: #ffff00;
    --text-main: #fff;
    --text-muted: #ccc;
}
body.readable-font {
    font-family: Arial, Helvetica, sans-serif !important;
}

/* Particles Background */
#particles-js {
    position: fixed;
    width: 100vw;
    height: 100vh;
    top: 0;
    left: 0;
    z-index: -2;
    background-color: var(--bg-dark);
}

/* Layout */
.ksp-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
}

/* Accessibility Menu */
.a11y-widget {
    position: fixed;
    right: 20px;
    top: 150px;
    z-index: 9999;
}
#a11y-toggle {
    background: var(--accent-color);
    color: #000;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 243, 255, 0.4);
    transition: transform 0.3s;
}
#a11y-toggle:hover { transform: scale(1.1); }
.a11y-panel {
    position: absolute;
    top: 60px;
    right: 0;
    background: var(--bg-panel);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-subtle);
    padding: 1.5rem;
    border-radius: 12px;
    width: 250px;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.a11y-panel h3 { font-size: 1.2rem; color: var(--accent-color); margin-bottom: 0.5rem; border-bottom: 1px solid var(--border-subtle); padding-bottom: 0.5rem; }
.a11y-panel button {
    background: rgba(255,255,255,0.05);
    color: var(--text-main);
    border: 1px solid var(--border-subtle);
    padding: 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    text-align: right;
    transition: all 0.2s;
}
.a11y-panel button:hover { background: rgba(0,243,255,0.1); }
.hidden { display: none !important; }

/* Header */
.ksp-header {
    background: rgba(10, 10, 15, 0.6);
    backdrop-filter: var(--glass-blur);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-subtle);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; }
.header-right { display: flex; align-items: center; gap: 2rem; }
.premium-logo { height: 60px; border-radius: 8px; box-shadow: 0 0 15px rgba(0,243,255,0.3); }
.blue-btn-worlds {
    background: transparent;
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}
.blue-btn-worlds:hover { background: var(--accent-color); color: #000; box-shadow: 0 0 15px var(--accent-color); }
.header-left { display: flex; align-items: center; gap: 2rem; }
.header-icon-text { font-size: 0.9rem; cursor: pointer; transition: color 0.3s; }
.header-icon-text:hover { color: var(--accent-color); }
.cart-btn {
    background: var(--accent-color);
    color: #000;
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}
.cart-btn:hover { box-shadow: 0 0 20px var(--accent-color); }

/* Main layout for results */
.main-content { flex: 1; display: flex; flex-direction: column; }

/* Hero / Landing */
.landing-hero {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10rem 2rem;
    text-align: center;
    flex: 1;
    overflow: hidden;
}
.hero-bg-overlay {
    position: absolute;
    inset: 0;
    background: url('img/bg.jpg') center/cover no-repeat;
    z-index: -1;
    opacity: 0.4;
    mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
    animation: pulseBg 10s infinite alternate;
}
@keyframes pulseBg {
    0% { transform: scale(1); filter: brightness(0.8); }
    100% { transform: scale(1.05); filter: brightness(1.2); }
}
.hero-content { position: relative; z-index: 1; max-width: 900px; width: 100%; }
.landing-title { font-size: 4.5rem; font-weight: 800; color: var(--white); margin-bottom: 1rem; text-shadow: 0 0 30px rgba(0,243,255,0.5); line-height: 1.1; }
.landing-subtitle { font-size: 1.5rem; color: #ccc; margin-bottom: 3rem; font-weight: 300; }
.hero-search-form {
    display: flex;
    width: 100%;
    background: rgba(0,0,0,0.6);
    border: 1px solid var(--accent-color);
    border-radius: 50px;
    overflow: hidden;
    margin-bottom: 2rem;
    backdrop-filter: var(--glass-blur);
    box-shadow: 0 0 30px rgba(0,243,255,0.2);
    transition: box-shadow 0.3s ease;
}
.hero-search-form:focus-within { box-shadow: 0 0 50px rgba(0,243,255,0.5); }
.hero-search-input {
    flex: 1;
    padding: 1.5rem 2.5rem;
    font-size: 1.2rem;
    background: transparent;
    border: none;
    color: var(--white);
    outline: none;
}
.hero-search-input::placeholder { color: #888; }
.hero-search-btn {
    background: var(--accent-color);
    color: #000;
    border: none;
    padding: 0 3rem;
    font-size: 1.2rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s;
}
.hero-search-btn:hover { background: var(--white); box-shadow: 0 0 20px var(--white); }

.trust-badges { display: flex; justify-content: center; gap: 3rem; font-size: 1rem; color: var(--accent-color); font-weight: 600; }
.trust-badges span { display: flex; align-items: center; gap: 0.5rem; }

/* States */
.state-view { text-align: center; padding: 8rem 2rem; }
.ksp-spinner {
    width: 60px;
    height: 60px;
    border: 3px solid var(--border-subtle);
    border-top: 3px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 2rem;
}

/* Results */
.box-shadow-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    backdrop-filter: var(--glass-blur);
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}
.breadcrumb { margin: 2rem 0; font-size: 0.9rem; color: var(--text-muted); }
.product-overview { display: flex; padding: 3rem; gap: 4rem; margin-bottom: 3rem; }
.product-image-col { flex: 0 0 400px; }
.product-image-col img { width: 100%; border-radius: 8px; border: 1px solid var(--border-subtle); box-shadow: 0 0 20px rgba(0,0,0,0.8); }
.product-title { font-size: 3rem; font-weight: 700; margin-bottom: 2rem; line-height: 1.2; color: var(--white); text-shadow: 0 0 20px rgba(255,255,255,0.2); }
.product-meta { display: flex; gap: 2rem; }
.meta-item { display: flex; flex-direction: column; }
.meta-label { color: var(--text-muted); font-size: 0.9rem; text-transform: uppercase; letter-spacing: 1px; }
.meta-val { font-size: 1.5rem; font-weight: 700; color: var(--accent-color); }

.section-title { font-size: 1.8rem; font-weight: 300; color: var(--white); margin-bottom: 2rem; border-bottom: 1px solid var(--border-subtle); padding-bottom: 1rem; }

.instances-list { display: flex; flex-direction: column; gap: 2rem; }
.instance-row { display: flex; padding: 2.5rem; gap: 3rem; transition: transform 0.3s, box-shadow 0.3s; }
.instance-row:hover { transform: translateY(-5px); box-shadow: 0 15px 50px rgba(0,243,255,0.15); border-color: var(--accent-color); }
.instance-col { display: flex; flex-direction: column; }
.info-col { flex: 2; }
.materials-col { flex: 2; border-right: 1px solid var(--border-subtle); padding-right: 3rem; }
.price-col { flex: 1.5; border-right: 1px solid var(--border-subtle); padding-right: 3rem; text-align: center; justify-content: center; }

.instance-title { font-size: 1.8rem; font-weight: 700; margin-bottom: 1.5rem; color: var(--accent-color); }
.specs-table { width: 100%; border-collapse: collapse; font-size: 1rem; }
.specs-table td { padding: 1rem 0; border-bottom: 1px solid rgba(255,255,255,0.05); }
.specs-table td:first-child { color: var(--text-muted); width: 150px; }

.filaments-list { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.5rem; }
.filament-tag { font-size: 0.9rem; background: rgba(255,255,255,0.05); border: 1px solid var(--border-subtle); padding: 0.4rem 1rem; border-radius: 20px; display: flex; align-items: center; gap: 0.5rem; }
.c-dot { width: 12px; height: 12px; border-radius: 50%; box-shadow: 0 0 5px rgba(255,255,255,0.5); }
.plate-mini-item { font-size: 0.9rem; display: flex; justify-content: space-between; padding: 0.6rem 0; border-bottom: 1px solid rgba(255,255,255,0.05); }
.p-name { color: var(--white); }

.price-wrap { color: var(--white); display: flex; align-items: flex-start; justify-content: center; gap: 0.2rem; margin-bottom: 1.5rem; }
.currency { 
    font-size: 2.2rem; 
    font-weight: 300; 
    margin-top: 0.4rem; 
    background: linear-gradient(135deg, #00f3ff, #aa00ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 15px rgba(0,243,255,0.4);
}
.total-price { font-size: 4rem; font-weight: 800; line-height: 1; text-shadow: 0 0 30px rgba(0,243,255,0.3); }
.add-to-cart-btn { 
    background: var(--accent-color); 
    color: #000; 
    width: 100%; 
    font-size: 1.05rem; 
    padding: 0.9rem 1.2rem; 
    border-radius: 8px; 
    text-decoration: none; 
    font-weight: 800; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s; 
}
.btn-icon { font-size: 1.3rem; }
.add-to-cart-btn:hover { background: var(--white); box-shadow: 0 0 30px var(--white); }

/* Magazine */
.magazine-section { margin-top: 4rem; margin-bottom: 6rem; padding-top: 4rem; border-top: 1px solid var(--border-subtle); }
.magazine-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.mag-card { overflow: hidden; transition: transform 0.3s; cursor: pointer; }
.mag-card:hover { transform: translateY(-10px); border-color: var(--accent-color); }
.mag-card img { width: 100%; height: 250px; object-fit: cover; border-bottom: 1px solid var(--border-subtle); transition: transform 0.5s; }
.mag-card:hover img { transform: scale(1.05); }
.mag-content { padding: 2rem; }
.mag-content h3 { font-size: 1.4rem; color: var(--white); margin-bottom: 1rem; line-height: 1.3; }
.mag-content p { color: var(--text-muted); margin-bottom: 1.5rem; font-size: 0.95rem; }
.mag-content a { color: var(--accent-color); text-decoration: none; font-weight: 700; display: inline-flex; align-items: center; gap: 0.5rem; }
.mag-content a:hover { text-decoration: underline; }

/* Advanced Footer */
.main-footer { background: #050508; border-top: 1px solid var(--border-subtle); padding-top: 5rem; position: relative; z-index: 10; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.5fr; gap: 4rem; margin-bottom: 4rem; }
.footer-logo { height: 60px; margin-bottom: 1.5rem; border-radius: 8px; }
.footer-col h4 { font-size: 1.2rem; color: var(--white); margin-bottom: 1.5rem; text-transform: uppercase; letter-spacing: 1px; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 0.8rem; }
.footer-col ul li a { color: var(--text-muted); text-decoration: none; transition: color 0.3s; }
.footer-col ul li a:hover { color: var(--accent-color); }
.footer-col p { color: var(--text-muted); margin-bottom: 1rem; display: flex; align-items: center; gap: 0.5rem; }
.footer-bottom { background: #000; padding: 1.5rem 0; text-align: center; border-top: 1px solid rgba(255,255,255,0.05); font-size: 0.9rem; color: #666; }

/* Mobile Bottom Menu */
.mobile-bottom-menu {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(10,10,15,0.9);
    backdrop-filter: var(--glass-blur);
    border-top: 1px solid var(--border-subtle);
    z-index: 2000;
    padding: 0.8rem 1rem;
    padding-bottom: env(safe-area-inset-bottom, 0.8rem);
}
.menu-item { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; color: var(--text-muted); text-decoration: none; font-size: 0.75rem; flex: 1; }
.menu-item .icon { font-size: 1.5rem; }
.menu-item.active { color: var(--accent-color); }

/* Modals */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}
.modal-content {
    background: rgba(15,15,20,0.95);
    width: 90%;
    max-width: 600px;
    padding: 3rem;
    border: 1px solid var(--accent-color);
    box-shadow: 0 0 50px rgba(0,243,255,0.2);
    border-radius: 12px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}
.close-modal { position: absolute; top: 1.5rem; right: 1.5rem; font-size: 2.5rem; cursor: pointer; color: var(--text-muted); transition: color 0.3s; line-height: 1; }
.close-modal:hover { color: var(--error); }
.modal-title { font-size: 2.2rem; font-weight: 700; color: var(--white); margin-bottom: 0.5rem; }
.modal-subtitle { color: var(--text-muted); margin-bottom: 2rem; font-size: 1rem; }
.order-summary-box { background: rgba(0,0,0,0.5); border: 1px solid var(--border-subtle); padding: 1.5rem; border-radius: 8px; margin-bottom: 2rem; }
.summary-title { font-size: 1.2rem; margin-bottom: 0.5rem; color: var(--accent-color); }
.summary-details { display: flex; justify-content: space-between; font-size: 1rem; }
.summary-price { color: var(--white); font-weight: 700; }

.checkout-form .form-group { margin-bottom: 1.5rem; }
.checkout-form label { display: block; margin-bottom: 0.5rem; color: var(--text-main); font-weight: 500; }
.checkout-form input {
    width: 100%;
    padding: 1.2rem;
    background: rgba(0,0,0,0.5);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    color: var(--white);
    font-size: 1.1rem;
    transition: all 0.3s;
}
.checkout-form input:focus { border-color: var(--accent-color); box-shadow: 0 0 15px rgba(0,243,255,0.2); outline: none; }
.checkbox-label { display: flex !important; align-items: flex-start; gap: 12px; cursor: pointer; font-weight: 400 !important; color: var(--text-muted) !important; line-height: 1.5; }
.checkbox-label input { width: auto; margin-top: 5px; cursor: pointer; transform: scale(1.2); }
.accent-link { color: var(--accent-color); text-decoration: none; }
.accent-link:hover { text-decoration: underline; }
.warning-box { background: rgba(255, 74, 74, 0.1) !important; border: 1px solid rgba(255, 74, 74, 0.4) !important; padding: 1.5rem !important; border-radius: 8px; }
.warning-box .checkbox-label { color: #ffa3a3 !important; }

/* Responsive */
@media (max-width: 992px) {
    .landing-title { font-size: 3rem; }
    .product-overview { flex-direction: column; gap: 2rem; }
    .instance-row { flex-direction: column; gap: 2rem; }
    .materials-col, .price-col { border-right: none; border-top: 1px solid var(--border-subtle); padding-right: 0; padding-top: 2rem; }
    .magazine-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
}
@media (max-width: 768px) {
    .header-left, .header-right .blue-btn-worlds { display: none; }
    .landing-title { font-size: 2.5rem; }
    .hero-search-form { flex-direction: column; border-radius: 12px; }
    .hero-search-btn { padding: 1.5rem; border-radius: 0 0 12px 12px; }
    .hero-search-input { border-radius: 12px 12px 0 0; }
    .trust-badges { flex-direction: column; gap: 1rem; align-items: center; }
    .magazine-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    body { padding-bottom: 70px; } /* For bottom menu */
    .mobile-bottom-menu { display: flex; }
    .a11y-widget { display: none; /* Hide floating on mobile, maybe put in menu */ }
}

/* === 3D PRINTER LOADING SCENE === */
.printer-scene {
    position: relative;
    width: 400px;
    height: 280px;
    margin: 0 auto 2rem;
}

/* Horizontal rail */
.printer-rail {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: linear-gradient(90deg, #333, #555, #333);
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

/* Extruder carriage */
.printer-extruder {
    position: absolute;
    top: -10px;
    left: 10%;
    animation: extruderSweep 1.2s ease-in-out infinite alternate;
    z-index: 5;
}

.extruder-body {
    width: 70px;
    height: 90px;
    background: linear-gradient(180deg, #b0b0b0 0%, #888 30%, #666 60%, #444 100%);
    border-radius: 8px 8px 4px 4px;
    position: relative;
    box-shadow: 0 4px 20px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.2);
    border: 1px solid #555;
}

/* Fan on top */
.extruder-fan {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, #999, #666, #999, #666, #999);
    border: 2px solid #555;
    animation: fanSpin 0.3s linear infinite;
}

/* Nozzle */
.extruder-nozzle {
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    background: linear-gradient(180deg, #777, #444);
    clip-path: polygon(0 0, 100% 0, 70% 100%, 30% 100%);
}

/* Nozzle hot glow */
.nozzle-glow {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 10px;
    background: #ff5500;
    border-radius: 50%;
    box-shadow: 0 0 12px #ff5500, 0 0 25px #ff3300, 0 0 40px rgba(255,80,0,0.5);
    animation: glowPulse 0.15s infinite alternate;
}

/* Print bed */
.printer-bed {
    position: absolute;
    bottom: 0;
    left: 5%;
    right: 5%;
    height: 80px;
    background: linear-gradient(180deg, #1a1a2e, #111);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    overflow: hidden;
}

/* Growing "print layers" */
.print-layers {
    position: absolute;
    bottom: 0;
    left: 10%;
    right: 10%;
    height: 0;
    background: repeating-linear-gradient(
        0deg,
        var(--accent-color) 0px,
        var(--accent-color) 2px,
        rgba(0,243,255,0.3) 2px,
        rgba(0,243,255,0.3) 4px
    );
    animation: layersGrow 3s ease-in-out infinite;
    border-radius: 2px 2px 0 0;
    box-shadow: 0 -2px 15px rgba(0,243,255,0.3);
}

.print-status-text {
    color: var(--accent-color);
    font-size: 1.5rem;
    font-weight: 700;
    animation: textPulse 1.5s ease-in-out infinite;
}

@keyframes extruderSweep {
    0%   { left: 10%; }
    100% { left: calc(90% - 70px); }
}

@keyframes fanSpin {
    from { transform: translateX(-50%) rotate(0deg); }
    to   { transform: translateX(-50%) rotate(360deg); }
}

@keyframes glowPulse {
    0%   { opacity: 0.7; box-shadow: 0 0 8px #ff5500, 0 0 15px #ff3300; }
    100% { opacity: 1;   box-shadow: 0 0 15px #ff5500, 0 0 30px #ff3300, 0 0 45px rgba(255,80,0,0.5); }
}

@keyframes layersGrow {
    0%   { height: 0; }
    80%  { height: 65px; }
    100% { height: 65px; }
}

@keyframes textPulse {
    0%, 100% { opacity: 0.7; }
    50%      { opacity: 1; }
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    .printer-scene { width: 280px; height: 220px; }
    .extruder-body { width: 50px; height: 65px; }
    .extruder-fan { width: 25px; height: 25px; }
}


/* Magazine Modal */
.mag-modal-content {
    background: rgba(15,15,20,0.98);
    width: 90%;
    max-width: 800px;
    padding: 3rem;
    border: 1px solid var(--accent-color);
    box-shadow: 0 0 50px rgba(0,243,255,0.2);
    border-radius: 12px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}
.mag-modal-img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 2rem;
    border: 1px solid var(--border-subtle);
}
.mag-modal-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-muted);
}
.mag-modal-text h3 {
    color: var(--white);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}
