/*
 * EFSM Default Styles
 *
 * THIS FILE IS A TEMPLATE - DO NOT EDIT DIRECTLY
 *
 * This file is the source template for EFSM styling.
 * It gets copied to static/css/efsm-table-default.css by generate-elm.sh
 * on first run (if not already present).
 *
 * To modify styles:
 *   1. Edit this template: tools/coq/templates/efsm-table-default.css
 *   2. Delete static/css/efsm-table-default.css
 *   3. Re-run: ./scripts/efsm/generate-elm.sh <package> <app>
 *
 * To customize styles per-installation (without modifying template):
 *   Create static/css/efsm-table-custom.css with your overrides.
 *   CSS cascade means custom.css rules take precedence.
 */

/* ===== Plugin Container ===== */

[class$="-plugin"] {
    padding: 1em 1.5em;
}

/* ===== State Heading ===== */

.efsm-state-heading {
    font-size: 1.4em;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 0.75em 0;
    padding-bottom: 0.4em;
    border-bottom: 2px solid #e1e5e9;
}

/* ===== Accordion ===== */

.efsm-accordion {
    display: flex;
    flex-direction: column;
    gap: 0.4em;
}

.efsm-accordion-item {
    border: 1px solid #e1e5e9;
    border-radius: 4px;
    overflow: hidden;
}

.efsm-accordion-summary {
    padding: 0.6em 1em;
    font-weight: 600;
    color: #2c3e50;
    cursor: pointer;
    background: #f8fafc;
    transition: background 0.15s;
    list-style: none;
}

.efsm-accordion-summary::-webkit-details-marker {
    display: none;
}

.efsm-accordion-summary::before {
    content: "▶";
    display: inline-block;
    margin-right: 0.5em;
    font-size: 0.7em;
    transition: transform 0.15s;
}

.efsm-accordion-item[open] > .efsm-accordion-summary::before {
    transform: rotate(90deg);
}

.efsm-accordion-summary:hover {
    background: #eef2f7;
}

.efsm-accordion-summary:focus-visible {
    outline: 2px solid #3498db;
    outline-offset: -2px;
}

.efsm-accordion-content {
    padding: 0.8em 1em;
    border-top: 1px solid #e1e5e9;
}

/* ===== Button Section ===== */

.button-section {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em;
    margin-bottom: 1em;
}

.button-section button {
    background: #3498db;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    padding: 0.5em 1em;
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.15s;
}

.button-section button:hover {
    background: #2980b9;
}

/* ===== Tables ===== */

.efsm-table {
    border-collapse: collapse;
    width: 100%;
    font-size: 14px;
}

.efsm-table-header {
    background: #2c3e50;
    color: #ffffff;
}

.efsm-table-header th {
    padding: 0.75em 1em;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #1a252f;
}

.efsm-table-body .efsm-table-row:nth-child(odd) {
    background: #ffffff;
}

.efsm-table-body .efsm-table-row:nth-child(even) {
    background: #f8fafc;
}

.efsm-table-row td {
    padding: 0.5em 1em;
    border-bottom: 1px solid #e1e5e9;
    vertical-align: top;
}

.efsm-table-btn {
    background: #3498db;
    color: #ffffff;
    border: none;
    border-radius: 3px;
    padding: 0.4em 0.8em;
    cursor: pointer;
    font-size: 0.9em;
}

.efsm-table-btn:hover {
    background: #2980b9;
}

.efsm-table-empty {
    text-align: center;
    padding: 2em;
    color: #666;
    font-style: italic;
}

.efsm-table-cell-tree {
    padding-left: 1em;
}

.efsm-table-cell-tree summary {
    color: #666;
    font-family: monospace;
    cursor: pointer;
}

.efsm-table-cell-tree[open] > summary {
    margin-bottom: 0.5em;
}

/* ===== Table Scroll Container ===== */

/* Container divs (e.g., .orders-items) become scroll containers */
[class$="-items"] {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ===== Sticky Actions Column ===== */

.efsm-table-header th:last-child,
.efsm-table-row td:last-child {
    position: sticky;
    right: 0;
    z-index: 1;
    box-shadow: -2px 0 4px rgba(0, 0, 0, 0.08);
}

.efsm-table-header th:last-child {
    background: #2c3e50;
}

.efsm-table-row:nth-child(odd) td:last-child {
    background: #ffffff;
}

.efsm-table-row:nth-child(even) td:last-child {
    background: #f8fafc;
}

/* ===== Error Overlay ===== */

.efsm-error-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(128, 128, 128, 0.5);
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.efsm-error-card {
    background: #ffffff;
    border-radius: 8px;
    padding: 2em 2.5em;
    max-width: 500px;
    width: 90%;
    border-top: 4px solid #e74c3c;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.efsm-error-title {
    font-size: 1.2em;
    font-weight: 700;
    color: #e74c3c;
    margin-bottom: 0.75em;
}

.efsm-error-message {
    color: #333;
    line-height: 1.5;
    margin-bottom: 1.5em;
}

.efsm-error-dismiss {
    background: #3498db;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    padding: 0.6em 1.5em;
    cursor: pointer;
    font-size: 0.95em;
    transition: background 0.15s;
}

.efsm-error-dismiss:hover {
    background: #2980b9;
}
