/*
 * widget-pronunciationtable.css
 *
 * Styles for PronunciationTableWidget.
 * Dark mode (default) matches the existing dialog-managepronunciation styles exactly.
 * Light mode (.pt-widget-light) is used in the admin endpoint.
 */

/* *******************************************************
 * Widget container
 * ******************************************************* */

.pt-widget {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    gap: 8px;
}

/* *******************************************************
 * Utilize row
 * ******************************************************* */

.pt-utilize-row {
    flex-shrink: 0;
    margin-bottom: 4px;
}

.pt-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.88);
    cursor: pointer;
    user-select: none;
}

.pt-checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #2dd4bf;
}

/* *******************************************************
 * Table container
 * ******************************************************* */

.pt-table-container {
    flex: 1;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    min-height: 80px;
}

/* *******************************************************
 * Table
 * ******************************************************* */

.pt-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.pt-table thead {
    position: sticky;
    top: 0;
    background: #252535;
    z-index: 1;
}

.pt-table th {
    padding: 10px 12px;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.55);
    border-bottom: 2px solid rgba(255, 255, 255, 0.08);
}

.pt-table th:last-child {
    width: 36px;
    text-align: center;
}

.pt-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transition: background 0.15s ease;
}

.pt-table tbody tr:last-child {
    border-bottom: none;
}

.pt-table tbody tr:hover {
    background: #252535;
}

.pt-table td {
    padding: 6px 8px;
    vertical-align: middle;
}

.pt-table td:last-child {
    text-align: center;
    width: 36px;
}

/* *******************************************************
 * Cell inputs
 * ******************************************************* */

.pt-cell-input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 0.9rem;
    font-family: inherit;
    background: transparent;
    color: rgba(255, 255, 255, 0.9);
    transition: border-color 0.2s ease, background 0.2s ease;
    box-sizing: border-box;
}

.pt-cell-input::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

.pt-cell-input:focus {
    outline: none;
    border-color: rgba(45, 212, 191, 0.5);
    background: rgba(255, 255, 255, 0.07);
}

/* *******************************************************
 * Row delete button
 * ******************************************************* */

.pt-row-delete {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.3);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    transition: color 0.2s ease, background 0.2s ease;
    line-height: 1;
}

.pt-row-delete:hover {
    color: #ff8080;
    background: rgba(211, 47, 47, 0.25);
}

/* *******************************************************
 * Empty state
 * ******************************************************* */

.pt-empty {
    padding: 40px 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.95rem;
}

/* *******************************************************
 * Light mode overrides (.pt-widget-light)
 * ******************************************************* */

.pt-widget-light .pt-checkbox-label {
    color: #444;
}

.pt-widget-light .pt-table-container {
    border-color: #dde1ea;
    background: white;
}

.pt-widget-light .pt-utilize-row {
    margin-bottom: 12px;
}

.pt-widget-light .pt-table thead {
    background: #dde1ea;
}

.pt-widget-light .pt-table th {
    color: #555;
    border-bottom-color: #c5cad6;
}

.pt-widget-light .pt-table tbody tr {
    border-bottom-color: #f0f2f7;
    background: white;
}

.pt-widget-light .pt-table tbody tr:hover {
    background: #f5f6fc;
}

.pt-widget-light .pt-cell-input {
    color: #333;
    background: transparent;
}

.pt-widget-light .pt-cell-input::placeholder {
    color: #aaa;
}

.pt-widget-light .pt-cell-input:focus {
    border-color: rgba(102, 126, 234, 0.5);
    background: rgba(102, 126, 234, 0.04);
}

.pt-widget-light .pt-row-delete {
    color: #bbb;
}

.pt-widget-light .pt-row-delete:hover {
    color: #d32f2f;
    background: rgba(211, 47, 47, 0.1);
}

.pt-widget-light .pt-empty {
    color: #aaa;
}

