/* OD Tables - Front-end and Editor Styles */

/* Wrapper */
.od-table-wrapper {
    margin: 1.5rem 0;
    overflow: visible;
}

.od-table-wrapper.od-table-responsive-scroll {
    overflow-x: auto;
}

/* Controls (Search) */
.od-table-controls {
    margin-bottom: 1rem;
}

.od-table-search {
    width: 100%;
    max-width: 300px;
    padding: 8px 12px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    font-size: 14px;
    background: transparent;
    color: inherit;
}

.od-table-search:focus {
    outline: none;
    border-color: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
}

/* Table Base */
.od-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    background: transparent;
    color: inherit;
}

/* Table Headers */
.od-table th {
    font-weight: 600;
    background: rgba(0, 0, 0, 0.05);
    padding: 10px 12px;
    color: inherit;
}

.od-table td {
    padding: 10px 12px;
    color: inherit;
}

/* Borders */
.od-table-borders th,
.od-table-borders td {
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.od-table-borders thead th {
    border-bottom: 2px solid rgba(0, 0, 0, 0.15);
}

/* Striped Rows */
.od-table-striped tbody tr:nth-child(odd) {
    background-color: rgba(0, 0, 0, 0.03);
}

/* Compact Layout */
.od-table-compact th,
.od-table-compact td {
    padding: 4px 8px;
    font-size: 0.9rem;
}

/* Column Alignment */
.od-table-col-align-left {
    text-align: left;
}

.od-table-col-align-center {
    text-align: center;
}

.od-table-col-align-right {
    text-align: right;
}

/* Sortable Headers */
th[data-od-sortable="true"] {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 24px;
}

th[data-od-sortable="true"]:hover {
    background: rgba(0, 0, 0, 0.08);
}

th[data-od-sortable="true"]::after {
    content: "⇅";
    position: absolute;
    right: 8px;
    opacity: 0.3;
    font-size: 12px;
}

th.od-sort-asc::after {
    content: "↑";
    opacity: 1;
    color: currentColor;
}

th.od-sort-desc::after {
    content: "↓";
    opacity: 1;
    color: currentColor;
}

/* Caption */
.od-table caption {
    caption-side: top;
    text-align: left;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 1.1rem;
    color: inherit;
}

/* Responsive Mobile Tweaks */
@media (max-width: 640px) {
    .od-table-wrapper {
        font-size: 0.85rem;
    }
    
    .od-table th,
    .od-table td {
        padding: 6px 8px;
    }
    
    .od-table-compact th,
    .od-table-compact td {
        padding: 3px 5px;
    }
}

/* Editor Specific Styles */
.od-table-editor {
    border: 1px solid #ddd;
    padding: 15px;
    border-radius: 4px;
    background: #fafafa;
}

.od-table-editor table {
    margin-bottom: 10px;
}

.od-table-editor input[type="text"] {
    font-family: inherit;
    font-size: inherit;
}

.od-table-editor input[type="text"]:focus {
    outline: 1px solid #007cba;
    background: #f0f8ff;
}

/* Alignment Classes for Block Editor */
.alignwide .od-table-wrapper,
.alignfull .od-table-wrapper {
    max-width: 100%;
}
