/* Chapter 6: Euler Line & Triangle Centers Simulator */

.euler-sim {
    width: 100%;
    height: 100%;
    display: flex;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
    overflow: hidden;
    gap: 0;
}

/* ── Control Panel (Left Side) ── */
.euler-panel {
    width: 240px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-right: 1px solid rgba(67, 97, 238, 0.08);
    padding: 16px 14px;
    box-sizing: border-box;
    overflow-y: auto;
    gap: 6px;
}

.euler-panel-title {
    font-size: 0.92rem;
    font-weight: 800;
    color: #1a202c;
    letter-spacing: -0.3px;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.euler-panel-title .icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: linear-gradient(135deg, #4361ee, #3f37c9);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.euler-panel-sub {
    font-size: 0.68rem;
    color: #6b7280;
    margin-bottom: 10px;
    line-height: 1.5;
}

/* Toggle Group */
.euler-toggle-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.euler-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(240, 244, 248, 0.7);
    cursor: pointer;
    user-select: none;
    transition: all 0.25s ease;
    border: 1.5px solid transparent;
}

.euler-toggle:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.05);
    transform: translateX(2px);
}

.euler-toggle.active {
    background: rgba(255, 255, 255, 1);
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.06);
}

.euler-toggle input[type="checkbox"] {
    display: none;
}

.euler-swatch {
    width: 18px;
    height: 18px;
    border-radius: 6px;
    flex-shrink: 0;
    position: relative;
    transition: all 0.25s;
    box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.08);
}

.euler-swatch::after {
    content: '';
    position: absolute;
    inset: 4px;
    border-radius: 3px;
    background: inherit;
    opacity: 0;
    transition: opacity 0.2s;
}

.euler-toggle.active .euler-swatch::after {
    opacity: 0;
}

.euler-toggle.active .euler-swatch {
    box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.1), 0 2px 8px rgba(0, 0, 0, 0.15);
    transform: scale(1.1);
}

/* Check mark inside swatch */
.euler-swatch .check-mark {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    color: #fff;
    font-weight: 900;
    opacity: 0;
    transition: opacity 0.2s;
}

.euler-toggle.active .euler-swatch .check-mark {
    opacity: 1;
}

.euler-toggle-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #374151;
    line-height: 1.3;
}

.euler-toggle-label small {
    display: block;
    font-size: 0.6rem;
    font-weight: 400;
    color: #9ca3af;
    margin-top: 1px;
}

/* Swatch Colors */
.swatch-blue { background: #4361ee; }
.swatch-red { background: #ef476f; }
.swatch-green { background: #06d6a0; }
.swatch-purple { background: #7209b7; }
.swatch-gold { background: linear-gradient(135deg, #f59e0b, #d97706); }

/* Separator */
.euler-sep {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0,0,0,0.06), transparent);
    margin: 6px 0;
}

/* Euler Line special toggle */
.euler-toggle.euler-highlight {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(217, 119, 6, 0.05));
    border: 1.5px solid rgba(245, 158, 11, 0.15);
}

.euler-toggle.euler-highlight.active {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(217, 119, 6, 0.08));
    border-color: rgba(245, 158, 11, 0.3);
    box-shadow: 0 2px 12px rgba(245, 158, 11, 0.15);
}

/* Info Card */
.euler-info {
    margin-top: auto;
    padding: 10px 12px;
    background: rgba(67, 97, 238, 0.04);
    border-radius: 10px;
    border: 1px solid rgba(67, 97, 238, 0.08);
}

.euler-info-title {
    font-size: 0.68rem;
    font-weight: 700;
    color: #4361ee;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.euler-info-body {
    font-size: 0.65rem;
    color: #6b7280;
    line-height: 1.55;
}

.euler-info-body strong {
    color: #374151;
}

/* ── SVG Canvas Area ── */
.euler-canvas-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    box-sizing: border-box;
}

.euler-canvas-wrap svg {
    width: 100%;
    height: 100%;
    border-radius: 14px;
    background: linear-gradient(145deg, #ffffff 0%, #f8faff 100%);
    box-shadow:
        inset 0 0 20px rgba(67, 97, 238, 0.02),
        0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(67, 97, 238, 0.06);
}

/* SVG Styling */
.euler-grid-line {
    stroke: #e5e7eb;
    stroke-width: 0.5;
}

.euler-grid-line-major {
    stroke: #d1d5db;
    stroke-width: 0.8;
}

.euler-triangle-edge {
    fill: none;
    stroke: #1e293b;
    stroke-width: 2.5;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.euler-triangle-fill {
    fill: rgba(67, 97, 238, 0.03);
    stroke: none;
}

.euler-vertex {
    cursor: grab;
    transition: r 0.15s ease;
}

.euler-vertex:hover {
    filter: brightness(1.15);
}

.euler-vertex:active {
    cursor: grabbing;
}

.euler-vertex-ring {
    fill: none;
    stroke-width: 2;
    opacity: 0.3;
    pointer-events: none;
}

.euler-vertex-label {
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 700;
    fill: #1e293b;
    pointer-events: none;
    user-select: none;
}

.euler-center-point {
    pointer-events: none;
}

.euler-center-label {
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    font-weight: 700;
    pointer-events: none;
    user-select: none;
}

.euler-construction-line {
    fill: none;
    stroke-width: 1.3;
    stroke-dasharray: 6, 4;
    opacity: 0.6;
    pointer-events: none;
}

.euler-line-main {
    fill: none;
    stroke: #f59e0b;
    stroke-width: 3.5;
    stroke-linecap: round;
    opacity: 0.85;
    pointer-events: none;
    filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.4));
}

/* Responsive */
@media (max-width: 768px) {
    .euler-sim {
        flex-direction: column;
    }
    .euler-panel {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
        padding: 10px;
        max-height: 140px;
        overflow-y: auto;
        border-right: none;
        border-bottom: 1px solid rgba(67, 97, 238, 0.08);
    }
    .euler-panel-title,
    .euler-panel-sub,
    .euler-sep,
    .euler-info {
        display: none;
    }
    .euler-toggle-group {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 5px;
    }
}

/* ===== Gonit Ongon 2.0 de-slop (tokens from design-system.css) =====
   Categorical swatch colours + JS-drawn centre colours are left intact
   (they map legend ↔ diagram); only the glass/blue chrome is de-slopped. */
.euler-panel { background: var(--color-surface); border-right: 1px solid var(--color-border); }
.euler-panel-title { color: var(--color-ink); }
.euler-panel-title .icon { background: var(--color-accent); }
.euler-panel-sub, .euler-info-body { color: var(--color-ink-2); }
.euler-toggle { background: var(--color-surface-2); }
.euler-toggle:hover { background: var(--color-surface); border-color: var(--color-border); }
.euler-toggle.active { background: var(--color-surface); box-shadow: var(--shadow-sm); }
.euler-toggle-label { color: var(--color-ink); }
.euler-info { background: var(--color-accent-soft); border: 1px solid var(--color-border); }
.euler-info-title { color: var(--color-accent-active); }
.euler-canvas-wrap svg { background: var(--color-surface); border: 1px solid var(--color-border); box-shadow: var(--shadow-sm); }
.euler-triangle-fill { fill: var(--color-accent-soft); }
.euler-line-main { filter: none; }
