/**
 * WPGenTab Frontend Styles
 * Minimal CSS for table display on frontend
 */

.wpgentab-main-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1rem 0;
}

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

.wpgentab-main-table th,
.wpgentab-main-table td {
    border: 1px solid #e2e8f0;
    padding: 12px;
    text-align: left;
}

.wpgentab-main-table th {
    background-color: #f8fafc;
    font-weight: bold;
    color: #1e293b;
}

.wpgentab-main-table td {
    color: #475569;
}

.wpgentab-main-table tbody tr:hover {
    background-color: #f8fafc;
}

/* Button styles */
.btn-table {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    background: #2563eb;
    color: #fff;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-table:hover {
    background: #1d4ed8;
}

/* Link styles */
.wpgentab-main-table a {
    color: #fff!important;
    text-decoration: none;
}

.wpgentab-main-table a:hover {
    color: #fff;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .wpgentab-main-table th,
    .wpgentab-main-table td {
        padding: 8px;
        font-size: 13px;
    }
}

/* ============================================
   Rich Text Cell Styles
   ============================================ */

table .wpgentab-rich-text {
    padding: 4px 8px;
}

table .wpgentab-rich-text ul,
table .wpgentab-rich-text ol {
    margin: 0;
    padding-left: 20px;
}

table .wpgentab-rich-text li {
    margin: 4px 0;
}

table .wpgentab-rich-text a {
    color: #2563eb;
    text-decoration: underline;
}

table .wpgentab-rich-text strong {
    font-weight: bold;
}

table .wpgentab-rich-text em {
    font-style: italic;
}

table .wpgentab-rich-text u {
    text-decoration: underline;
}

table .wpgentab-rich-text p, .wpgentab-main-table table p {
    margin: 4px 0;
    font-size: inherit !important;
    text-align: inherit !important;
    line-height: 1.5 !important;
    font-weight: inherit !important;
}

table .wpgentab-rich-text blockquote {
    margin: 8px 0;
    padding-left: 12px;
    border-left: 3px solid #e2e8f0;
    color: #64748b;
}

table .wpgentab-rich-text code {
    background: #f1f5f9;
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 13px;
}

/* ============================================
   Edit Overlay Button Styles
   ============================================ */

.wpgentab-main-table {
    position: relative;
}

.wpgentab-edit-overlay {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2563eb;
    color: #fff;
    border-radius: 6px;
    text-decoration: none;
    opacity: 0;
    transform: translateY(-4px);
    transition: all 0.2s ease;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    padding: 0px 5px;
    width: max-content;
}

.wpgentab-edit-overlay:hover {
    background: #1d4ed8;
    transform: translateY(0);
    opacity: 1 !important;
}

.wpgentab-main-table:hover .wpgentab-edit-overlay {
    opacity: 0.8;
    transform: translateY(0);
}

.wpgentab-edit-overlay .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* Always show on touch devices */
@media (hover: none) {
    .wpgentab-edit-overlay {
        opacity: 1;
        transform: translateY(0);
    }
}
