/* ==========================================
   סגנונות בסיס וריסט
   ========================================== */

* {
    box-sizing: border-box;
}

/* Global zoom - הקטנת כל האתר ל-75% */
/* zoom על html = כל הוויופורט מוקטן, 100% רוחב עדיין ממלא את כל המסך */
html {
    zoom: 0.75;
    background: #f0f2f5;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background: #ffffff;
    min-height: 133.34vh; /* פיצוי על zoom: 0.75 (100/0.75) */
    line-height: 1.4;
    overflow-x: hidden;
    font-size: 100%;
}

body {
    overflow-x: hidden;
}

/* Container ולייאאוט ראשי */
.container {
    width: 100%;
    margin: 0;
    background: white;
    border-radius: 0;
    box-shadow: none;
    overflow-x: hidden;
    overflow-y: visible;
}

/* Firefox fallback - לא תומך ב-zoom */
@-moz-document url-prefix() {
    html {
        zoom: 1;
        transform: scale(0.75);
        transform-origin: top center;
        width: 133.34%; /* פיצוי על scale(0.75) כדי למלא את כל הרוחב */
    }
}

.header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 5px 15px 3px;
    text-align: center;
    position: relative;
    overflow: hidden; /* מכיל את ::before (200% width) בתוך ה-header */
}

.header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(255,255,255,0.05) 10px,
        rgba(255,255,255,0.05) 20px
    );
    animation: slide 20s linear infinite;
    clip-path: inset(0);
    z-index: 0;
}

@keyframes slide {
    0% { transform: translateX(-50px); }
    100% { transform: translateX(50px); }
}

.header h1 {
    font-size: 1.8em;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    position: relative;
    z-index: 1;
}

.header p {
    font-size: 1em;
    margin: 8px 0 0 0;
    position: relative;
    z-index: 1;
}

/* Main Layout Grid */
.main-content {
    display: grid;
    grid-template-columns: 280px 1fr 280px;
    gap: 10px;
    padding: 10px;
    min-height: 70vh;
    max-width: 100%;
    overflow-x: hidden;
}

.sidebar {
    background: #f8f9fa;
    padding: 15px;
    border-left: 3px solid #3498db;
    max-height: calc(100vh - 180px); /* גובה מקסימלי יחסית לגובה המסך */
    overflow-y: auto; /* גלילה אנכית לכל הסיידבר */
    overflow-x: hidden;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.1);
    border-radius: 8px;
    max-width: 100%;
    position: sticky;
    top: 10px;
}

.cabinet-preview {
    background: linear-gradient(135deg, #ecf0f1 0%, #d5dbdb 100%);
    padding: 15px;
    border-right: 3px solid #3498db;
    max-height: 120vh;
    overflow-y: auto;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.1);
    border-radius: 8px;
    max-width: 100%;
    overflow-x: hidden;
}

.canvas-area {
    padding: 15px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    max-width: 100%;
    overflow-x: hidden;
}

/* Canvas Elements */
#cabinet_canvas {
    border: 3px solid #34495e;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

#canvas {
    border: 3px solid #34495e;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* הגבטת שהתוכן לא יעבור את גבולות המסך */
/* max-width מוגדר למעלה ב-.container הראשי */

.main-content {
    max-width: 100%;
    overflow-x: hidden;
}

.sidebar, .cabinet-preview, .canvas-area {
    max-width: 100%;
    overflow-x: hidden;
}

/* שיפורים נוספים לטאבים */
.product-tabs {
    scrollbar-width: thin;
    scrollbar-color: #3498db #f8f9fa;
}

.product-tabs::-webkit-scrollbar {
    height: 4px;
}

.product-tabs::-webkit-scrollbar-track {
    background: #f8f9fa;
}

.product-tabs::-webkit-scrollbar-thumb {
    background: #3498db;
    border-radius: 2px;
}

.plate-tabs {
    scrollbar-width: thin;
    scrollbar-color: #3498db #f8f9fa;
}

.plate-tabs::-webkit-scrollbar {
    height: 4px;
}

.plate-tabs::-webkit-scrollbar-track {
    background: #f8f9fa;
}

.plate-tabs::-webkit-scrollbar-thumb {
    background: #3498db;
    border-radius: 2px;
}