/**
  * @package     SMP Student Portal Enhancer
 * @version     2.6.0
 * @filepath    /wp-content/plugins/smp-portal-enhancer/assets/fee-invoices.css
 */

/* Fee Invoices Styling - SMP Portal Enhancer v2.2.0 */

.spe-fee-invoice-container {
    max-width: 900px;
    margin: 20px auto;
    background: #fff;
    border: 2px solid #0073aa;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    overflow: hidden;
}

.spe-invoice-header {
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    color: #fff;
    padding: 25px 30px;
    border-bottom: 4px solid #004d6d;
}

.spe-invoice-header h2 {
    margin: 0 0 10px 0;
    font-size: 24px;
    font-weight: 700;
    color: #fff;
}

.spe-invoice-meta {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    opacity: 0.95;
}

.spe-invoice-meta span {
    display: inline-block;
}

.spe-invoice-body {
    padding: 30px;
}

/* Invoice Sections */
.spe-invoice-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.spe-invoice-section:last-of-type {
    border-bottom: none;
}

.spe-invoice-section h3 {
    font-size: 18px;
    margin: 0 0 15px 0;
    color: #333;
    font-weight: 600;
}

/* Previous Outstanding Section */
.spe-previous-outstanding {
    background: #fff8e5;
    border-left: 4px solid #dba617;
    padding: 20px;
    margin: 0 0 25px 0;
    border-radius: 4px;
}

.spe-previous-outstanding h3 {
    color: #826200;
    margin-bottom: 15px;
}

/* Current Term Fees Section */
.spe-current-term-fees {
    background: #f0f8ff;
    border-left: 4px solid #0073aa;
    padding: 20px;
    border-radius: 4px;
}

.spe-current-term-fees h3 {
    color: #0073aa;
}

/* Fee List */
.spe-fee-list {
    background: #fff;
    border-radius: 4px;
    padding: 15px;
}

.spe-fee-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    margin: 5px 0;
    border-radius: 4px;
    transition: background 0.2s;
}

.spe-fee-row:hover {
    background: #f7f7f7;
}

.spe-fee-label {
    font-size: 15px;
    color: #333;
    flex: 1;
}

.spe-fee-amount {
    font-size: 16px;
    font-weight: 600;
    color: #0073aa;
    text-align: right;
    min-width: 120px;
}

/* Fee Row Variants */
.spe-fee-subtotal {
    background: #e7f5fe;
    border-top: 2px solid #0073aa;
    margin-top: 10px;
}

.spe-fee-subtotal .spe-fee-label {
    font-weight: 600;
}

.spe-fee-total {
    background: #fff8e5;
    border-left: 4px solid #dba617;
}

.spe-fee-total .spe-fee-amount {
    color: #826200;
}

/* Invoice Totals Section */
.spe-invoice-totals {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 4px;
    margin-top: 25px;
}

.spe-fee-total-row {
    padding: 10px 15px;
    background: #fff;
}

.spe-fee-paid-row {
    padding: 10px 15px;
    background: #e7f7e7;
    border-left: 4px solid #00a32a;
}

.spe-fee-paid-row .spe-fee-amount {
    color: #00731f;
}

.spe-fee-outstanding-row {
    padding: 15px 20px;
    background: #0073aa;
    color: #fff;
    border-radius: 4px;
    margin-top: 10px;
}

.spe-fee-outstanding-row .spe-fee-label,
.spe-fee-outstanding-row .spe-fee-amount {
    color: #fff;
    font-size: 18px;
}

.spe-fee-amount.spe-outstanding {
    font-size: 22px;
}

/* Invoice Actions */
.spe-invoice-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    padding-top: 25px;
    border-top: 2px solid #e0e0e0;
}

.spe-btn {
    flex: 1;
    padding: 15px 25px;
    text-align: center;
    text-decoration: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-block;
    cursor: pointer;
    border: none;
}

.spe-btn-primary {
    background: #00a32a;
    color: #fff;
}

.spe-btn-primary:hover {
    background: #008a20;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,163,42,0.3);
}

.spe-btn-secondary {
    background: #fff;
    color: #0073aa;
    border: 2px solid #0073aa;
}

.spe-btn-secondary:hover {
    background: #0073aa;
    color: #fff;
}

/* Paid Notice */
.spe-invoice-paid-notice {
    background: #e7f7e7;
    border: 2px solid #00a32a;
    border-radius: 6px;
    padding: 20px;
    text-align: center;
    margin-top: 20px;
}

.spe-invoice-paid-notice p {
    margin: 0;
    font-size: 18px;
    color: #00731f;
}

/* All Terms Breakdown */
.spe-all-terms-breakdown {
    margin-top: 30px;
    padding: 25px;
    background: #f9f9f9;
    border-radius: 6px;
    border: 2px dashed #ccc;
}

.spe-all-terms-breakdown h3 {
    margin-top: 0;
    color: #333;
    font-size: 20px;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

.spe-term-section {
    background: #fff;
    padding: 20px;
    margin: 15px 0;
    border-radius: 4px;
    border-left: 4px solid #0073aa;
}

.spe-term-section h4 {
    margin: 0 0 15px 0;
    color: #0073aa;
    font-size: 16px;
    font-weight: 600;
}

/* Error Styling */
.spe-error {
    background: #fcf0f1;
    border: 2px solid #d63638;
    border-radius: 6px;
    padding: 20px;
    color: #d63638;
    text-align: center;
    margin: 20px 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .spe-fee-invoice-container {
        margin: 10px;
        border-radius: 4px;
    }
    
    .spe-invoice-header {
        padding: 20px;
    }
    
    .spe-invoice-header h2 {
        font-size: 20px;
    }
    
    .spe-invoice-meta {
        flex-direction: column;
        gap: 5px;
    }
    
    .spe-invoice-body {
        padding: 20px 15px;
    }
    
    .spe-fee-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .spe-fee-amount {
        text-align: left;
        width: 100%;
    }
    
    .spe-invoice-actions {
        flex-direction: column;
    }
    
    .spe-btn {
        width: 100%;
    }
    
    .spe-all-terms-breakdown {
        padding: 15px;
    }
}

/* Print Styles */
@media print {
    .spe-invoice-actions,
    .spe-btn,
    .spe-toggle-all-terms {
        display: none !important;
    }
    
    .spe-all-terms-breakdown {
        display: block !important;
        border: 1px solid #ccc;
    }
    
    .spe-fee-invoice-container {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .spe-invoice-header {
        background: #f0f0f0 !important;
        color: #000 !important;
    }
}

/* Loading Animation */
.spe-loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.spe-loading::after {
    content: "...";
    animation: spe-dots 1.5s steps(4, end) infinite;
}

@keyframes spe-dots {
    0%, 20% { content: "."; }
    40% { content: ".."; }
    60%, 100% { content: "..."; }
}
