/* ── Groups shortcode wrapper ─────────────────────────────────────────────────
   All .vmi-table, .vmi-modal etc. styles come from the main plugin's
   frontend.css — this file only adds the group-level containers.
────────────────────────────────────────────────────────────────────────────── */

/* ── Filter bar ──────────────────────────────────────────────────────────────*/
.vmig-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
    background: #f9f6fd;
    border: 1px solid #ddd6f0;
    border-radius: 6px;
    padding: 16px 20px;
    margin-bottom: 30px;
}

.vmig-filter-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 180px;
}

.vmig-filter-field label {
    font-size: 12px;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.vmig-filter-field select {
    padding: 7px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    font-size: 14px;
    color: #333;
    min-width: 180px;
}

.vmig-filter-reset {
    align-self: flex-end;
    padding: 7px 16px !important;
    background: #fff !important;
    border-color: #8B6BA8 !important;
    color: #8B6BA8 !important;
}

.vmig-filter-reset:hover {
    background: #8B6BA8 !important;
    color: #fff !important;
}

.vmig-group-description {
    margin-bottom: 20px;
    padding: 14px 18px;
    color: #444;
    line-height: 1.7;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.vmig-group-description p:last-child {
    margin-bottom: 0;
}

/* ── Group blocks ─────────────────────────────────────────────────────────────*/
.vmig-group-block {
    margin-bottom: 40px;
}

.vmig-group-title {
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #8B6BA8;
    color: #333;
}

.vmig-group-form {
    margin-bottom: 30px;
}

.vmig-groups-output h3.vmig-form-title {
    margin-bottom: 4px;
    color: #333;
    font-size: 1.1em;
    font-weight: 700;
    font-style: italic;
    display: inline-block;
}

/* ── Responsive ──────────────────────────────────────────────────────────────*/
@media (max-width: 600px) {
    .vmig-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .vmig-filter-field,
    .vmig-filter-field select {
        min-width: 0;
        width: 100%;
    }
    .vmig-filter-reset {
        width: 100%;
    }
}

/* ── Table scroll improvements (all screen sizes, most useful on mobile) ─────*/

/* Smooth touch scrolling on iOS */
.vmi-table-wrapper {
    -webkit-overflow-scrolling: touch;
    overflow-x: auto;
    position: relative;
}

/* Fade shadow on right edge to signal scrollable content */
.vmig-scroll-container {
    position: relative;
}

.vmig-scroll-container::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 32px;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.85));
    pointer-events: none;
    border-radius: 0 4px 4px 0;
    transition: opacity 0.2s;
}

.vmig-scroll-container.vmig-scrolled-end::after {
    opacity: 0;
}

@media (max-width: 768px) {
    /* Tighten table cells */
    .vmi-table th,
    .vmi-table td {
        padding: 8px 10px;
        font-size: 13px;
        /* Prevent very long words breaking layout */
        word-break: break-word;
        overflow-wrap: break-word;
    }

    /* Keep table at natural width so columns don't get crushed */
    .vmi-table {
        min-width: 480px;
    }

    /* Hint text below scrollable tables */
    .vmig-scroll-hint {
        display: block;
        font-size: 11px;
        color: #999;
        text-align: right;
        margin-top: 4px;
        margin-bottom: 12px;
    }

    /* Modal fills screen on mobile */
    .vmi-modal-content {
        padding: 16px;
        width: 96%;
        max-height: 92vh;
        border-radius: 6px;
    }

    /* Stack form action buttons */
    .vmi-form-actions {
        flex-direction: column;
    }

    .vmi-form-actions button {
        width: 100%;
    }

    /* Full-width submit button */
    .vmi-open-form {
        width: 100%;
        text-align: center;
    }
}
