/**
 * FC Academy Registration Table Styles
 * Responsive Data Table with Card Layout for Mobile
 */

/* ==========================================================================
   Table Container
   ========================================================================== */

.fc-registration-table-container {
    width: 100%;
    max-width: 100%;
}

.fc-registration-table-wrapper {
    width: 100%;
    overflow-x: scroll !important;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 10px;
    display: block;
    position: relative;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

/* ==========================================================================
   Search & Filters
   ========================================================================== */

.fc-table-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    align-items: center;
    justify-content: space-between;
}

.fc-table-search {
    position: relative;
    flex: 1;
    min-width: 200px;
    max-width: 350px;
}

.fc-table-search input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.fc-table-search input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.fc-table-search::before {
    content: "\1F50D";
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    opacity: 0.5;
}

.fc-table-info {
    font-size: 13px;
    color: #666;
}

/* ==========================================================================
   Main Table - Desktop
   ========================================================================== */

.fc-registration-table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    font-size: 14px;
    background: #fff;
    table-layout: auto;
}

.fc-registration-table th,
.fc-registration-table td {
    vertical-align: middle;
    text-align: left;
    white-space: nowrap;
    padding: 12px 15px;
}

.fc-registration-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.fc-registration-table thead th {
    font-weight: 600;
    white-space: nowrap;
    position: relative;
}

.fc-registration-table tbody tr {
    transition: background-color 0.15s ease;
}

/* ==========================================================================
   Status Badges
   ========================================================================== */

.fc-status-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fc-status-badge.status-completed,
.fc-status-badge.status-processing {
    background-color: #28a745;
}

.fc-status-badge.status-pending,
.fc-status-badge.status-on-hold {
    background-color: #ffc107;
    color: #333;
}

.fc-status-badge.status-cancelled,
.fc-status-badge.status-failed,
.fc-status-badge.status-refunded {
    background-color: #dc3545;
}

/* ==========================================================================
   Type Badges
   ========================================================================== */

.fc-type-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    background-color: #e9ecef;
    color: #495057;
}

.fc-type-badge.type-academy {
    background-color: #d4edda;
    color: #155724;
}

.fc-type-badge.type-camp {
    background-color: #fff3cd;
    color: #856404;
}

.fc-type-badge.type-trip-player,
.fc-type-badge.type-trip-supporter {
    background-color: #cce5ff;
    color: #004085;
}

/* ==========================================================================
   Links
   ========================================================================== */

.fc-registration-table a {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.fc-registration-table a:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* ==========================================================================
   Price Column
   ========================================================================== */

.fc-registration-table .woocommerce-Price-amount {
    font-weight: 600;
    color: #28a745;
}

/* ==========================================================================
   Empty State
   ========================================================================== */

.fc-registration-table td:empty::after {
    content: '-';
    color: #ccc;
}

.fc-registration-message {
    padding: 40px 20px;
    text-align: center;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    color: #666;
    font-size: 15px;
}

.fc-registration-message::before {
    content: "\1F4CB";
    display: block;
    font-size: 40px;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.fc-registration-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 20px;
    align-items: center;
}

.fc-registration-pagination .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 8px 14px;
    border-radius: 5px;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
}

.fc-registration-pagination .page-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.fc-registration-pagination .page-link.active {
    font-weight: 700;
    pointer-events: none;
}

/* ==========================================================================
   Scrollbar Styling
   ========================================================================== */

.fc-registration-table-wrapper {
    scrollbar-width: auto;
    scrollbar-color: #888 #f1f1f1;
}

.fc-registration-table-wrapper::-webkit-scrollbar {
    height: 12px;
    display: block !important;
}

.fc-registration-table-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 6px;
}

.fc-registration-table-wrapper::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 6px;
    border: 2px solid #f1f1f1;
}

.fc-registration-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ==========================================================================
   Responsive - Tablet (Card Layout)
   ========================================================================== */

@media screen and (max-width: 1024px) {
    .fc-registration-table {
        font-size: 13px;
    }

    .fc-registration-table th,
    .fc-registration-table td {
        padding: 10px 12px !important;
    }
}

/* ==========================================================================
   Responsive - Mobile (Card Layout)
   ========================================================================== */

@media screen and (max-width: 768px) {
    .fc-table-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .fc-table-search {
        max-width: 100%;
    }

    .fc-registration-table-wrapper {
        overflow-x: visible;
        overflow-y: visible;
    }

    .fc-registration-table {
        min-width: auto;
    }

    /* Hide table header on mobile */
    .fc-registration-table thead {
        display: none;
    }

    .fc-registration-table,
    .fc-registration-table tbody {
        display: block;
        width: 100%;
    }

    /* Convert each row to a card */
    .fc-registration-table tbody tr {
        display: block;
        margin-bottom: 15px;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        overflow: hidden;
    }

    /* Style each cell */
    .fc-registration-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 15px !important;
        border: none !important;
        border-bottom: 1px solid #eee !important;
        text-align: right;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        max-width: none;
    }

    .fc-registration-table tbody td:last-child {
        border-bottom: none !important;
    }

    /* Show label before each value */
    .fc-registration-table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #333;
        text-align: left;
        flex-shrink: 0;
        margin-right: 15px;
        white-space: nowrap;
    }

    /* Card header - first cell styling */
    .fc-registration-table tbody td:first-child {
        background-color: #f8f9fa;
        font-weight: 600;
    }

    /* Adjust badge alignment on mobile */
    .fc-registration-table tbody td .fc-status-badge,
    .fc-registration-table tbody td .fc-type-badge {
        margin-left: auto;
    }

    /* Pagination mobile adjustments */
    .fc-registration-pagination {
        justify-content: center;
    }

    .fc-registration-pagination .page-link {
        min-width: 36px;
        height: 36px;
        padding: 6px 10px;
        font-size: 13px;
    }
}

/* ==========================================================================
   Responsive - Small Mobile
   ========================================================================== */

@media screen and (max-width: 480px) {
    .fc-registration-table tbody td {
        padding: 10px 12px !important;
        font-size: 13px;
    }

    .fc-registration-table tbody td::before {
        font-size: 12px;
    }

    .fc-status-badge,
    .fc-type-badge {
        font-size: 10px;
        padding: 4px 8px;
    }

    .fc-registration-pagination .page-link {
        min-width: 32px;
        height: 32px;
        padding: 5px 8px;
        font-size: 12px;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .fc-table-controls,
    .fc-registration-pagination {
        display: none !important;
    }

    .fc-registration-table-wrapper {
        overflow: visible !important;
    }

    .fc-registration-table {
        font-size: 11px;
    }

    .fc-registration-table th,
    .fc-registration-table td {
        padding: 6px 8px !important;
        border: 1px solid #ddd !important;
    }

    .fc-status-badge,
    .fc-type-badge {
        border: 1px solid #999;
        background: none !important;
        color: #333 !important;
    }
}

/* ==========================================================================
   Loading State
   ========================================================================== */

.fc-registration-table-loading {
    position: relative;
    min-height: 200px;
}

.fc-registration-table-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: fc-table-spin 1s linear infinite;
}

@keyframes fc-table-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================================================
   No Results Animation
   ========================================================================== */

.fc-registration-message {
    animation: fc-fadeIn 0.3s ease;
}

@keyframes fc-fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
