/* WooCommerce Integration Styles - Mobile-First Design */

/* Base (Mobile) Table - Card Style */
.cdw-table {
    width: 100%;
    background: transparent;
    border-collapse: collapse;
    margin-bottom: 16px;
    border: none;
}

.cdw-table thead {
    background: #f8f9fa;
    border-bottom: 2px solid #e1e5e9;
}

.cdw-table th {
    padding: 16px 12px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-right: 1px solid #e1e5e9;
    font-size: 14px;
}

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

.cdw-table tbody tr {
    border-bottom: 1px solid #e1e5e9;
    transition: background 0.2s ease;
}

.cdw-table tbody tr:nth-child(even) {
    background: #f8f9fa;
}

.cdw-table tbody tr:hover {
    background: #e3f2fd !important;
}

.cdw-table td {
    padding: 16px 12px;
    border-right: 1px solid #e1e5e9;
    vertical-align: top;
    font-size: 14px;
    color: #2c3e50;
}

.cdw-table td:last-child {
    border-right: none;
}

/* Status badges consistent with dashboard */
.cdw-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    color: white;
    display: inline-block;
    text-transform: uppercase;
}

.cdw-status-completed {
    background: #28a745;
}

.cdw-status-processing {
    background: #17a2b8;
}

.cdw-status-on-hold {
    background: #ffc107;
    color: #212529;
}

.cdw-status-cancelled {
    background: #dc3545;
}

.cdw-status-pending {
    background: #ffc107;
    color: #212529;
}

.cdw-status-failed {
    background: #dc3545;
}

.cdw-status-refunded {
    background: #6f42c1;
}

/* Pagination styling matching dashboard */
.cdw-pagination {
    margin-top: 12px;
    display: flex;
    gap: 6px;
    justify-content: center;
    align-items: center;
}

.cdw-pagination a {
    padding: 8px 12px;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    text-decoration: none;
    color: #6c757d;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
}

.cdw-pagination a:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    color: #495057;
    transform: none;
}

.cdw-pagination a.is-active {
    background: #007bff;
    border-color: #007bff;
    color: white;
    font-weight: 600;
}

/* Section containers - Mobile-first (minimal padding) */
.cdw-orders,
.cdw-subs,
.cdw-payments {
    background: transparent;
    padding: 0;
    margin-bottom: 0;
}

.cdw-orders h3,
.cdw-subs h3,
.cdw-payments h3 {
    margin: 0 0 16px 0;
    color: #2c3e50;
    font-size: 20px;
    font-weight: 600;
    padding-bottom: 12px;
    border-bottom: 2px solid #e1e5e9;
}

/* Desktop: Add padding and styling */
@media (min-width: 769px) {
    .cdw-orders,
    .cdw-subs,
    .cdw-payments {
        background: white;
        border-radius: 12px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        padding: 30px;
        margin-bottom: 30px;
    }

    .cdw-orders h3,
    .cdw-subs h3,
    .cdw-payments h3 {
        font-size: 24px;
        margin-bottom: 20px;
        padding-bottom: 16px;
    }
}

/* Button styling consistent with dashboard */
.cdw-section-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s ease;
    cursor: pointer;
    font-size: 14px;
}

.cdw-section-btn:hover {
    background: #0056b3;
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

/* Empty state styling */
.cdw-empty {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    font-style: italic;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #dee2e6;
}

/* Loading state */
.cdw-loading {
    text-align: center;
    padding: 40px;
    color: #6c757d;
    font-style: italic;
}

/* Mobile-first: Card layout by default */
.cdw-table thead {
    display: none;
}

.cdw-table tbody {
    display: block;
}

.cdw-table tr {
    display: block;
    margin: 0 0 12px 0;
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    padding: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: box-shadow 0.2s ease;
}

.cdw-table tr:hover {
    box-shadow: 0 3px 6px rgba(0,0,0,0.12);
}

.cdw-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    border: none !important;
    border-bottom: 1px solid #f0f0f0;
    padding: 8px 0;
    font-size: 13px;
}

.cdw-table td:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.cdw-table td:first-child {
    padding-top: 0;
}

.cdw-table td:before {
    content: attr(data-label);
    font-weight: 600;
    color: #6c757d;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    flex: 0 0 auto;
}

/* Desktop enhancement (769px+) - Traditional table layout */
@media (min-width: 769px) {
    .cdw-table {
        border-radius: 8px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        overflow: hidden;
        background: white;
        margin-bottom: 20px;
    }

    .cdw-table thead {
        display: table-header-group;
        background: #f8f9fa;
        border-bottom: 2px solid #e1e5e9;
    }

    .cdw-table tbody {
        display: table-row-group;
    }

    .cdw-table tr {
        display: table-row;
        margin: 0;
        padding: 0;
        border: none;
        border-radius: 0;
        border-bottom: 1px solid #e1e5e9;
        box-shadow: none;
    }

    .cdw-table tr:nth-child(even) {
        background: #f8f9fa;
    }

    .cdw-table tr:hover {
        background: #e3f2fd !important;
        box-shadow: none;
    }

    .cdw-table th,
    .cdw-table td {
        display: table-cell;
        padding: 16px 12px;
        border-right: 1px solid #e1e5e9;
        border-bottom: none;
    }

    .cdw-table th:last-child,
    .cdw-table td:last-child {
        border-right: none;
    }

    .cdw-table td:before {
        content: none;
    }

    .cdw-table td:first-child,
    .cdw-table td:last-child {
        padding-top: 16px;
        padding-bottom: 16px;
    }
}

/* Mobile adjustments for other elements */
@media (max-width: 768px) {
    .cdw-pagination {
        flex-wrap: wrap;
        gap: 4px;
    }

    .cdw-pagination a {
        padding: 6px 10px;
        font-size: 12px;
        min-width: 32px;
    }

    .cdw-orders,
    .cdw-subs,
    .cdw-payments {
        padding: 0;
        margin-bottom: 0;
    }

    /* WooCommerce sub-navigation responsive */
    .svg-woo-sub-nav {
        flex-direction: column;
        margin-bottom: 20px;
    }

    .svg-woo-sub-btn {
        border-right: none !important;
        border-bottom: 1px solid #e1e5e9;
        padding: 12px 15px;
        font-size: 14px;
    }

    .svg-woo-sub-btn:last-child {
        border-bottom: none;
    }
}

/* WooCommerce Sub-navigation Styling */
.svg-woo-sub-nav {
    margin-bottom: 30px;
}

.svg-woo-sub-btn {
    transition: all 0.3s ease;
    position: relative;
}

.svg-woo-sub-btn:hover {
    background: #e9ecef !important;
    transform: translateY(-1px);
}

.svg-woo-sub-btn.active {
    background: #007bff !important;
    color: white !important;
    box-shadow: inset 0 -2px 0 rgba(0, 123, 255, 0.8);
}

.svg-woo-sub-panel {
    display: none;
}

.svg-woo-sub-panel.active {
    display: block;
}

/* Tab integration styling */
.svg-tab-panel .cdw-orders,
.svg-tab-panel .cdw-subs,
.svg-tab-panel .cdw-payments {
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    margin-bottom: 0;
    background: transparent;
}

.svg-tab-panel .cdw-pagination {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e1e5e9;
}

/* Stats cards integration */
.cdw-stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cdw-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.cdw-stat-card-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.cdw-stat-card-title {
    margin: 0 0 5px 0;
    color: #2c3e50;
    font-size: 14px;
    font-weight: 600;
    text-align: left;
}

.cdw-stat-card-value {
    margin: 0;
    font-size: 28px;
    font-weight: bold;
    color: #007bff;
}

.cdw-stat-card-label {
    color: #6c757d;
    font-size: 11px;
}
