@import url('https://fonts.googleapis.com/css2?family=Bungee&display=swap');

.hidden { display: none !important; }

.sol-neo-wrapper {
    font-family: system-ui, -apple-system, sans-serif; max-width: 1200px; margin: 20px auto;
    border: 3px solid #000; border-radius: 12px; box-shadow: 8px 8px 0px #000;
    padding: 25px; background: #fff; color: #000; box-sizing: border-box; position: relative;
}
.sol-neo-wrapper * { box-sizing: border-box; }

.sol-header {
    background: #b5ead7; padding: 15px 20px; border-radius: 12px; border: 3px solid #000; 
    box-shadow: 4px 4px 0px #000; margin-bottom: 25px; text-align: center;
}
.sol-header h2 { margin: 0 0 5px 0; font-size: 1.8rem; font-weight: 900; text-transform: uppercase; }
.sol-header p { margin: 0; font-weight: 800; font-size: 1rem; color: #333; }

/* CONTROLS & LEGEND */
.sol-controls { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 20px; margin-bottom: 20px; padding-bottom: 20px; border-bottom: 3px dashed #000; }
.sol-legend { display: flex; flex-wrap: wrap; gap: 10px; }
.sol-badge { padding: 6px 12px; border: 2px solid #000; border-radius: 6px; font-weight: 800; font-size: 0.95rem; box-shadow: 2px 2px 0px #000; }
.sol-badge b { font-family: 'Bungee', cursive; font-size: 1.1rem; margin-right: 5px; }

.badge-t { background: #a6ff96; }
.badge-k { background: #ffb7b2; }
.badge-i { background: #fdfd96; }
.badge-x { background: #e0e0e0; }

/* TOGGLE SWITCH IUPAC */
.sol-toggle-wrapper { display: flex; align-items: center; gap: 10px; background: #f4f4f4; padding: 10px 15px; border: 3px solid #000; border-radius: 30px; box-shadow: 3px 3px 0px #000; }
.toggle-label { font-weight: 900; font-size: 1rem; color: #555; transition: 0.3s; }
.toggle-label.active { color: #ff595e; }

.sol-switch { position: relative; display: inline-block; width: 60px; height: 32px; }
.sol-switch input { opacity: 0; width: 0; height: 0; }
.sol-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; border-radius: 34px; border: 2px solid #000; }
.sol-slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 4px; bottom: 4px; background-color: white; transition: .4s; border-radius: 50%; border: 2px solid #000; }
.sol-switch input:checked + .sol-slider { background-color: #ffca3a; }
.sol-switch input:checked + .sol-slider:before { transform: translateX(28px); }

/* BẢNG TÍNH TAN (CSS GRID / TABLE) */
.sol-table-container { width: 100%; overflow-x: auto; overflow-y: auto; max-height: 600px; border: 3px solid #000; border-radius: 8px; box-shadow: 5px 5px 0px #000; background: #fff; }
.sol-table { width: 100%; border-collapse: separate; border-spacing: 0; text-align: center; }

/* Sticky Header & Left Column */
.sol-table th, .sol-table td { border-right: 2px solid #000; border-bottom: 2px solid #000; padding: 15px 10px; font-weight: 900; min-width: 65px; position: relative; transition: background-color 0.1s; cursor: crosshair;}
.sol-table thead th { position: sticky; top: 0; background: #cbaacb; z-index: 2; border-bottom: 3px solid #000; font-size: 1.2rem;}
.sol-table tbody th { position: sticky; left: 0; background: #b5ead7; z-index: 2; border-right: 3px solid #000; font-size: 1.2rem;}
.sol-table thead th:first-child { z-index: 3; left: 0; background: #ffdac1; } /* Góc trên trái */

.sol-table th sup, .sol-table th sub { font-weight: 900; font-size: 0.8rem; }
.sol-table td { font-family: 'Bungee', cursive; font-size: 1.2rem; }

/* CROSSHAIR HIGHLIGHT */
.crosshair-hl { filter: brightness(0.85); position: relative; }
.cell-hl { border: 3px solid #000 !important; transform: scale(1.1); z-index: 1; box-shadow: 4px 4px 0px rgba(0,0,0,0.5); }

/* FLOATING TOOLTIP BOX */
.sol-floating-box {
    position: fixed; z-index: 9999; pointer-events: none; background: #fff;
    border: 3px solid #000; border-radius: 8px; padding: 15px 20px;
    box-shadow: 6px 6px 0px #000; width: max-content; max-width: 300px;
    transform: translate(15px, 15px); transition: opacity 0.1s;
}
.sf-formula { font-family: monospace; font-size: 2.2rem; font-weight: 900; color: #ff595e; border-bottom: 2px dashed #000; padding-bottom: 5px; margin-bottom: 10px; }
.sf-name { font-weight: 900; font-size: 1.2rem; color: #333; margin-bottom: 5px; }
.sf-status { font-weight: 800; font-size: 1.05rem; padding: 5px 10px; border-radius: 6px; border: 2px solid #000; display: inline-block;}

@media (max-width: 800px) {
    .sol-controls { flex-direction: column; align-items: flex-start; }
    .sol-toggle-wrapper { width: 100%; justify-content: space-between; }
    .sol-floating-box { display: none !important; } /* Tắt tooltip nổi trên mobile để tránh che khuất */
}