/**
 * Modern Subscription List & Details Styling
 * Implements clean, card-based design with improved UX
 */

/* ========================================
   SUBSCRIPTION LIST PAGE STYLES
   ======================================== */

/* Main wrapper with modern spacing */
.wrap.subscription-list-wrap {
    background: #f8f9fa;
    padding: 30px 40px;
    margin: 20px 20px 20px 0;
    border-radius: 12px;
}

/* Header section with action button */
.subscription-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e5e9f0;
}

.subscription-list-header h1 {
    font-size: 28px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.subscription-list-header h1::before {
    content: "📋";
    font-size: 32px;
}

/* Filters and search section */
.subscription-filters {
    background: white;
    padding: 20px 25px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 25px;
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.subscription-filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-width: 200px;
}

.subscription-filter-group label {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.subscription-filter-group input,
.subscription-filter-group select {
    padding: 10px 14px;
    border: 2px solid #e5e9f0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
}

.subscription-filter-group input:focus,
.subscription-filter-group select:focus {
    outline: none;
    border-color: #cbd5e1;
    box-shadow: 0 0 0 3px rgba(203, 213, 225, 0.2);
}

.subscription-filter-btn {
    padding: 10px 24px;
    background: white;
    color: #333;
    border: 2px solid #e5e9f0;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.subscription-filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #cbd5e1;
}

/* Modern table card container */
.widefat.subscription-table-modern {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: none;
}

/* Table header styling */
.widefat.subscription-table-modern thead {
    background: white;
    border-bottom: 2px solid #e5e9f0;
}

.widefat.subscription-table-modern thead th {
    color: #1e293b;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.8px;
    padding: 18px 20px;
    border: none;
}

.widefat.subscription-table-modern thead th a {
    color: #1e293b;
    text-decoration: none;
}

/* Hide table footer (repeated headers) */
.widefat.subscription-table-modern tfoot {
    display: none;
}

/* Table body styling */
.widefat.subscription-table-modern tbody tr {
    transition: all 0.3s ease;
    border-bottom: 1px solid #f1f5f9;
    background: white !important; /* Override WordPress striped styling */
}

.widefat.subscription-table-modern tbody tr:hover {
    background: #f8fafc !important;
    transform: scale(1.001);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.widefat.subscription-table-modern tbody td {
    padding: 18px 20px;
    border: none;
    font-size: 14px;
    color: #334155;
    vertical-align: middle;
}

/* Subscription ID badge */
.widefat.subscription-table-modern tbody td a[href*="subscription_id"] {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    background: #f0f4f8;
    color: #000000;
    border: 2px solid #d1d9e0;
    border-radius: 20px;
    font-weight: 600;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.widefat.subscription-table-modern tbody td a[href*="subscription_id"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #cbd5e1;
}

/* Status badges */
.subscription-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    gap: 6px;
}

.subscription-status-badge::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.subscription-status-badge.status-active {
    background: #d1fae5;
    color: #065f46;
}

.subscription-status-badge.status-active::before {
    background: #10b981;
    box-shadow: 0 0 6px #10b981;
}

.subscription-status-badge.status-inactive {
    background: #fee2e2;
    color: #991b1b;
}

.subscription-status-badge.status-inactive::before {
    background: #ef4444;
}

.subscription-status-badge.status-cancelled {
    background: #fef3c7;
    color: #92400e;
}

.subscription-status-badge.status-cancelled::before {
    background: #f59e0b;
}

.subscription-status-badge.status-paused {
    background: #e1f5fe;
    color: #01579b;
}

.subscription-status-badge.status-paused::before {
    background: #94a3b8;
}

/* Product links styling */
.widefat.subscription-table-modern tbody td a[href*="post.php"] {
    color: #29B6F6;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.widefat.subscription-table-modern tbody td a[href*="post.php"]:hover {
    color: #0288D1;
    text-decoration: underline;
}

/* Price styling */
.widefat.subscription-table-modern tbody td .woocommerce-Price-amount {
    font-weight: 600;
    color: #059669;
    font-size: 15px;
}

/* Pagination */
.tablenav {
    background: white;
    padding: 15px 20px;
    border-radius: 0 0 12px 12px;
    margin-top: -1px;
}

.tablenav .tablenav-pages {
    margin: 0;
}

.tablenav .tablenav-pages a,
.tablenav .tablenav-pages span.current {
    padding: 8px 14px;
    border-radius: 6px;
    margin: 0 4px;
    transition: all 0.3s ease;
}

.tablenav .tablenav-pages a {
    background: #f1f5f9;
    color: #475569;
}

.tablenav .tablenav-pages a:hover {
    background: #f8fafc;
    color: #334155;
    border: 1px solid #e5e9f0;
}

.tablenav .tablenav-pages span.current {
    background: white;
    color: #334155;
    font-weight: 600;
    border: 2px solid #cbd5e1;
}

/* Empty state */
.subscription-empty-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.subscription-empty-state::before {
    content: "📭";
    font-size: 64px;
    display: block;
    margin-bottom: 20px;
}

.subscription-empty-state h3 {
    font-size: 22px;
    color: #64748b;
    margin-bottom: 10px;
}

.subscription-empty-state p {
    color: #94a3b8;
    font-size: 15px;
}

/* ========================================
   SUBSCRIPTION DETAILS PAGE STYLES
   ======================================== */

/* Main details wrapper */
.wrap.subscription-details-wrap {
    background: #f8f9fa;
    padding: 30px 40px;
    margin: 20px 20px 20px 0;
}

/* Header with ID and status */
.subscription-details-header {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.subscription-details-header h1 {
    font-size: 32px;
    color: #1e293b;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 15px;
}

.subscription-id-badge {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    background: #f0f4f8;
    color: #000000;
    border: 2px solid #d1d9e0;
    border-radius: 25px;
    font-weight: 600;
    font-size: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Two column layout */
.subscription-container {
    display: grid;
    grid-template-columns: 65% 33%;
    gap: 2%;
    margin-bottom: 30px;
}

/* Details card */
.subscription-details {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: none;
}

.subscription-details h4 {
    font-size: 20px;
    color: #1e293b;
    margin: 0 0 25px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid #e5e9f0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.subscription-details h4::before {
    content: "📊";
    font-size: 24px;
}

.subscription-details .form-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.subscription-details .form-table tr {
    transition: background 0.3s ease;
}

.subscription-details .form-table tr:hover {
    background: #f8fafc;
}

.subscription-details .form-table th {
    text-align: left;
    padding: 16px 20px;
    font-weight: 600;
    color: #000000;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e0e4e8;
    width: 35%;
    background: #f8fafb;
}

.subscription-details .form-table td {
    padding: 16px 20px;
    color: #000000;
    font-size: 14px;
    border-bottom: 1px solid #e0e4e8;
}

.subscription-details .form-table td a {
    color: #29B6F6;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.subscription-details .form-table td a:hover {
    color: #0288D1;
    text-decoration: underline;
}

/* Settings sidebar */
.subscription-settings {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    height: fit-content;
    border: none;
    position: sticky;
    top: 32px;
    width: 100%;
}

.subscription-settings h4 {
    font-size: 18px;
    color: #1e293b;
    margin: 0 0 25px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid #e5e9f0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.subscription-settings h4::before {
    content: "⚙️";
    font-size: 20px;
}

.subscription-settings .form-table {
    width: 100%;
}

.subscription-settings .form-table th {
    display: block;
    text-align: left;
    padding: 0;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.subscription-settings .form-table td {
    padding: 0 0 15px 0;
    display: block;
    width: 100%;
}

.subscription-settings label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.subscription-settings input[type="date"],
.subscription-settings select {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e5e9f0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
    color: #334155;
}

.subscription-settings input[type="date"]:focus,
.subscription-settings select:focus {
    outline: none;
    border-color: #cbd5e1;
    box-shadow: 0 0 0 3px rgba(203, 213, 225, 0.1);
}

.subscription-settings input[type="date"][readonly] {
    background-color: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
}

.subscription-settings .update_subs_btn {
    width: 100%;
    padding: 14px 20px;
    background: white;
    color: #334155;
    border: 2px solid #e5e9f0;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.subscription-settings .update_subs_btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #cbd5e1;
}

/* Order history section */
.subscription-order-history {
    width: 100%;
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-top: 30px;
}

.subscription-order-history h4 {
    font-size: 20px;
    color: #1e293b;
    margin: 0 0 25px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid #e5e9f0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.subscription-order-history h4::before {
    content: "🛒";
    font-size: 24px;
}

.subscription-order-history table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.subscription-order-history thead {
    background: #f8fafc;
}

.subscription-order-history thead th {
    text-align: left;
    padding: 16px 20px;
    font-weight: 600;
    color: #64748b;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e5e9f0;
}

.subscription-order-history tbody tr {
    transition: all 0.3s ease;
}

.subscription-order-history tbody tr:hover {
    background: #f8fafc;
}

.subscription-order-history tbody td {
    padding: 16px 20px;
    color: #334155;
    font-size: 14px;
    border-bottom: 1px solid #f1f5f9;
}

.subscription-order-history tbody td a {
    color: #29B6F6;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.subscription-order-history tbody td a:hover {
    color: #0288D1;
    text-decoration: underline;
}

/* Order type badge */
.order-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    background: #dbeafe;
    color: #1e40af;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.order-type-badge.renewal {
    background: #fef3c7;
    color: #92400e;
}

/* Responsive design */
@media (max-width: 1200px) {
    .subscription-container {
        grid-template-columns: 1fr;
    }
    
    .subscription-settings {
        position: static;
    }
}

@media (max-width: 768px) {
    .wrap.subscription-list-wrap,
    .wrap.subscription-details-wrap {
        padding: 20px;
        margin: 10px;
    }
    
    .subscription-list-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .subscription-filters {
        flex-direction: column;
    }
    
    .subscription-filter-group {
        width: 100%;
    }
    
    .widefat.subscription-table-modern {
        font-size: 12px;
    }
    
    .widefat.subscription-table-modern thead th,
    .widefat.subscription-table-modern tbody td {
        padding: 12px 10px;
    }
}

/* Loading state */
.subscription-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.subscription-loading::after {
    content: "";
    width: 40px;
    height: 40px;
    border: 4px solid #e5e9f0;
    border-top-color: #4FC3F7;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Success/Error messages */
.subscription-notice {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}

.subscription-notice.success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid #10b981;
}

.subscription-notice.error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

.subscription-notice::before {
    font-size: 20px;
}

.subscription-notice.success::before {
    content: "✓";
}

.subscription-notice.error::before {
    content: "⚠";
}

/* Print styles */
@media print {
    .subscription-filters,
    .subscription-settings,
    .tablenav {
        display: none;
    }
    
    .subscription-container {
        grid-template-columns: 1fr;
    }
}
