/**
 * AIFS Bulk Coupon Manager Frontend Styles
 * Modern, clean design with consistent spacing
 */

:root {
    --aifs-primary: #4a90e2;
    --aifs-primary-hover: #357abd;
    --aifs-primary-light: #e3f2fd;
    --aifs-primary-dark: #2d6ca8;
    --aifs-success: #52c41a;
    --aifs-danger: #ff4d4f;
    --aifs-warning: #faad14;
    --aifs-gray-light: #f5f7fa;
    --aifs-gray-medium: #e4e7ed;
    --aifs-gray-dark: #606266;
    --aifs-text-primary: #303133;
    --aifs-text-regular: #606266;
    --aifs-text-secondary: #909399;
    --aifs-text-disabled: #c0c4cc;
    --aifs-border-color: #dcdfe6;
    --aifs-border-light: #ebeef5;
    --aifs-border: #d1d5db;
    --aifs-bg-white: #ffffff;
    --aifs-bg-light: #f8f9fa;
    --aifs-shadow: 0 2px 8px 0 rgba(0,0,0,0.08);
    --aifs-shadow-light: 0 2px 12px 0 rgba(0,0,0,0.1);
    --aifs-shadow-medium: 0 4px 16px 0 rgba(0,0,0,0.12);
    --aifs-shadow-lg: 0 10px 30px 0 rgba(0,0,0,0.15);
    --aifs-border-radius: 8px;
    --aifs-radius-sm: 6px;
    --aifs-radius-md: 8px;
    --aifs-radius-lg: 12px;
    --aifs-spacing: 24px;
    --aifs-spacing-xs: 8px;
    --aifs-spacing-sm: 12px;
    --aifs-spacing-lg: 24px;
    --aifs-spacing-xl: 32px;
    --aifs-transition: all 0.3s ease;
}

.aifs-bcm-wrapper {
    padding: var(--aifs-spacing) 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Statistics Dashboard - SHARED STYLES */
.aifs-bcm-statistics,
.billing-statistics {
    background: var(--aifs-bg-white);
    border-radius: var(--aifs-radius-md);
    padding: var(--aifs-spacing-lg);
    margin-bottom: var(--aifs-spacing-lg);
    box-shadow: var(--aifs-shadow);
    border: 1px solid var(--aifs-border-light);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--aifs-spacing-lg);
}

.billing-statistics .stats-grid {
    grid-template-columns: repeat(3, 1fr);
    margin-bottom: var(--aifs-spacing-lg);
}

.stat-box {
    text-align: center;
    padding: 32px 24px;
    background: var(--aifs-bg-light);
    border-radius: var(--aifs-radius-md);
    border: 2px solid var(--aifs-border-light);
    transition: var(--aifs-transition);
}

.stat-box:hover {
    border-color: var(--aifs-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.stat-number {
    display: block;
    font-size: 36px;
    font-weight: 600;
    color: var(--aifs-text-primary);
    margin-bottom: 8px;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.stat-number.unused {
    color: var(--aifs-success);
}

.stat-number.used {
    color: var(--aifs-danger);
}

.stat-label {
    display: block;
    font-size: 13px;
    color: var(--aifs-text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

/* Action Buttons Section */
.aifs-bcm-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--aifs-spacing);
    padding: 20px;
    background: white;
    border-radius: var(--aifs-border-radius);
    box-shadow: var(--aifs-shadow-light);
    gap: 16px;
}

.aifs-bcm-actions .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    min-width: 120px;
}

.aifs-bcm-actions .button-primary {
    background: linear-gradient(135deg, var(--aifs-primary), #67b7ff);
    color: white;
    box-shadow: 0 4px 6px rgba(74, 144, 226, 0.25);
}

.aifs-bcm-actions .button-primary:hover {
    background: linear-gradient(135deg, var(--aifs-primary-hover), var(--aifs-primary));
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(74, 144, 226, 0.35);
}

.aifs-bcm-actions .button:not(.button-primary) {
    background: white;
    color: var(--aifs-text-regular);
    border: 1px solid var(--aifs-border-color);
}

.aifs-bcm-actions .button:not(.button-primary):hover {
    background: var(--aifs-gray-light);
    border-color: var(--aifs-primary);
    color: var(--aifs-primary);
}

/* ========================================
   Navigation Menu Icons
   ======================================== */

/* Navigation layout */
.woocommerce-account .woocommerce-MyAccount-navigation {
    float: left;
    width: auto;
}

/* Ensure content area takes full width and clears the float */
.woocommerce-account .woocommerce-MyAccount-content {
    float: none;
    width: 100%;
    clear: both;
}

.aifs-bcm-wrapper {
    clear: both;
    width: 100%;
}

/* Remove unwanted line breaks in navigation and buttons (added by theme/plugin) */
.woocommerce-MyAccount-navigation a br,
.filter-actions button br,
.filter-actions a br,
.aifs-bcm-actions button br,
.aifs-bcm-actions a br,
.export-buttons button br,
.export-buttons a br,
.button br,
button br {
    display: none !important;
}

/* AIFS Gutscheine menu item icon */
.woocommerce-MyAccount-navigation-link--aifs-coupons a::before {
    content: "\f145" !important;
    font-family: dashicons !important;
    font-size: 16px !important;
    width: 20px !important;
    height: 20px !important;
    margin-right: 8px;
    display: inline-block !important;
    vertical-align: text-top;
    line-height: 1.3;
    position: relative;
    top: 3px;
    background-image: none !important;
    background-size: auto !important;
    opacity: 1 !important;
}

/* AIFS Abrechnungen menu item icon */
.woocommerce-MyAccount-navigation-link--aifs-abrechnungen a::before {
    content: "\f228" !important;
    font-family: dashicons !important;
    font-size: 16px !important;
    width: 20px !important;
    height: 20px !important;
    margin-right: 8px;
    display: inline-block !important;
    vertical-align: text-top;
    line-height: 1.3;
    position: relative;
    top: 3px;
    background-image: none !important;
    background-size: auto !important;
    opacity: 1 !important;
}

.export-buttons {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Filters Section */
.aifs-bcm-filters {
    background: white;
    padding: 20px;
    border-radius: var(--aifs-border-radius);
    margin-bottom: var(--aifs-spacing);
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--aifs-shadow-light);
}

.aifs-bcm-filters label {
    font-weight: 500;
    color: var(--aifs-text-regular);
    font-size: 14px;
    margin: 0;
}

.aifs-bcm-filters select {
    min-width: 200px;
    padding: 10px 36px 10px 12px;
    border: 1px solid var(--aifs-border-color);
    border-radius: 6px;
    background: white;
    font-size: 14px;
    color: var(--aifs-text-primary);
    transition: all 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23909399' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    cursor: pointer;
}

.aifs-bcm-filters select:hover {
    border-color: var(--aifs-primary);
}

.aifs-bcm-filters select:focus {
    outline: none;
    border-color: var(--aifs-primary);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

/* Table Responsive Wrapper */
.aifs-table-responsive {
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 20px;
}

/* DataTable Container */
#aifs-coupons-table_wrapper {
    background: white;
    border-radius: var(--aifs-border-radius);
    padding: 0;
    box-shadow: var(--aifs-shadow-light);
    position: relative;
    width: 100%;
}

/* Make the wrapper scrollable */
#aifs-coupons-table_wrapper > div:first-child {
    overflow-x: auto;
    overflow-y: visible;
}

/* Ensure table has min-width to trigger scroll */
#aifs-coupons-table {
    min-width: 1200px;
}

/* Set minimum column widths to prevent cramping */
#aifs-coupons-table th:nth-child(1), /* Gutschein-Code */
#aifs-coupons-table td:nth-child(1) {
    min-width: 140px;
}

#aifs-coupons-table th:nth-child(2), /* URL */
#aifs-coupons-table td:nth-child(2) {
    min-width: 150px;
}

#aifs-coupons-table th:nth-child(3), /* Beschreibung */
#aifs-coupons-table td:nth-child(3) {
    min-width: 200px;
}

#aifs-coupons-table th:nth-child(4), /* Erstellt am */
#aifs-coupons-table td:nth-child(4) {
    min-width: 120px;
}

#aifs-coupons-table th:nth-child(5), /* Erstellt von */
#aifs-coupons-table td:nth-child(5) {
    min-width: 120px;
}

#aifs-coupons-table th:nth-child(6), /* Status */
#aifs-coupons-table td:nth-child(6) {
    min-width: 100px;
}

#aifs-coupons-table th:nth-child(7), /* Verwendet von */
#aifs-coupons-table td:nth-child(7) {
    min-width: 150px;
}

#aifs-coupons-table th:nth-child(8), /* Verwendet am */
#aifs-coupons-table td:nth-child(8) {
    min-width: 120px;
}

#aifs-coupons-table th:nth-child(9), /* Aktionen */
#aifs-coupons-table td:nth-child(9) {
    min-width: 100px;
}

/* Scrollbar styling for the table wrapper */
.aifs-table-responsive::-webkit-scrollbar {
    height: 10px;
}

.aifs-table-responsive::-webkit-scrollbar-track {
    background: var(--aifs-gray-light);
    border-radius: 5px;
}

.aifs-table-responsive::-webkit-scrollbar-thumb {
    background: var(--aifs-gray-medium);
    border-radius: 5px;
}

.aifs-table-responsive::-webkit-scrollbar-thumb:hover {
    background: var(--aifs-gray-dark);
}

/* DataTable Search */
#aifs-coupons-table_wrapper .dataTables_filter {
    padding: 20px;
    border-bottom: 1px solid var(--aifs-border-color);
    background: var(--aifs-gray-light);
    position: sticky;
    top: 0;
    z-index: 10;
}

#aifs-coupons-table_wrapper .dataTables_filter label {
    font-weight: 500;
    color: var(--aifs-text-regular);
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: flex-end;
}

#aifs-coupons-table_wrapper .dataTables_filter input {
    padding: 10px 16px;
    border: 1px solid var(--aifs-border-color);
    border-radius: 6px;
    font-size: 14px;
    width: 300px;
    transition: all 0.2s;
    background: white;
}

#aifs-coupons-table_wrapper .dataTables_filter input:focus {
    outline: none;
    border-color: var(--aifs-primary);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

/* DataTable */
#aifs-coupons-table {
    border-collapse: collapse;
    border-spacing: 0;
    width: 100%;
    font-size: 14px;
}

#aifs-coupons-table thead th {
    background: linear-gradient(180deg, #fafbfc 0%, #f4f6f9 100%);
    font-weight: 600;
    text-align: left;
    padding: 16px;
    border-bottom: 2px solid var(--aifs-border-color);
    color: var(--aifs-text-regular);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

#aifs-coupons-table thead th.sorting::after,
#aifs-coupons-table thead th.sorting_asc::after,
#aifs-coupons-table thead th.sorting_desc::after {
    content: '';
    float: right;
    margin-left: 8px;
    opacity: 0.6;
}

#aifs-coupons-table thead th.sorting::after {
    content: '↕';
    opacity: 0.3;
}

#aifs-coupons-table thead th.sorting_asc::after {
    content: '↑';
    color: var(--aifs-primary);
}

#aifs-coupons-table thead th.sorting_desc::after {
    content: '↓';
    color: var(--aifs-primary);
}

#aifs-coupons-table tbody td {
    padding: 16px;
    border-bottom: 1px solid var(--aifs-gray-medium);
    color: var(--aifs-text-primary);
    vertical-align: middle;
}

#aifs-coupons-table tbody tr {
    transition: background-color 0.2s;
    background: white;
}

#aifs-coupons-table tbody tr:hover {
    background: var(--aifs-gray-light);
}

#aifs-coupons-table tbody tr:last-child td {
    border-bottom: none;
}

/* Status Badges */
.status-unused {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: linear-gradient(135deg, #f6ffed, #e6f7ff);
    color: var(--aifs-success);
    border: 1px solid #b7eb8f;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.status-used {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: linear-gradient(135deg, #fff1f0, #ffebe6);
    color: var(--aifs-danger);
    border: 1px solid #ffccc7;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* URL Column Styling */
.coupon-url-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.coupon-url-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 12px;
    background: var(--aifs-gray-light);
    border: 1px solid var(--aifs-border-color);
    border-radius: 4px;
    color: var(--aifs-primary);
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}

.coupon-url-link:hover {
    background: var(--aifs-primary);
    color: white;
    border-color: var(--aifs-primary);
    transform: translateY(-1px);
}

.copy-url-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 12px;
    background: white;
    border: 1px solid var(--aifs-border-color);
    border-radius: 4px;
    color: var(--aifs-text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 12px;
    font-weight: 500;
    min-width: auto;
}

.copy-url-btn:hover {
    background: var(--aifs-gray-light);
    color: var(--aifs-primary);
    border-color: var(--aifs-primary);
}

.copy-text {
    white-space: nowrap;
    line-height: 1;
}

.copy-url-btn.copied {
    background: var(--aifs-success);
    color: white;
    border-color: var(--aifs-success);
}

/* DataTable Info & Pagination */
#aifs-coupons-table_wrapper .dataTables_info,
#aifs-coupons-table_wrapper .dataTables_paginate {
    padding: 20px;
}

#aifs-coupons-table_wrapper .bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: var(--aifs-gray-light);
    border-top: 1px solid var(--aifs-border-color);
}

#aifs-coupons-table_wrapper .dataTables_info {
    color: var(--aifs-text-secondary);
    font-size: 14px;
    padding: 0;
}

#aifs-coupons-table_wrapper .dataTables_paginate {
    padding: 0;
}

#aifs-coupons-table_wrapper .paginate_button {
    padding: 8px 12px;
    margin: 0 4px;
    border: 1px solid var(--aifs-border-color);
    border-radius: 6px;
    background: white;
    color: var(--aifs-text-regular);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    text-decoration: none;
    display: inline-block;
}

#aifs-coupons-table_wrapper .paginate_button:hover:not(.disabled) {
    background: var(--aifs-primary);
    color: white;
    border-color: var(--aifs-primary);
}

#aifs-coupons-table_wrapper .paginate_button.current {
    background: var(--aifs-primary);
    color: white;
    border-color: var(--aifs-primary);
    font-weight: 600;
}

#aifs-coupons-table_wrapper .paginate_button.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* DataTable Length Menu */
#aifs-coupons-table_wrapper .dataTables_length {
    padding: 20px;
    display: inline-block;
}

#aifs-coupons-table_wrapper .dataTables_length label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--aifs-text-regular);
}

#aifs-coupons-table_wrapper .dataTables_length select {
    padding: 8px 32px 8px 12px;
    border: 1px solid var(--aifs-border-color);
    border-radius: 6px;
    font-size: 14px;
    appearance: none;
    background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23909399' d='M6 9L1 4h10z'/%3E%3C/svg%3E") no-repeat right 10px center;
    cursor: pointer;
    transition: all 0.2s;
}

#aifs-coupons-table_wrapper .dataTables_length select:hover {
    border-color: var(--aifs-primary);
}

#aifs-coupons-table_wrapper .dataTables_length select:focus {
    outline: none;
    border-color: var(--aifs-primary);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

/* Form Styles */
.aifs-bcm-form-wrapper {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    width: 100%;
}

.aifs-bcm-breadcrumb {
    margin-bottom: 20px;
}

.aifs-bcm-breadcrumb a {
    color: #0073aa;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.aifs-bcm-breadcrumb a:hover {
    text-decoration: underline;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.form-group .required {
    color: #dc3545;
}

.form-group .description {
    font-weight: normal;
    color: #666;
    font-size: 13px;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0,115,170,0.1);
}

.form-text {
    display: block;
    margin-top: 5px;
    font-size: 13px;
    color: #666;
}

/* Info Boxes */
.aifs-bcm-info-box,
.aifs-bcm-code-format-info {
    background: #f0f8ff;
    border: 1px solid #b8daff;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 20px;
}

.aifs-bcm-info-box h4,
.aifs-bcm-code-format-info h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #004085;
}

.aifs-bcm-info-box ul {
    margin: 0;
    padding-left: 20px;
}

.aifs-bcm-info-box li {
    margin-bottom: 5px;
    color: #004085;
}

.aifs-bcm-code-format-info code {
    background: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 30px;
}

.form-actions .button {
    padding: 12px 24px;
    font-size: 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.button-large {
    padding: 14px 28px !important;
}

.button-secondary {
    background: #6c757d;
    color: white;
    border: 1px solid #6c757d;
}

.button-secondary:hover {
    background: #5a6268;
    border-color: #545b62;
}

/* Progress Bar */
#generation-progress {
    margin-top: 30px;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: #f0f0f0;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    width: 0;
    transition: width 0.3s;
    animation: progress-animation 2s infinite;
}

@keyframes progress-animation {
    0% { background-position: 0 0; }
    100% { background-position: 40px 0; }
}

.progress-message {
    text-align: center;
    font-size: 16px;
    color: #666;
}

/* Result Message */
#generation-result {
    text-align: center;
    padding: 30px;
}

.result-message {
    margin-bottom: 20px;
    padding: 15px;
    border-radius: 4px;
    font-size: 16px;
}

.result-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.result-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Action Buttons in Table */
.button-small {
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 3px;
    cursor: pointer;
    margin-right: 5px;
}

/* Loading Spinner */
.dataTables_processing {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 20px 30px;
    border-radius: var(--aifs-border-radius);
    box-shadow: var(--aifs-shadow-medium);
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 12px;
}

.dataTables_processing::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 3px solid var(--aifs-primary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty Table State */
.dataTables_empty {
    padding: 60px 20px !important;
    text-align: center;
    color: var(--aifs-text-secondary);
    font-size: 16px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .aifs-bcm-statistics {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    :root {
        --aifs-spacing: 16px;
    }
    
    .aifs-bcm-statistics {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .stat-box {
        padding: 20px 16px;
    }
    
    .stat-number {
        font-size: 28px;
    }
    
    .aifs-bcm-actions {
        flex-direction: column;
        align-items: stretch;
        padding: 16px;
    }
    
    .aifs-bcm-actions .button {
        width: 100%;
        justify-content: center;
    }
    
    .export-buttons {
        width: 100%;
        flex-direction: row;
        justify-content: stretch;
    }
    
    .export-buttons .button {
        flex: 1;
    }
    
    .aifs-bcm-filters {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .aifs-bcm-filters select {
        width: 100%;
    }
    
    #aifs-coupons-table_wrapper .dataTables_filter input {
        width: 100%;
        max-width: none;
    }
    
    #aifs-coupons-table_wrapper .dataTables_filter label {
        flex-direction: column;
        align-items: stretch;
    }
    
    /* Hide less important columns on mobile */
    #aifs-coupons-table th:nth-child(2),
    #aifs-coupons-table td:nth-child(2),
    #aifs-coupons-table th:nth-child(5),
    #aifs-coupons-table td:nth-child(5),
    #aifs-coupons-table th:nth-child(8),
    #aifs-coupons-table td:nth-child(8) {
        display: none;
    }
    
    #aifs-coupons-table thead th,
    #aifs-coupons-table tbody td {
        padding: 12px 8px;
        font-size: 13px;
    }
    
    .aifs-bcm-form-wrapper {
        padding: 20px;
    }
    
    #aifs-coupons-table_wrapper .bottom {
        flex-direction: column;
        gap: 16px;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .aifs-bcm-statistics {
        grid-template-columns: 1fr;
    }
    
    .export-buttons {
        flex-direction: column;
    }
    
    .export-buttons .button {
        width: 100%;
    }
    
    /* Hide more columns on very small screens */
    #aifs-coupons-table th:nth-child(3),
    #aifs-coupons-table td:nth-child(3),
    #aifs-coupons-table th:nth-child(4),
    #aifs-coupons-table td:nth-child(4) {
        display: none;
    }
    
    #aifs-coupons-table thead th,
    #aifs-coupons-table tbody td {
        padding: 10px 6px;
        font-size: 12px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .button {
        width: 100%;
        justify-content: center;
    }
    
    #aifs-coupons-table_wrapper .paginate_button {
        padding: 6px 8px;
        margin: 0 2px;
        font-size: 12px;
    }
}

/* Print Styles */
@media print {
    .aifs-bcm-actions,
    .aifs-bcm-filters,
    #aifs-coupons-table_wrapper .dataTables_filter,
    #aifs-coupons-table_wrapper .dataTables_length,
    #aifs-coupons-table_wrapper .dataTables_paginate {
        display: none !important;
    }
    
    .aifs-bcm-statistics {
        page-break-after: always;
    }
    
    #aifs-coupons-table {
        font-size: 10pt;
    }
    
    #aifs-coupons-table thead {
        display: table-header-group;
    }
    
    #aifs-coupons-table tr {
        page-break-inside: avoid;
    }
}