* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Helvetica Neue', Arial, sans-serif; background-color: #f4f6f8; color: #333; height: 100vh; overflow: hidden; }

.hidden { display: none !important; }

/* ==========================================
   1. LOGOWANIE
   ========================================== */
#login-screen { display: flex; justify-content: center; align-items: center; height: 100vh; }
.login-box { background: #fff; padding: 30px; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); width: 100%; max-width: 400px; }
.login-box h2 { margin-bottom: 20px; text-align: center; }
.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: bold; font-size: 14px; }
.form-group input { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 4px; }
button { background-color: #007bff; color: white; border: none; padding: 12px; width: 100%; border-radius: 4px; cursor: pointer; font-weight: bold; }
.btn-secondary { background-color: #6c757d; width: auto; padding: 8px 16px; }

/* ==========================================
   2. UKŁAD DASHBOARDU I NAWIGACJA
   ========================================== */
.dashboard-container { display: flex; flex-direction: column; height: 100vh; }
.dashboard-container.active { display: flex; }
.workspace { display: flex; flex: 1; overflow: hidden; }
.workspace-view { display: none; flex: 1; height: 100%; }
.workspace-view.active { display: flex; }

.topbar { background: #fff; padding: 15px 30px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #ddd; }
.main-nav { display: flex; gap: 10px; }
.nav-btn { background: #e9ecef; color: #333; padding: 8px 16px; width: auto; font-size: 14px; }
.nav-btn.active { background: #007bff; color: white; }

/* ==========================================
   3. LEWY PANEL (Drzewko)
   ========================================== */
.sidebar { width: 350px; background: #fff; border-right: 1px solid #ddd; padding: 20px; overflow-y: auto; }
.sidebar h3 { margin-bottom: 15px; padding-bottom: 10px; border-bottom: 2px solid #f4f6f8; }

.tree-node { margin-left: 15px; margin-top: 5px; }
.tree-item { cursor: pointer; padding: 5px; border-radius: 4px; transition: background 0.2s; font-size: 14px; display: flex; align-items: center; gap: 5px; width: 100%; }
.tree-item:hover { background: #e9ecef; }
.tree-item.active-node { background: #007bff; color: white; }
.tree-children { display: none; border-left: 1px dashed #ccc; padding-left: 10px; }
.tree-children.open { display: block; }

.compare-btn { background: none; border: none; cursor: pointer; font-size: 14px; margin-left: auto; padding: 2px 6px; border-radius: 4px; transition: background 0.2s; width: auto; }
.compare-btn:hover { background: #007bff; color: white; }

/* ==========================================
   4. PRAWY PANEL (Wizualizacja i Wyniki)
   ========================================== */
.viewer { flex: 1; padding: 30px; overflow-y: auto; display: flex; flex-direction: column; gap: 20px; }
.details-card, .canvas-card { background: #fff; padding: 20px; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.details-card h2, .canvas-card h2 { margin-bottom: 15px; font-size: 18px; color: #555; }
.details-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; font-size: 14px; }
.detail-item strong { display: block; color: #888; font-size: 12px; margin-bottom: 2px; }
.empty-state { text-align: center; color: #888; margin-top: 50px; font-size: 18px; }

/* --- Symulacja Ekranu Badania i Płótno --- */
.canvas-wrapper {
    position: relative;
    background: #000;
    width: 100%;
    max-width: 800px; /* <--- Ograniczenie maksymalnego rozmiaru */
    margin: 0 auto;   /* <--- Wyśrodkowanie okna w panelu */
    aspect-ratio: 4/3; 
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2); /* Dodaje lekki, estetyczny cień */
}

.canvas-target {
    position: absolute;
    top: 5%;
    padding: 10px 20px;
    border: 2px solid #ffffff;
    color: #ffffff;
    font-size: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 2;
}
#canvas-target-left { left: 5%; }
#canvas-target-right { right: 5%; }

#canvas-stimulus-image { 
    max-width: 60%; 
    max-height: 60%; 
    object-fit: contain; 
    z-index: 2; 
    margin: auto;
}
#canvas-stimulus-text { 
    color: #fff; 
    font-size: 24px; 
    z-index: 2; 
    text-align: center; 
    max-width: 80%; 
}

/* KLUCZOWA ZMIANA: Płótno jest całkowicie przezroczyste */
canvas, #trajectory-canvas {
    position: absolute;
    top: 0; 
    left: 0;
    width: 100%; 
    height: 100%;
    z-index: 10;
    pointer-events: none;
    background: transparent !important;
    border: none !important;
}

/* ==========================================
   5. KREATOR BADANIA
   ========================================== */
.stimulus-row { display: flex; gap: 15px; align-items: center; background: #fdfdfd; padding: 15px; border: 1px solid #ddd; border-radius: 4px; margin-bottom: 10px; }
.stimulus-row input[type="file"] { flex: 2; }
.stimulus-row select { flex: 1; padding: 8px; border: 1px solid #ccc; border-radius: 4px; }
.remove-row-btn { background: #dc3545; color: white; padding: 8px 12px; width: auto; cursor: pointer; }