body {
    font-family: Arial, sans-serif;
    background: #fafafa;
    padding: 20px;
}

.container {
    width: 90%;
    margin: auto;
}

textarea {
    width: 100%;
    height: 120px;
    margin-top: 10px;
}

.input-section, .output-section {
    margin-bottom: 40px;
}

.output-block {
    background: white;
    padding: 15px;
    border: 1px solid #ccc;
    margin-top: 15px;
    min-height: 50px;
}

#dedicated_output {
    width: 100%;
    height: 120px;
    background: #eef;
}

.components-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.components-table th,
.components-table td {
    border: 1px solid #ccc;
    padding: 6px 8px;
    text-align: left;
}

.components-table th {
    background-color: #f0f0f0;
}

.components-table button {
    padding: 4px 8px;
    cursor: pointer;
}

.choice-table {
    border-collapse: collapse;
    width: 100%;
    margin-top: 10px;
}

.choice-table th,
.choice-table td {
    border: 1px solid #ccc;
    padding: 6px 8px;
    text-align: center;
}

.choice-table th {
    background: #f0f0f0;
}

.ref-button {
    padding: 4px 8px;
    cursor: pointer;
}

.component-table {
    border-collapse: collapse;
    width: 100%;
    margin-top: 10px;
}

.component-table th,
.component-table td {
    border: 1px solid #ccc;
    padding: 6px 8px;
    text-align: center;
}

.component-table th {
    background: #f0f0f0;
}

.btn-add-component {
    padding: 4px 10px;
    cursor: pointer;
}

/* Contrôles de liste */
.list-controls {
    margin: 15px 0;
    display: flex;
    gap: 10px;
    align-items: center;
}

.list-controls-top {
    margin-bottom: 15px;
}

.list-controls-bottom {
    margin-top: 15px;
}

/* ⭐ BOUTONS CONTROL (Display List, Undo, Redo, Hide List, More, Less) */
.btn-control {
    color: black;
    background-color: #ddd;
    border: none;
    cursor: pointer;
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 6px;
    text-align: center;
    font-size: 15px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.btn-control:hover:not([disabled]) {
    background-color: #bbb;
}

.btn-control:active:not([disabled]) {
    background-color: #666;
    color: white;
}

.btn-control:disabled {
    background-color: #eee;
    color: #aaa;
    cursor: not-allowed;
}

#btn-rollback, #btn-rollforward {
    font-size: 25px;
    padding: 3px 10px;
}

.display-info {
    color: #666;
    font-size: 14px;
    margin-left: auto;
}

/* Messages d'erreur */
.error-message {
    background-color: #fee;
    border-left: 4px solid #c33;
    padding: 15px;
    margin: 10px 0;
    border-radius: 4px;
}

.error-message strong {
    color: #c33;
    display: block;
    margin-bottom: 8px;
}

.error-content {
    margin: 0;
    color: #333;
    white-space: pre-wrap;
}

.error-content b {
    font-weight: bold;
}

/* Messages informatifs */
.info-message {
    background-color: #e8f4fd;
    border-left: 4px solid #2196F3;
    padding: 15px;
    margin: 10px 0;
    border-radius: 4px;
}

.info-content {
    margin: 0;
    color: #333;
    white-space: pre-wrap;
}

/* ═══════════════════════════════════════════
   ACTION BUTTONS (Add / Replace)
   ═══════════════════════════════════════════ */

.action-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
}

.btn-add-component,
.btn-create-component {
    border: 1px solid #999;
    padding: 5px 12px;
    border-radius: 2px;
    cursor: pointer;
    font-size: 12px;
    font-weight: normal;
    transition: border-color 0.15s ease, color 0.15s ease;
    background-color: white;
    color: #555;
}

.btn-add-component:hover:not([disabled]) {
    border-color: #333;
    color: #333;
}

.btn-create-component:hover:not([disabled]) {
    border-color: #333;
    color: #333;
}

.btn-add-component:disabled,
.btn-create-component:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #ddd;
    color: #aaa;
}

/* ═══════════════════════════════════════════
   BOUTONS OUTPUT (2D ray tracing, 3D ray tracing, Spot diagram)
   ═══════════════════════════════════════════ */

.output-buttons-container {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin: 10px 0;
    width: 100%;
}

.btn-output {
    color: white;
    background-color: rgb(0, 153, 153);
    border: none;
    cursor: pointer;
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 6px;
    text-align: center;
    font-size: 15px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.btn-output:hover {
    background-color: #5fda89;
}

/* ═══════════════════════════════════════════
   MENU DÉROULANT "OTHER DATA"
   ═══════════════════════════════════════════ */

.dropdown-container {
    position: relative;
    display: inline-block;
}

.btn-dropdown {
    color: white;
    background-color: rgb(0, 153, 153);
    border: none;
    cursor: pointer;
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 6px;
    text-align: center;
    font-size: 15px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.btn-dropdown:hover {
    background-color: #5fda89;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 200px;
    overflow: hidden;
}

.dropdown-menu.open {
    display: block;
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 10px 16px;
    background: white;
    border: none;
    text-align: left;
    font-size: 14px;
    font-weight: 400;
    color: #333;
    cursor: pointer;
    transition: background-color 0.15s ease;
    box-sizing: border-box;
}

.dropdown-item:hover {
    background-color: rgb(0, 153, 153);
    color: white;
}

.dropdown-item:not(:last-child) {
    border-bottom: 1px solid #eee;
}

/* ═══════════════════════════════════════════════════════════
   MENU OUTPUT - 2 NIVEAUX
   ═══════════════════════════════════════════════════════════ */

/* Conteneur d'un groupe (titre + sous-items) */
.output-group {
    border-bottom: 1px solid #ddd;
}

.output-group:last-child {
    border-bottom: none;
}

/* Titre de groupe (niveau 1) : fond coloré, gras */
.output-group-title {
    background-color: #e8f5f5;
    color: #006666;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    padding: 10px 16px;
    border-bottom: none !important; /* écrase la règle dropdown-item */
}

.output-group-title:hover {
    background-color: rgb(0, 153, 153);
    color: white;
}

/* Conteneur des sous-items */
.output-subgroup {
    background-color: #f9f9f9;
    border-top: 1px solid #e0e0e0;
}

/* Sous-items (niveau 2) : indentés, plus petits */
.dropdown-subitem {
    padding: 8px 16px 8px 28px;  /* indentation à gauche */
    font-size: 13px;
    color: #444;
    background-color: #f9f9f9;
    border-bottom: 1px solid #f0f0f0 !important;
}

.dropdown-subitem:last-child {
    border-bottom: none !important;
}

.dropdown-subitem:hover {
    background-color: rgb(0, 153, 153);
    color: white;
}

/* Le menu Output s'ouvre vers la gauche (évite débordement) */
#output-menu {
    left: auto;
    right: 0;
    max-height: 420px;
    overflow-y: auto;
}


.dropdown-subitem-row {
    display: flex;
    align-items: center;
}
.dropdown-subitem-row .dropdown-item.dropdown-subitem {
    flex: 1;
}
.dropdown-subitem-tuto {
    display: inline-block;
    margin-left: 4px;
    margin-right: 6px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 600;
    color: #007bff;
    background: #e8f0fe;
    border: 1px solid #c0d4f5;
    border-radius: 3px;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.4;
    cursor: pointer;
}
.dropdown-subitem-tuto:hover {
    background: #007bff;
    color: white;
    border-color: #007bff;
    text-decoration: none;
}

@keyframes calcSpin {
    0%   { transform: rotate(0deg);   }
    100% { transform: rotate(360deg); }
}


.choice-header h3.choice-header-compact {
    font-size: 1.4em;
    font-weight: 500;
    line-height: 1.45;
    margin: 0;
}






