/**
 * Subcontractors Module Styles (Version 2.0.0)
 */

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: #fff;
    margin: 2% auto;
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    animation: slideDown 0.3s;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-content h3 {
    color: #667eea;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
}

.modal-content h4 {
    color: #2c3e50;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover,
.close:focus {
    color: #000;
}

/* Subcontractor Info Display */
.subcontractor-info {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.info-item {
    padding: 0.75rem;
    background: white;
    border-radius: 6px;
    border-left: 3px solid #667eea;
}

.info-item strong {
    display: block;
    color: #667eea;
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

/* Payment Section */
.payment-section {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    border: 2px solid #e9ecef;
    margin-bottom: 2rem;
}

.payment-section h4 {
    margin-top: 0;
}

/* Payment History */
.payment-history {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
}

.payment-history table {
    width: 100%;
    background: white;
}

.payment-history tfoot {
    background: #f0f0f0;
    font-weight: bold;
}

.payment-history tfoot td {
    padding: 1rem;
}

/* Responsive Design for Modal */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 5% auto;
        padding: 1rem;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
}

/* Additional button styles for subcontractors */
.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

.actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.actions .btn {
    margin: 0;
}

/* Status badges */
.badge {
    display: inline-block;
    padding: 0.35em 0.65em;
    font-size: 0.85em;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
}

.badge-success {
    background-color: #28a745;
    color: white;
}

.badge-secondary {
    background-color: #6c757d;
    color: white;
}

.badge-warning {
    background-color: #ffc107;
    color: #212529;
}

.badge-danger {
    background-color: #dc3545;
    color: white;
}

.badge-info {
    background-color: #17a2b8;
    color: white;
}

/* Button variants */
.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover {
    background: #138496;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background: #e0a800;
}

/**
 * T4A Slips Styles (Version 2.1.0)
 */

.t4a-info {
    background: #e7f3ff;
    border-left: 4px solid #667eea;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 6px;
}

.t4a-info p {
    margin: 0;
    color: #2c3e50;
}

.t4a-filters {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    margin-bottom: 2rem;
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.t4a-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.t4a-summary-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
}

.t4a-summary-header h3 {
    margin: 0 0 0.5rem 0;
}

.t4a-summary-header p {
    margin: 0;
    opacity: 0.95;
}

/* T4A Slip Card */
.t4a-slip {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    overflow: hidden;
    page-break-inside: avoid;
}

.t4a-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.t4a-header h4 {
    margin: 0;
    font-size: 1.2rem;
}

.t4a-year {
    background: rgba(255,255,255,0.2);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 600;
}

.t4a-body {
    padding: 2rem;
}

.t4a-section {
    margin-bottom: 2rem;
}

.t4a-section h5 {
    color: #667eea;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f0f0f0;
}

.t4a-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.t4a-field {
    background: #f8f9fa;
    padding: 0.75rem;
    border-radius: 6px;
}

.t4a-field.full-width {
    grid-column: 1 / -1;
}

.t4a-field label {
    display: block;
    font-size: 0.85rem;
    color: #667eea;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.t4a-field div {
    color: #2c3e50;
    font-weight: 500;
}

/* T4A Boxes */
.t4a-boxes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.t4a-box {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.t4a-box.highlight {
    background: linear-gradient(135deg, #e7f3ff 0%, #f0e7ff 100%);
    border-color: #667eea;
}

.box-number {
    font-size: 0.85rem;
    color: #667eea;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.box-label {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.box-amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
}

/* Payments Table */
.t4a-payments-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
}

.t4a-payments-table th {
    background: #f8f9fa;
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: #667eea;
    border-bottom: 2px solid #e9ecef;
}

.t4a-payments-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #f0f0f0;
}

.t4a-payments-table tbody tr:hover {
    background: #f8f9fa;
}

/* T4A Footer */
.t4a-footer {
    background: #f8f9fa;
    padding: 1rem 2rem;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    border-top: 2px solid #e9ecef;
}

/* T4A Summary */
.t4a-summary {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    overflow: hidden;
}

.summary-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
}

.summary-header h3 {
    margin: 0 0 1rem 0;
}

.company-info {
    background: rgba(255,255,255,0.1);
    padding: 1rem;
    border-radius: 8px;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    padding: 2rem;
    background: #f8f9fa;
}

.stat-box {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.stat-label {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #667eea;
}

.summary-table {
    padding: 2rem;
}

.summary-table h4 {
    color: #667eea;
    margin-bottom: 1rem;
}

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

.summary-table th {
    background: #667eea;
    color: white;
    padding: 1rem;
    text-align: left;
}

.summary-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f0f0f0;
}

.summary-table tbody tr:hover {
    background: #f8f9fa;
}

.summary-table tfoot {
    background: #f8f9fa;
    font-weight: bold;
}

.summary-table tfoot td {
    padding: 1rem;
}

.summary-footer {
    background: #f8f9fa;
    padding: 2rem;
    border-top: 2px solid #e9ecef;
}

.summary-footer p {
    margin: 0.5rem 0;
    color: #2c3e50;
}

.summary-footer button {
    margin-top: 1rem;
}

/* Responsive Design for T4A */
@media (max-width: 768px) {
    .t4a-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .t4a-boxes {
        grid-template-columns: 1fr;
    }
    
    .t4a-footer {
        flex-direction: column;
    }
    
    .summary-stats {
        grid-template-columns: 1fr;
    }
}

/* Print Styles for T4A */
@media print {
    .t4a-footer {
        display: none;
    }
    
    .t4a-slip {
        page-break-after: always;
    }
}
