/**
 * Subscriptions Admin Widget Styles
 * LatePoint Elementor Widget - Admin Table View
 */

/* Error Message */
.latepoint-subscriptions-admin-error {
    padding: 20px;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    text-align: center;
    font-weight: 500;
}

/* Main Wrapper */
.latepoint-subscriptions-admin-w {
    width: 100%;
    margin: 0 auto;
}

.latepoint-section-heading-w {
    margin-bottom: 20px;
}

.latepoint-section-heading {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #333;
}

/* Table Wrapper */
.latepoint-subscriptions-table-wrapper {
    overflow-x: auto;
    margin-top: 20px;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* DataTables Overrides */
.latepoint-subscriptions-table.dataTable {
    width: 100% !important;
    border-collapse: collapse !important;
}

.latepoint-subscriptions-table.dataTable thead th {
    background: #f8f9fa;
    padding: 12px 15px;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #dee2e6;
    white-space: nowrap;
}

.latepoint-subscriptions-table.dataTable tbody td {
    padding: 12px 15px;
    vertical-align: middle;
    border-bottom: 1px solid #e9ecef;
}

.latepoint-subscriptions-table.dataTable tbody tr:hover {
    background-color: #f8f9fa;
}

.latepoint-subscriptions-table.dataTable tbody tr.is-expired {
    opacity: 0.6;
    background-color: #fafafa;
}

.latepoint-subscriptions-table.dataTable tbody tr.is-expired:hover {
    background-color: #f0f0f0;
}

/* DataTables Controls */
.latepoint-subscriptions-table_wrapper .dataTables_length {
    margin-bottom: 10px;
}

.latepoint-subscriptions-table_wrapper .dataTables_filter {
    margin-bottom: 10px;
    text-align: right;
}

.latepoint-subscriptions-table_wrapper .dataTables_filter input {
    margin-left: 8px;
    padding: 6px 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
}

.latepoint-subscriptions-table_wrapper .dataTables_info {
    padding-top: 15px !important;
    color: #6c757d;
}

.latepoint-subscriptions-table_wrapper .dataTables_paginate {
    padding-top: 15px !important;
}

.latepoint-subscriptions-table_wrapper .dataTables_paginate .paginate_button {
    padding: 6px 12px !important;
    margin: 0 2px;
    border: 1px solid #dee2e6 !important;
    border-radius: 4px !important;
    background: #fff !important;
    color: #333 !important;
}

.latepoint-subscriptions-table_wrapper .dataTables_paginate .paginate_button:hover {
    background: #e9ecef !important;
    border-color: #adb5bd !important;
}

.latepoint-subscriptions-table_wrapper .dataTables_paginate .paginate_button.current {
    background: #007bff !important;
    border-color: #007bff !important;
    color: #fff !important;
}

.latepoint-subscriptions-table_wrapper .dataTables_paginate .paginate_button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Column Filter Inputs - Separate filter bar above table */
.latepoint-subscriptions-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.latepoint-subscriptions-filters .filter-item {
    display: flex;
    flex-direction: column;
    min-width: 140px;
    flex: 1;
}

.latepoint-subscriptions-filters .filter-item.clear-filters {
    justify-content: flex-end;
    min-width: auto;
}

.latepoint-subscriptions-filters .filter-item label {
    font-size: 11px;
    font-weight: 600;
    color: #6c757d;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.latepoint-subscriptions-filters .dt-filter {
    width: 100%;
    padding: 6px 8px;
    font-size: 12px;
    border: 1px solid #ced4da;
    border-radius: 3px;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.latepoint-subscriptions-filters .dt-filter:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.15);
}

.latepoint-subscriptions-filters .dt-filter::placeholder {
    color: #adb5bd;
    font-size: 11px;
}

.latepoint-subscriptions-filters .dt-filter-select {
    width: 100%;
    padding: 6px 8px;
    font-size: 12px;
    border: 1px solid #ced4da;
    border-radius: 3px;
    box-sizing: border-box;
    background: #fff;
    transition: border-color 0.2s;
}

.latepoint-subscriptions-filters .dt-filter-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.15);
}

.clear-filters-btn {
    padding: 6px 16px;
    background: #dc3545;
    color: #fff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: background 0.2s;
    white-space: nowrap;
}

.clear-filters-btn:hover {
    background: #c82333;
}

/* Table Cells */
.latepoint-subscriptions-table .text-center {
    text-align: center;
}

.latepoint-subscriptions-table .order-link {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}

.latepoint-subscriptions-table .order-link:hover {
    text-decoration: underline;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

/* Payment Status Colors */
.payment-status-fully_paid {
    background: #d4edda;
    color: #155724;
}

.payment-status-partially_paid {
    background: #fff3cd;
    color: #856404;
}

.payment-status-not_paid {
    background: #f8d7da;
    color: #721c24;
}

/* Order Status Colors */
.order-status-open {
    background: #cce5ff;
    color: #004085;
}

.order-status-completed {
    background: #d4edda;
    color: #155724;
}

.order-status-cancelled {
    background: #f8d7da;
    color: #721c24;
}

/* Remaining Sessions Badge */
.remaining-sessions-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    min-width: 40px;
}

.remaining-sessions-badge.is-active {
    background: #d4edda;
    color: #155724;
}

.remaining-sessions-badge.is-expired {
    background: #e2e3e5;
    color: #383d41;
}

/* Empty State */
.latepoint-no-subscriptions-message {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: 4px;
    margin-top: 20px;
}

.latepoint-no-subscriptions-message p {
    margin: 0;
    font-size: 16px;
    color: #6c757d;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .latepoint-subscriptions-table.dataTable {
        font-size: 13px;
    }
    
    .latepoint-subscriptions-table.dataTable thead th,
    .latepoint-subscriptions-table.dataTable tbody td {
        padding: 8px 10px;
    }
}

@media (max-width: 768px) {
    .latepoint-subscriptions-table_wrapper .dataTables_filter {
        text-align: left;
    }
    
    .latepoint-subscriptions-table.dataTable {
        font-size: 12px;
    }
    
    .status-badge {
        font-size: 11px;
        padding: 3px 8px;
    }
    
    .remaining-sessions-badge {
        font-size: 12px;
        padding: 4px 8px;
        min-width: 35px;
    }
}

/* DataTables Responsive Mode */
@media (max-width: 480px) {
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        text-align: center !important;
        float: none !important;
    }
    
    .dataTables_wrapper .dataTables_filter input {
        width: 100%;
        margin-top: 5px;
    }
}
