/* Student Account Styles for Tutor Installments */
/* File Path: assets/css/account.css */

.tutor-installments-account {
    padding: 20px 0;
}

.tutor-installments-account h2 {
    margin-bottom: 25px;
    font-size: 24px;
}

/* Installment Plan Card */
.installment-plan {
    margin-bottom: 30px;
    padding: 25px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.installment-plan.cancelled-plan {
    border-color: #999;
    opacity: 0.95;
}

.plan-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.plan-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.plan-status {
    padding: 6px 12px;
    border-radius: 3px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
}

.plan-status.status-active {
    background: #46b450;
    color: #fff;
}

.plan-status.status-suspended {
    background: #dc3232;
    color: #fff;
}

.plan-status.status-completed {
    background: #00a0d2;
    color: #fff;
}

.plan-status.status-cancelled {
    background: #999;
    color: #fff;
}

/* MEMBERSHIP INTEGRATION: Paused status styling */
.plan-status.paused {
    background: #2196F3;
    color: #fff;
}

/* ========================================
   CANCELLATION NOTICE STYLING
   ======================================== */

.cancellation-notice {
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
    border: 2px solid;
}

.cancellation-notice.retain_access {
    background: #e7f3e7;
    border-color: #46b450;
}

.cancellation-notice.revoke_access {
    background: #fff3cd;
    border-color: #ffc107;
}

.cancellation-notice-header {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.cancellation-icon {
    font-size: 32px;
    line-height: 1;
    flex-shrink: 0;
}

.cancellation-notice.retain_access .cancellation-icon {
    color: #2e7d32;
}

.cancellation-notice.revoke_access .cancellation-icon {
    color: #856404;
}

.cancellation-notice-content {
    flex: 1;
}

.cancellation-notice h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 600;
}

.cancellation-notice.retain_access h4 {
    color: #2e7d32;
}

.cancellation-notice.revoke_access h4 {
    color: #856404;
}

.cancellation-notice p {
    margin: 0 0 15px 0;
    line-height: 1.6;
}

.cancellation-notice.retain_access p {
    color: #1b5e20;
}

.cancellation-notice.revoke_access p {
    color: #663c00;
}

.cancellation-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(0,0,0,0.1);
}

.cancellation-date {
    font-size: 13px;
}

.cancellation-date strong {
    font-weight: 600;
    margin-right: 5px;
}

.cancellation-notice.retain_access .cancellation-date {
    color: #2e7d32;
}

.cancellation-notice.revoke_access .cancellation-date {
    color: #856404;
}

.view-course-btn {
    background: #46b450 !important;
    border-color: #46b450 !important;
    color: #fff !important;
    padding: 8px 16px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    border-radius: 4px !important;
    display: inline-block !important;
    transition: all 0.2s ease !important;
}

.view-course-btn:hover {
    background: #3a9943 !important;
    border-color: #3a9943 !important;
}

/* MEMBERSHIP INTEGRATION: Membership pause notice */
.membership-pause-notice {
    background: #e7f3ff;
    border: 2px solid #2196F3;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.membership-pause-notice h4 {
    margin: 0 0 10px 0;
    color: #1976D2;
    font-size: 16px;
    font-weight: 600;
}

.membership-pause-notice p {
    margin: 0 0 15px 0;
    color: #0D47A1;
    line-height: 1.6;
}

/* Plan Info */
.plan-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.info-item {
    padding: 15px;
    background: #f9f9f9;
    border-radius: 4px;
}

.info-item .label {
    display: block;
    font-size: 13px;
    color: #666;
    margin-bottom: 5px;
}

.info-item .value {
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

/* Payment Progress */
.progress-bar {
    height: 25px;
    background: #f0f0f0;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #46b450, #5bc862);
    transition: width 0.5s ease;
}

/* Installments Table */
.installments-table {
    overflow-x: auto;
    margin-bottom: 20px;
}

.installments-table table {
    width: 100%;
    border-collapse: collapse;
}

.installments-table th {
    background: #f5f5f5;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #ddd;
}

.installments-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
}

.installments-table tr:hover {
    background: #f9f9f9;
}

.installment-row.status-paid {
    opacity: 0.7;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
    display: inline-block;
}

.status-badge.status-paid {
    background: #46b450;
    color: #fff;
}

.status-badge.status-pending {
    background: #ffb900;
    color: #fff;
}

.status-badge.status-overdue {
    background: #dc3232;
    color: #fff;
}

.status-badge.status-cancelled {
    background: #999;
    color: #fff;
}

.cancelled-text {
    color: #999;
    font-style: italic;
}

/* MEMBERSHIP INTEGRATION: Paused payment button styling */
.pay-installment-btn {
    padding: 8px 16px !important;
    font-size: 13px !important;
    line-height: 1 !important;
}

.pay-installment-btn.paused-payment {
    background: #2196F3 !important;
    border-color: #2196F3 !important;
    opacity: 0.8;
}

.pay-installment-btn.paused-payment:hover {
    opacity: 1;
}

/* Plan Notice */
.plan-notice {
    padding: 15px;
    border-radius: 4px;
    margin-top: 20px;
}

.plan-notice.notice-error {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
}

.plan-notice p {
    margin: 5px 0;
}

.plan-notice strong {
    color: #dc3232;
}

/* Responsive Design */
@media (max-width: 768px) {
    .plan-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .plan-info {
        grid-template-columns: 1fr;
    }
    
    .installments-table {
        font-size: 13px;
    }
    
    .installments-table th,
    .installments-table td {
        padding: 8px 6px;
    }
    
    .installments-table th:nth-child(3),
    .installments-table td:nth-child(3) {
        display: none;
    }
    
    /* MEMBERSHIP INTEGRATION: Responsive pause notice */
    .membership-pause-notice {
        padding: 15px;
    }
    
    /* Cancellation notice responsive */
    .cancellation-notice {
        padding: 15px;
    }
    
    .cancellation-notice-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .cancellation-icon {
        font-size: 24px;
    }
    
    .cancellation-meta {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .installment-plan {
        padding: 15px;
    }
    
    .installments-table {
        font-size: 12px;
    }
    
    .installments-table th:nth-child(2),
    .installments-table td:nth-child(2) {
        display: none;
    }
    
    .cancellation-notice h4 {
        font-size: 14px;
    }
    
    .cancellation-notice p {
        font-size: 13px;
    }
}

/* ========================================
   TUTOR DASHBOARD OVERRIDES
   Scoped to .tutor-installments-account so
   My Account page is completely unaffected
   ======================================== */

/* Plan summary: make tutor-row/tutor-col-4 behave as a flex grid */
.tutor-installments-account .plan-summary .tutor-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 0;
}

.tutor-installments-account .plan-summary .tutor-col-4 {
    flex: 1 1 calc(33.333% - 10px);
    min-width: 120px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 4px;
    box-sizing: border-box;
}

/* Pause notice info items: white background looks better inside the blue box */
.membership-pause-notice .plan-info {
    margin-top: 15px;
}

.membership-pause-notice .info-item {
    background: rgba(255, 255, 255, 0.6);
}

.membership-pause-notice .info-item .label {
    color: #1565C0;
}

.membership-pause-notice .info-item .value {
    color: #0D47A1;
    font-size: 15px;
}

/* What happens next box inside pause notice */
.membership-pause-notice .plan-notice.notice-error {
    margin-top: 15px;
    background: #fff8e1;
    border-color: #ffc107;
    color: #5d4037;
}

.membership-pause-notice .plan-notice.notice-error strong {
    color: #e65100;
}

@media (max-width: 640px) {
    .tutor-installments-account .plan-summary .tutor-col-4 {
        flex: 1 1 100%;
    }
}
/* ========================================
   TUTOR DASHBOARD — CLASS-BASED OVERRIDES
   These target the new HTML structure used
   by class-tutor-dashboard.php. All rules
   are scoped so the My Account page is
   completely unaffected.
   ======================================== */

/* --- Plan card (replaces old .installment-plan plain div) --- */
.installment-plan.tutor-dashboard-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

/* --- Plan header: title left, status badge right, underline separator --- */
.installment-plan.tutor-dashboard-card .plan-header {
    display: block;           /* override old flex — the wrapper handles layout */
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 16px;
    margin-bottom: 0;
}

.plan-header .plan-title-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

/* --- Status badge (new HTML uses .plan-status.tutor-badge-label) --- */
.plan-status.tutor-badge-label {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

/* Override account.css solid colours with Tutor-style soft tones */
.plan-status.tutor-badge-label.status-active {
    background: #d1fae5;
    color: #065f46;
}
.plan-status.tutor-badge-label.status-suspended {
    background: #fee2e2;
    color: #991b1b;
}
.plan-status.tutor-badge-label.status-completed {
    background: #dbeafe;
    color: #1e40af;
}
.plan-status.tutor-badge-label.status-cancelled {
    background: #e5e7eb;
    color: #6b7280;
}
.plan-status.tutor-badge-label.paused {
    background: #dbeafe;
    color: #1e40af;
}

/* --- Plan summary stats grid (tutor-row / tutor-col-4) --- */
.plan-summary .tutor-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 0;
}

.plan-summary .tutor-col-4 {
    flex: 1 1 calc(33.333% - 10px);
    min-width: 130px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 4px;
    box-sizing: border-box;
}

.plan-summary .summary-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* --- Progress bar (new HTML: .tutor-progress-bar / .tutor-progress-filled) --- */
.payment-progress .tutor-progress-bar {
    height: 12px;
    background: #f3f4f6;
    border-radius: 6px;
    overflow: hidden;
}

.payment-progress .tutor-progress-filled {
    height: 100%;
    background: linear-gradient(90deg, #46b450 0%, #5bc862 100%);
    transition: width 0.4s ease;
}

/* --- Installments table (new HTML uses .tutor-table inside .tutor-table-responsive) --- */
.installments-table .tutor-table-responsive {
    overflow-x: auto;
}

.installments-table .tutor-table {
    width: 100%;
    border-collapse: collapse;
}

.installments-table .tutor-table thead th {
    background: #f5f5f5;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #ddd;
}

.installments-table .tutor-table tbody td {
    padding: 12px;
    border-bottom: 1px solid #eee;
}

.installments-table .tutor-table tbody tr:hover {
    background: #f9f9f9;
}

/* Status badges inside the new table */
.installments-table .status-badge.label-success {
    background: #d1fae5;
    color: #065f46;
}
.installments-table .status-badge.label-warning {
    background: #fef3c7;
    color: #92400e;
}
.installments-table .status-badge.label-danger {
    background: #fee2e2;
    color: #991b1b;
}

/* --- Membership pause notice (inside .tutor-dashboard-card) --- */
.installment-plan.tutor-dashboard-card .membership-pause-notice {
    border-radius: 8px;
    padding: 20px;
    margin-top: 16px;
    background: #e7f3ff;
    border: 2px solid #2196F3;
}

.installment-plan.tutor-dashboard-card .membership-pause-notice h4 {
    margin: 0 0 10px 0;
    color: #1976D2;
    font-size: 16px;
    font-weight: 600;
}

.installment-plan.tutor-dashboard-card .membership-pause-notice > p {
    margin: 0 0 15px 0;
    color: #0D47A1;
    line-height: 1.6;
}

/* .plan-info grid inside the pause notice */
.installment-plan.tutor-dashboard-card .membership-pause-notice .plan-info {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 15px;
}

.installment-plan.tutor-dashboard-card .membership-pause-notice .info-item {
    flex: 1 1 calc(33.333% - 8px);
    min-width: 110px;
    padding: 12px;
    background: rgba(255,255,255,0.6);
    border-radius: 4px;
    box-sizing: border-box;
}

.installment-plan.tutor-dashboard-card .membership-pause-notice .info-item .label {
    color: #1565C0;
}

.installment-plan.tutor-dashboard-card .membership-pause-notice .info-item .value {
    color: #0D47A1;
    font-size: 15px;
}

/* "What happens next" notice box inside the pause notice */
.installment-plan.tutor-dashboard-card .membership-pause-notice .plan-notice.notice-error {
    background: #fff8e1;
    border: 1px solid #ffc107;
    color: #5d4037;
    margin-top: 0;
}

.installment-plan.tutor-dashboard-card .membership-pause-notice .plan-notice.notice-error strong {
    color: #e65100;
}

/* --- Tutor alert variants used in the new HTML --- */
.tutor-alert.tutor-success {
    background: #ecfdf5;
    border-color: #d1fae5;
}
.tutor-alert.tutor-warning {
    background: #fffbeb;
    border-color: #fef3c7;
}
.tutor-alert.tutor-danger {
    background: #fef2f2;
    border-color: #fee2e2;
}
.tutor-alert.tutor-info {
    background: #eff6ff;
    border-color: #dbeafe;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .plan-summary .tutor-row {
        flex-direction: column;
    }
    .plan-summary .tutor-col-4 {
        flex: 1 1 100%;
    }
    .installment-plan.tutor-dashboard-card .membership-pause-notice .plan-info {
        flex-direction: column;
    }
    .installment-plan.tutor-dashboard-card .membership-pause-notice .info-item {
        flex: 1 1 100%;
    }
}

@media (max-width: 640px) {
    .installment-plan.tutor-dashboard-card {
        padding: 16px;
    }
    .installment-plan.tutor-dashboard-card .membership-pause-notice {
        padding: 15px;
    }
}