/* Cahier de matériel - styles personnalisés */

.logo-input-hidden {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
}

.header-top {
    background-color: rgb(248 250 252);
    border-bottom: 1px solid rgb(226 232 240);
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.05);
}

.table-container {
    width: 100%;
}

@media (max-width: 1024px) {
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        overflow-y: visible;
    }
}

#materielTable {
    table-layout: fixed;
    width: 100%;
}

#materielTable th,
#materielTable td {
    box-sizing: border-box;
}

#materielTable thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: rgb(241 245 249);
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid rgb(226 232 240);
    box-shadow: 0 1px 0 0 rgb(226 232 240);
}

#materielTable tbody td {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    vertical-align: middle;
}

.table-container::-webkit-scrollbar {
    height: 6px;
}

.table-container::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.table-container::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 3px;
}

/* Bannières de notification : masquées hors écran par défaut, visibles avec .visible */
.notification-banner {
    visibility: hidden;
    transform: translateX(calc(100% + 1rem));
    transition: transform 0.3s, visibility 0s 0.3s; /* visibility caché après la sortie */
}

.notification-banner.visible {
    visibility: visible;
    transform: translateX(0);
    transition: transform 0.3s, visibility 0s 0s;
}

#notification {
    z-index: 50;
}

#errorNotification {
    z-index: 51;
}

body.body-pdf-viewer-open {
    padding-right: 50%;
}

.pdf-panel-resize-handle {
    width: 8px;
    cursor: col-resize;
    background: transparent;
    flex-shrink: 0;
    position: relative;
}
.pdf-panel-resize-handle:hover,
.pdf-panel-resize-handle:active {
    background: rgba(13, 148, 136, 0.15);
}
.pdf-panel-resize-handle::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 2px;
    height: 40px;
    border-radius: 1px;
    background: #94a3b8;
    opacity: 0.6;
}
.pdf-panel-resize-handle:hover::after {
    background: #0d9488;
    opacity: 1;
}

.drag-fiche-overlay {
    position: fixed;
    inset: 0;
    background: transparent;
    z-index: 45;
    pointer-events: none;
}

#materielBody tr.drag-fiche-target {
    background: #ccfbf1 !important;
    box-shadow: inset 0 0 0 2px #0d9488;
}

#materielBody tr.drag-fiche-target td,
#materielBody tr.drag-fiche-target input {
    color: #0f766e !important;
    font-weight: 600;
}

#materielBody tr.drag-fiche-target input::placeholder {
    color: #14b8a6;
}

.drag-fiche-overlay.hidden {
    display: none !important;
}

.drag-fiche-overlay:not(.hidden) {
    display: block;
}

.drag-fiche-banner {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #f0fdfa 0%, #ccfbf1 100%);
    border-bottom: 3px solid #0d9488;
    box-shadow: 0 4px 16px rgba(13, 148, 136, 0.2);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: #0f766e;
}

.drag-fiche-banner .ri-file-upload-line {
    color: #0d9488;
}

/* Popup d'aide */
.help-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: helpFadeIn 0.2s ease-out;
}

.help-overlay.hidden {
    display: none !important;
}

.help-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
}

.help-modal {
    position: relative;
    width: 100%;
    max-width: 480px;
    max-height: calc(100vh - 2rem);
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: helpSlideIn 0.25s ease-out;
}

.help-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, #f0fdfa 0%, #ccfbf1 100%);
    border-bottom: 1px solid #99f6e4;
}

.help-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f766e;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.help-title i {
    font-size: 1.5rem;
}

.help-close {
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 0.5rem;
    background: transparent;
    color: #0d9488;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.help-close:hover {
    background: rgba(13, 148, 136, 0.15);
    color: #0f766e;
}

.help-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.help-intro {
    margin: 0 0 1.25rem;
    color: #475569;
    font-size: 0.9375rem;
    line-height: 1.5;
}

.help-section {
    margin-bottom: 1.25rem;
}

.help-section:last-child {
    margin-bottom: 0;
}

.help-section-title {
    margin: 0 0 0.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #0d9488;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.help-list {
    margin: 0;
    padding-left: 1.25rem;
    color: #334155;
    font-size: 0.875rem;
    line-height: 1.6;
}

.help-list li {
    margin-bottom: 0.35rem;
}

.help-list li:last-child {
    margin-bottom: 0;
}

.help-credit-link {
    color: #0d9488;
    text-decoration: none;
    word-break: break-all;
}

.help-credit-link:hover {
    text-decoration: underline;
}

.help-footer {
    padding: 1rem 1.5rem 1.25rem;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

.help-footer-line {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
}

.help-footer-rule {
    flex: 1;
    height: 1px;
    background-color: #ccc;
}

.help-footer-logo {
    height: 36px;
    margin: 0;
    object-fit: contain;
}

.help-footer-text {
    font-size: 0.8125rem;
    color: #888;
    margin: 0.75rem 0 0;
    text-align: center;
}

@keyframes helpFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes helpSlideIn {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(-8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Dropdown bouton + (fiche) */
.fiche-add-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 2px;
    min-width: 220px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 50;
    padding: 4px 0;
}

.fiche-add-dropdown button {
    width: 100%;
    text-align: left;
    padding: 8px 12px;
    font-size: 13px;
    color: #334155;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.fiche-add-dropdown button:hover {
    background: #f1f5f9;
}

.fiche-link-form {
    padding: 8px 12px;
    border-top: 1px solid #e2e8f0;
}

.fiche-link-form input {
    width: 100%;
    padding: 6px 8px;
    font-size: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    margin-bottom: 6px;
}

.fiche-link-form input:focus {
    outline: none;
    border-color: #0d9488;
    ring: 2px #0d9488;
}

.fiche-link-form button {
    width: 100%;
    padding: 6px;
    font-size: 12px;
    background: #0d9488;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.fiche-link-form button:hover {
    background: #0f766e;
}

.fiche-link-form button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Tooltip personnalisé pour la source de la fiche technique */
#ficheSourceTooltip {
    position: fixed;
    z-index: 9999;
    padding: 0.5rem 0.75rem;
    max-width:  min(90vw, 420px);
    font-size: 0.875rem;
    line-height: 1.35;
    color: #fff;
    background: #0f766e;
    border-radius: 6px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease, transform 0.15s ease;
    transform: translateY(2px);
}
#ficheSourceTooltip.fiche-source-tooltip-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
