/* === Seajet Datasheets Manager — Frontend === */

/* Knoppen op productpagina */
.sjdm-product-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 16px 0;
}

.sjdm-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: 2px solid currentColor;
    border-radius: 4px;
    background: transparent;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sjdm-btn--msds { color: #d9534f; }
.sjdm-btn--msds:hover { background: #d9534f; color: #fff; }

.sjdm-btn--tds { color: #337ab7; }
.sjdm-btn--tds:hover { background: #337ab7; color: #fff; }

.sjdm-btn--certificate { color: #5cb85c; }
.sjdm-btn--certificate:hover { background: #5cb85c; color: #fff; }

/* Alle datasheets tabel */
.sjdm-all-datasheets { width: 100%; }

.sjdm-filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    align-items: center;
}

.sjdm-filter-input,
.sjdm-filter-select {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

.sjdm-filter-input { min-width: 220px; }

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

.sjdm-table th,
.sjdm-table td {
    padding: 10px 14px;
    border-bottom: 1px solid #e5e5e5;
    text-align: left;
}

.sjdm-table th {
    font-weight: 600;
    background: #f8f8f8;
}

.sjdm-table tr:hover td { background: #fafafa; }

.sjdm-type-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.sjdm-type-badge--msds        { background: #fde8e8; color: #c0392b; }
.sjdm-type-badge--tds         { background: #e8f0fe; color: #2c5fbb; }
.sjdm-type-badge--certificate { background: #e8f8e8; color: #2e7d32; }

/* Popup */
.sjdm-popup {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sjdm-popup[hidden] { display: none; }

.sjdm-popup__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    cursor: pointer;
}

.sjdm-popup__content {
    position: relative;
    background: #fff;
    border-radius: 6px;
    padding: 32px;
    width: 90%;
    max-width: 480px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
}

.sjdm-popup__close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    line-height: 1;
    padding: 0;
}

.sjdm-popup__close:hover { color: #000; }

.sjdm-popup__title {
    margin: 0 0 4px;
    font-size: 18px;
    padding-right: 24px;
}

.sjdm-popup__subtitle {
    margin: 0 0 20px;
    color: #666;
    font-size: 14px;
}

.sjdm-popup__languages {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
}

.sjdm-popup__language { margin: 0; }

.sjdm-popup__lang-btn {
    width: 100%;
    padding: 8px 12px;
    background: #f4f4f4;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
}

.sjdm-popup__lang-btn:hover { background: #337ab7; color: #fff; border-color: #337ab7; }
.sjdm-popup__lang-btn:disabled { opacity: 0.6; cursor: wait; }

@media (max-width: 600px) {
    .sjdm-popup__content { padding: 20px; }
    .sjdm-filters { flex-direction: column; }
    .sjdm-filter-input { min-width: 100%; }
}
