/**
 * User Subscription Dashboard Styles
 * 
 * @package MP_Subscription_Manager
 * @since 1.0.0
 */

/* ===================================
   Dashboard Container
   =================================== */
.mpsub-dashboard-container {
    max-width: 1000px;
    margin: 40px auto;
    padding: 0 20px;
}

/* ===================================
   Dashboard Section
   =================================== */
.dashboard-section {
    margin-bottom: 40px;
}

.dashboard-section h2 {
    font-size: 28px;
    color: #111827;
    margin-bottom: 24px;
    font-weight: 600;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 12px;
}

/* ===================================
   Subscription Card
   =================================== */
.subscription-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.subscription-card.active {
    border: 2px solid #10b981;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
}

.subscription-card.inactive {
    border: 2px solid #e5e7eb;
}

/* ===================================
   Subscription Header
   =================================== */
.subscription-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 2px solid #d1fae5;
}

.subscription-card.inactive .subscription-header {
    border-bottom-color: #e5e7eb;
}

.plan-info h3 {
    font-size: 24px;
    color: #065f46;
    margin: 0 0 8px 0;
}

.subscription-card.inactive .plan-info h3 {
    color: #374151;
}

/* ===================================
   Status Badge
   =================================== */
.status-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.status-active {
    background: #10b981;
    color: #ffffff;
}

.status-badge.status-expired {
    background: #ef4444;
    color: #ffffff;
}

.status-badge.status-cancelled {
    background: #6b7280;
    color: #ffffff;
}

.status-badge.status-pending {
    background: #f59e0b;
    color: #ffffff;
}

/* ===================================
   Plan Price
   =================================== */
.plan-price {
    text-align: right;
    font-size: 32px;
    font-weight: 700;
    color: #059669;
}

.plan-price .currency {
    font-size: 18px;
    color: #6b7280;
    margin-left: 4px;
}

/* ===================================
   Subscription Details
   =================================== */
.subscription-details {
    margin-bottom: 24px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #e5e7eb;
}

.subscription-card.active .detail-row {
    border-bottom-color: #d1fae5;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row .label {
    font-weight: 600;
    color: #374151;
}

.detail-row .value {
    color: #6b7280;
}

.detail-row .value.highlight {
    color: #059669;
    font-weight: 600;
}

/* ===================================
   Subscription Progress
   =================================== */
.subscription-progress {
    margin: 24px 0;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
    border-radius: 6px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 13px;
    color: #6b7280;
    text-align: center;
    margin: 0;
}

/* ===================================
   Subscription Actions
   =================================== */
.subscription-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.subscription-actions .btn {
    flex: 1;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, #059669 0%, #0891b2 100%);
    color: #ffffff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

.btn-outline {
    background: #ffffff;
    color: #6b7280;
    border: 2px solid #e5e7eb;
}

.btn-outline:hover {
    border-color: #ef4444;
    color: #ef4444;
}

.btn-outline:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===================================
   Empty State
   =================================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 24px;
    color: #111827;
    margin-bottom: 12px;
}

.empty-state p {
    font-size: 16px;
    color: #6b7280;
    margin-bottom: 24px;
}

/* ===================================
   Orders Table
   =================================== */
.orders-table-container {
    overflow-x: auto;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.orders-table {
    width: 100%;
    border-collapse: collapse;
}

.orders-table thead {
    background: #f9fafb;
}

.orders-table th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e5e7eb;
}

.orders-table td {
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
    color: #6b7280;
    font-size: 15px;
}

.orders-table tbody tr:hover {
    background: #f9fafb;
}

.orders-table tbody tr:last-child td {
    border-bottom: none;
}

/* Order Number */
.order-number {
    font-weight: 600;
    color: #374151;
    font-family: monospace;
}

/* Status Badge in Table */
.orders-table .status-badge {
    font-size: 11px;
    padding: 4px 10px;
}

/* ===================================
   Order Actions
   =================================== */
.order-actions {
    display: flex;
    gap: 8px;
}

.btn-view-order,
.btn-download-invoice {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    color: #059669;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-view-order:hover {
    background: #f0fdf4;
    border-color: #059669;
}

.btn-download-invoice {
    color: #0891b2;
}

.btn-download-invoice:hover {
    background: #ecfeff;
    border-color: #0891b2;
}

/* ===================================
   Modal
   =================================== */
.mpsub-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    position: relative;
    background: #ffffff;
    border-radius: 12px;
    max-width: 600px;
    margin: 80px auto;
    padding: 32px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e5e7eb;
}

.modal-header h3 {
    font-size: 22px;
    color: #111827;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #6b7280;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #f3f4f6;
    color: #111827;
}

.modal-body {
    color: #374151;
    line-height: 1.6;
}

/* ===================================
   Order Details in Modal
   =================================== */
.order-details {
    background: #f9fafb;
    border-radius: 8px;
    padding: 20px;
}

.order-details p {
    margin: 12px 0;
    display: flex;
    justify-content: space-between;
}

.order-details strong {
    color: #374151;
}

.order-details .error {
    color: #ef4444;
    text-align: center;
}

/* ===================================
   Pagination
   =================================== */
.dashboard-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.pagination-link {
    padding: 8px 14px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    color: #374151;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.pagination-link:hover {
    background: #f9fafb;
    border-color: #059669;
    color: #059669;
}

.pagination-link.active {
    background: #059669;
    border-color: #059669;
    color: #ffffff;
}

.pagination-link.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ===================================
   Alerts
   =================================== */
.dashboard-alert {
    padding: 14px 20px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 15px;
}

.dashboard-alert.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border-left: 4px solid #f59e0b;
}

.dashboard-alert.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid #3b82f6;
}

.dashboard-alert.alert-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid #10b981;
}

/* ===================================
   Responsive Design
   =================================== */
@media (max-width: 768px) {
    .mpsub-dashboard-container {
        padding: 0 16px;
    }

    .subscription-header {
        flex-direction: column;
        gap: 16px;
    }

    .plan-price {
        text-align: left;
        font-size: 28px;
    }

    .subscription-actions {
        flex-direction: column;
    }

    .subscription-actions .btn {
        width: 100%;
    }

    .dashboard-section h2 {
        font-size: 24px;
    }

    .orders-table-container {
        border-radius: 8px;
    }

    .orders-table {
        font-size: 14px;
    }

    .orders-table th,
    .orders-table td {
        padding: 12px 8px;
    }

    .order-actions {
        flex-direction: column;
    }

    .modal-content {
        margin: 20px;
        padding: 24px;
    }
}

@media (max-width: 480px) {
    .subscription-card {
        padding: 20px;
    }

    .orders-table th {
        font-size: 12px;
        padding: 10px 6px;
    }

    .orders-table td {
        font-size: 13px;
        padding: 10px 6px;
    }

    .btn-view-order,
    .btn-download-invoice {
        font-size: 12px;
        padding: 5px 10px;
    }
}
