/* ═══════════════════════════════════════════════════
   Practice Tables Frontend v4.1.0
   Polished DataTables-style with status stamps & YT buttons
   ═══════════════════════════════════════════════════ */

/* ── Reset & Base ─────────────────────────────── */
.vpt-wrapper,
.vpt-cards-section {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    color: #2c3e50;
    line-height: 1.5;
    margin: 30px 0;
    -webkit-font-smoothing: antialiased;
}

.vpt-wrapper *,
.vpt-cards-section * {
    box-sizing: border-box;
}

/* ── Title ────────────────────────────────────── */
.vpt-header {
    text-align: center;
    margin-bottom: 24px;
}

.vpt-title {
    font-size: clamp(24px, 4vw, 38px);
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 4px;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.vpt-subtitle {
    font-size: 16px;
    color: #718096;
    margin: 0;
}

/* ── Toolbar (DataTables-style) ──────────────── */
.vpt-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 14px;
    color: #4a5568;
}

.vpt-toolbar-left {
    display: flex;
    align-items: center;
    gap: 6px;
}

.vpt-toolbar-text {
    white-space: nowrap;
}

.vpt-per-page-select {
    padding: 5px 8px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    font-size: 14px;
    color: #2d3748;
    background: #fff;
    cursor: pointer;
}

.vpt-per-page-select:focus {
    border-color: var(--vpt-primary, #1B2A4A);
    outline: none;
    box-shadow: 0 0 0 2px rgba(27,42,74,0.15);
}

.vpt-search-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    white-space: nowrap;
}

.vpt-search-input {
    padding: 6px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    font-size: 14px;
    width: 200px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.vpt-search-input:focus {
    border-color: var(--vpt-primary, #1B2A4A);
    outline: none;
    box-shadow: 0 0 0 2px rgba(27,42,74,0.15);
}

/* ── Table ────────────────────────────────────── */
.vpt-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
}

.vpt-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 600px;
}

/* Header */
.vpt-table thead th {
    background: var(--vpt-primary, #1B2A4A);
    color: #fff;
    padding: 13px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.025em;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    border-right: 1px solid rgba(255,255,255,0.12);
    position: relative;
    transition: background 0.15s;
}

.vpt-table thead th:last-child {
    border-right: none;
}

.vpt-table thead th:hover {
    background: var(--vpt-primary-dark, #131f38);
}

.vpt-sort-arrows {
    opacity: 0.45;
    font-size: 11px;
    margin-left: 3px;
}

.vpt-table thead th.sort-asc .vpt-sort-arrows { opacity: 1; }
.vpt-table thead th.sort-asc .vpt-sort-arrows::before { content: '▲'; }
.vpt-table thead th.sort-asc .vpt-sort-arrows { font-size: 0; }
.vpt-table thead th.sort-asc::after { content: ' ▲'; font-size: 10px; opacity: 1; }
.vpt-table thead th.sort-desc::after { content: ' ▼'; font-size: 10px; opacity: 1; }
.vpt-table thead th.sort-asc .vpt-sort-arrows,
.vpt-table thead th.sort-desc .vpt-sort-arrows { display: none; }

/* Body */
.vpt-table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid #edf2f7;
    color: #2d3748;
    vertical-align: middle;
    line-height: 1.45;
}

.vpt-table tbody tr:hover td {
    background: #f7fafc;
}

.vpt-table tbody tr:nth-child(even) td {
    background: #fafbfc;
}

.vpt-table tbody tr:nth-child(even):hover td {
    background: #edf2f7;
}

/* ── Status Stamp ─────────────────────────────── */
.vpt-status-stamp {
    display: block;
    max-width: 90px;
    max-height: 50px;
    width: auto;
    height: auto;
    object-fit: contain;
    margin: 0 auto;
}

/* ── YouTube Button ───────────────────────────── */
.vpt-yt-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #FF0000;
    transition: transform 0.15s, opacity 0.15s;
    text-decoration: none;
    line-height: 1;
}

.vpt-yt-btn:hover {
    transform: scale(1.15);
    opacity: 0.85;
}

.vpt-yt-btn svg {
    display: block;
}

/* ── Floor Plan Thumbnail ────────────────────── */
.vpt-floorplan-thumb {
    display: block;
    max-width: 120px;
    max-height: 80px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    transition: transform 0.15s, box-shadow 0.15s;
}

.vpt-floorplan-thumb:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

/* ── Info Link ────────────────────────────────── */
.vpt-info-link {
    display: inline-block;
    padding: 4px 12px;
    background: var(--vpt-primary, #1B2A4A);
    color: #fff !important;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    transition: background 0.15s, transform 0.1s;
    white-space: nowrap;
}

.vpt-info-link:hover {
    background: var(--vpt-primary-dark, #131f38);
    transform: translateY(-1px);
    color: #fff !important;
}

/* ── Footer ───────────────────────────────────── */
.vpt-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 14px;
    font-size: 14px;
    color: #718096;
}

.vpt-showing {
    white-space: nowrap;
}

/* ── Pagination ───────────────────────────────── */
.vpt-pagination {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.vpt-pagination button {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    background: #fff;
    color: #2d3748;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.vpt-pagination button:hover:not(:disabled):not(.active) {
    background: #edf2f7;
    border-color: #a0aec0;
}

.vpt-pagination button.active {
    background: var(--vpt-primary, #1B2A4A);
    color: #fff;
    border-color: var(--vpt-primary, #1B2A4A);
    font-weight: 700;
}

.vpt-pagination button:disabled {
    opacity: 0.35;
    cursor: default;
}

.vpt-pagination .vpt-page-ellipsis {
    padding: 0 4px;
    color: #a0aec0;
}

/* ═══════════════════════════════════════════════════
   CARDS VIEW
   ═══════════════════════════════════════════════════ */

.vpt-cards-title {
    font-size: clamp(24px, 4vw, 34px);
    text-align: center;
    margin-bottom: 28px;
    color: #1a1a2e;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.vpt-cards-grid {
    display: grid;
    gap: 24px;
}
.vpt-cols-2 { grid-template-columns: repeat(2, 1fr); }
.vpt-cols-3 { grid-template-columns: repeat(3, 1fr); }
.vpt-cols-4 { grid-template-columns: repeat(4, 1fr); }

.vpt-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.vpt-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
}

.vpt-card-stamp {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
}

.vpt-card-stamp img {
    width: 70px;
    height: auto;
    object-fit: contain;
}

.vpt-card-body {
    padding: 22px 20px 16px;
    flex: 1;
}

.vpt-card-title {
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 6px;
    color: #1a1a2e;
    line-height: 1.3;
    padding-right: 60px;
}

.vpt-card-location {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #718096;
    font-size: 14px;
    margin: 0 0 14px;
}

.vpt-card-location svg {
    flex-shrink: 0;
    color: var(--vpt-primary, #1B2A4A);
}

.vpt-card-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.vpt-card-detail {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.vpt-card-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #a0aec0;
    font-weight: 600;
}

.vpt-card-value {
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
}

.vpt-card-cta {
    display: block;
    text-align: center;
    padding: 13px 16px;
    background: var(--vpt-primary, #1B2A4A);
    color: #fff !important;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.02em;
    transition: background 0.2s;
}

.vpt-card-cta:hover {
    background: var(--vpt-primary-dark, #131f38);
    color: #fff !important;
}

.vpt-cards-footer {
    text-align: center;
    margin-top: 30px;
}

.vpt-btn-cta {
    display: inline-block;
    padding: 14px 36px;
    background: var(--vpt-primary, #1B2A4A);
    color: #fff !important;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0.02em;
    transition: background 0.2s, transform 0.15s;
}

.vpt-btn-cta:hover {
    background: var(--vpt-primary-dark, #131f38);
    transform: translateY(-2px);
    color: #fff !important;
}

/* ═══════════════════════════════════════════════════
   MOBILE — Card-style rows
   ═══════════════════════════════════════════════════ */

@media (max-width: 768px) {

    .vpt-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .vpt-toolbar-left,
    .vpt-toolbar-right {
        width: 100%;
    }

    .vpt-search-input {
        width: 100%;
    }

    .vpt-footer {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    /* Hide the default table, show as cards */
    .vpt-table-scroll {
        border: none;
        border-radius: 0;
        overflow: visible;
    }

    .vpt-table {
        min-width: 0;
    }

    .vpt-table thead {
        display: none;
    }

    .vpt-table tbody tr {
        display: block;
        background: #fff;
        border: 1px solid #e2e8f0;
        border-radius: 10px;
        margin-bottom: 14px;
        padding: 16px;
        box-shadow: 0 1px 4px rgba(0,0,0,0.04);
        position: relative;
    }

    .vpt-table tbody tr:hover {
        box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    }

    .vpt-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 6px 0;
        border-bottom: 1px solid #f1f5f9;
        background: transparent !important;
    }

    .vpt-table tbody td:last-child {
        border-bottom: none;
    }

    .vpt-table tbody td::before {
        content: attr(data-label);
        font-weight: 700;
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: #718096;
        flex-shrink: 0;
        margin-right: 12px;
        max-width: 40%;
    }

    /* Status stamp in mobile */
    .vpt-status-stamp {
        max-width: 70px;
        max-height: 40px;
    }

    /* Cards grid */
    .vpt-cols-2,
    .vpt-cols-3,
    .vpt-cols-4 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .vpt-title {
        font-size: 22px;
    }

    .vpt-table tbody tr {
        padding: 12px;
    }

    .vpt-table tbody td {
        font-size: 13px;
    }

    .vpt-pagination button {
        min-width: 32px;
        height: 32px;
        font-size: 12px;
    }
}

/* ── Tablet: 2 cols max for cards ─────────────── */
@media (min-width: 769px) and (max-width: 1024px) {
    .vpt-cols-4 { grid-template-columns: repeat(2, 1fr); }
    .vpt-cols-3 { grid-template-columns: repeat(2, 1fr); }
}

/* ── Accessibility ────────────────────────────── */
.vpt-table thead th:focus-visible,
.vpt-pagination button:focus-visible,
.vpt-search-input:focus-visible,
.vpt-yt-btn:focus-visible,
.vpt-info-link:focus-visible {
    outline: 2px solid var(--vpt-primary, #1B2A4A);
    outline-offset: 2px;
}

/* ── Print ────────────────────────────────────── */
@media print {
    .vpt-toolbar,
    .vpt-pagination,
    .vpt-footer {
        display: none !important;
    }
    .vpt-table-scroll {
        overflow: visible;
    }
    .vpt-table {
        min-width: 0;
        font-size: 11px;
    }
    .vpt-status-stamp {
        max-width: 50px;
    }
}

.vpt-table { table-layout: fixed; }
.vpt-table thead th { white-space: normal; }