/**
 * Elementor Form Viewz - Frontend Table Styles
 * All rules are scoped to .efv-wrapper to avoid conflicts with themes & other plugins.
 * Bootstrap 5 classes are used for layout; only custom overrides are here.
 */

/* ──────────────────────────────────────────────
   Wrapper isolation
   ────────────────────────────────────────────── */
.efv-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #212529;
    box-sizing: border-box;
}

.efv-wrapper *,
.efv-wrapper *::before,
.efv-wrapper *::after {
    box-sizing: border-box;
}

/* ──────────────────────────────────────────────
   Toolbar
   ────────────────────────────────────────────── */
.efv-toolbar {
    padding: 10px 0;
}

.efv-count-badge {
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 20px;
}

.efv-form-badge {
    font-size: 12px;
    padding: 5px 10px;
    border-radius: 20px;
}

/* ──────────────────────────────────────────────
   Table
   ────────────────────────────────────────────── */
.efv-datatable {
    border-collapse: collapse !important;
    width: 100% !important;
}

.efv-datatable thead th {
    white-space: nowrap;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.3px;
    vertical-align: middle;
}

.efv-datatable tbody tr {
    transition: background-color 0.15s ease;
}

.efv-datatable tbody tr:hover {
    background-color: #f0f4ff !important;
}

.efv-datatable tbody td {
    vertical-align: middle;
    font-size: 13.5px;
    padding: 10px 12px;
}

.efv-td-index {
    color: #adb5bd;
    font-size: 12px;
    font-weight: 600;
}

.efv-td-date {
    white-space: nowrap;
    color: #495057;
}

/* ──────────────────────────────────────────────
   Attachment links
   ────────────────────────────────────────────── */
.efv-attachment-link {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    transition: opacity 0.2s;
}

.efv-attachment-link:hover {
    opacity: 0.85;
    text-decoration: none;
}

/* ──────────────────────────────────────────────
   Empty state
   ────────────────────────────────────────────── */
.efv-empty-state {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 40px 20px;
}

/* ──────────────────────────────────────────────
   Login Notice
   ────────────────────────────────────────────── */
.efv-login-notice {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: #fff8f0;
    border: 1px solid #ffd591;
    border-radius: 8px;
    text-align: center;
}

.efv-login-notice .efv-login-icon {
    font-size: 48px;
    color: #f0a500;
    margin-bottom: 16px;
}

.efv-login-notice h3 {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 600;
}

.efv-login-notice p {
    margin: 0 0 20px;
    color: #666;
}

.efv-login-notice .efv-login-btn {
    display: inline-block;
    padding: 10px 24px;
    background: #4f46e5;
    color: #fff;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s;
}

.efv-login-notice .efv-login-btn:hover {
    background: #4338ca;
    color: #fff;
    text-decoration: none;
}

/* ──────────────────────────────────────────────
   DataTables overrides (scoped)
   ────────────────────────────────────────────── */
.efv-wrapper .dataTables_wrapper .dataTables_filter input {
    border: 1px solid #ced4da;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.efv-wrapper .dataTables_wrapper .dataTables_filter input:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79,70,229,.15);
}

.efv-wrapper .dataTables_wrapper .dataTables_length select {
    border: 1px solid #ced4da;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 13px;
}

.efv-wrapper .dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 4px !important;
    padding: 4px 10px !important;
    font-size: 13px;
}

.efv-wrapper .dataTables_wrapper .dataTables_paginate .paginate_button.current,
.efv-wrapper .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: #4f46e5 !important;
    border-color: #4f46e5 !important;
    color: #fff !important;
}

.efv-wrapper .dataTables_wrapper .dataTables_info {
    font-size: 12px;
    color: #6c757d;
    padding-top: 12px;
}

/* ──────────────────────────────────────────────
   Theme variants (data-table-theme attribute)
   ────────────────────────────────────────────── */
[data-efv-theme="blue"]  .efv-datatable thead { background-color: #0d6efd !important; }
[data-efv-theme="green"] .efv-datatable thead { background-color: #198754 !important; }
[data-efv-theme="purple"].efv-datatable thead { background-color: #6f42c1 !important; }
[data-efv-theme="orange"].efv-datatable thead { background-color: #fd7e14 !important; }

/* ──────────────────────────────────────────────
   Responsive tweaks
   ────────────────────────────────────────────── */
@media (max-width: 768px) {
    .efv-datatable thead th,
    .efv-datatable tbody td {
        font-size: 12px;
        padding: 8px 8px;
    }

    .efv-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .efv-attachment-link {
        font-size: 11px;
    }
}

/* ──────────────────────────────────────────────
   Notice (Bootstrap alert override — scoped)
   ────────────────────────────────────────────── */
.efv-notice.alert--danger  { background:#fff0f0; border-left:4px solid #dc3545; color:#842029; padding:14px 16px; border-radius:6px; }
.efv-notice.alert--warning { background:#fff8e1; border-left:4px solid #f0a500; color:#6b4d00; padding:14px 16px; border-radius:6px; }
.efv-notice.alert--info    { background:#e8f4fd; border-left:4px solid #0dcaf0; color:#0a4b6e; padding:14px 16px; border-radius:6px; }
.efv-notice.alert--success { background:#f0faf4; border-left:4px solid #198754; color:#0d4a28; padding:14px 16px; border-radius:6px; }

/* ──────────────────────────────────────────────
   Export button
   ────────────────────────────────────────────── */
.efv-csv-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

/* ──────────────────────────────────────────────
   DataTables Buttons (scoped)
   ────────────────────────────────────────────── */
.efv-wrapper .dt-buttons {
    display: none; /* Hidden; triggered by our custom button */
}
