/**
 * Carpentry Manager Frontend Styles
 */

/* General Frontend Styles */
.carpentry-single-work-request,
.carpentry-single-quotation,
.carpentry-single-invoice,
.carpentry-archive-work-requests,
.carpentry-archive-quotations,
.carpentry-archive-invoices {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    background: #f8f9fa;
    min-height: 100vh;
}

/* Archive Headers */
.archive-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 20px;
    background: linear-gradient(135deg, #2684FF, #1a6fd9);
    color: white;
    border-radius: 12px;
}

.archive-title {
    font-size: 2.5rem;
    margin: 0 0 16px 0;
    font-weight: 700;
}

.archive-description {
    font-size: 1.1rem;
    margin: 0;
    opacity: 0.9;
}

/* Single Post Headers */
.work-request-header,
.quotation-header,
.invoice-header {
    margin-bottom: 2rem;
    padding: 2rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #2684FF;
    position: relative;
    overflow: hidden;
}

.work-request-header::before,
.quotation-header::before,
.invoice-header::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, rgba(38, 132, 255, 0.1), rgba(38, 132, 255, 0.05));
    border-radius: 50%;
    transform: translate(30px, -30px);
}

.work-request-meta,
.quotation-meta,
.invoice-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.work-request-number,
.quotation-number,
.invoice-number {
    background: #f8f9fa;
    color: #495057;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
}

.work-request-title,
.quotation-title,
.invoice-title {
    margin: 0;
    font-size: 2rem;
    color: #333;
    font-weight: 700;
}

/* Status Badges */
.status-badge {
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-new { background: #e9ecef; color: #495057; }
.status-quotation-needed { background: #fff3cd; color: #856404; }
.status-in-review { background: #d1ecf1; color: #0c5460; }
.status-approved { background: #d4edda; color: #155724; }
.status-in-progress { background: #cce5ff; color: #004085; }
.status-completed { background: #d4edda; color: #155724; }
.status-draft { background: #e9ecef; color: #495057; }
.status-under-review { background: #fff3cd; color: #856404; }
.status-sent { background: #cce5ff; color: #004085; }
.status-unpaid { background: #f8d7da; color: #721c24; }
.status-paid { background: #d4edda; color: #155724; }
.status-overdue { background: #f8d7da; color: #721c24; }

/* Content Layout - Single Column */
.work-request-content,
.quotation-content,
.invoice-content {
    display: block !important;
    max-width: 1200px !important;
    margin: 0 auto !important;
    min-height: 400px !important;
}



.work-request-details,
.quotation-details,
.invoice-details {
    border-radius: 8px !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
    min-height: 400px !important;
}

/* Detail Sections */
.detail-section {
    background: #fff !important;
    padding: 30px;
    border-bottom: 1px solid #e9ecef;
    border-radius: 8px !important;
    margin-bottom: 1.5rem !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
}

.detail-section:last-child {
    border-bottom: none;
}

.detail-section h3,
.section-title {
    margin: 0 0 20px 0;
    font-size: 1.25rem;
    color: #172B4D;
    font-weight: 600;
    border-bottom: 2px solid #2684FF;
    padding-bottom: 8px;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail-item.full-width {
    grid-column: 1 / -1;
}

.detail-item label {
    font-weight: 600;
    color: #666;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-item span {
    color: #333;
    font-size: 16px;
    line-height: 1.5;
}

/* Items Tables */
.quotation-items-table,
.invoice-items-table {
    margin-top: 20px;
}

.items-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.items-table th {
    background: #f8f9fa;
    color: #495057;
    font-weight: 600;
    padding: 16px;
    text-align: left;
    border-bottom: 2px solid #e9ecef;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.items-table td {
    padding: 16px;
    border-bottom: 1px solid #e9ecef;
    vertical-align: top;
}

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

.items-table tfoot tr {
    background: #f8f9fa;
    font-weight: 600;
}

.items-table .subtotal-row,
.items-table .tax-row,
.items-table .paid-row,
.items-table .balance-row {
    border-top: 2px solid #e9ecef;
}

.items-table .total-row {
    background: #2684FF;
    color: white;
}

.items-table .balance-row.outstanding {
    background: #dc3545;
    color: white;
}

.grand-total,
.balance-due.outstanding {
    font-size: 1.1rem;
    font-weight: 700;
}

/* Images */
.work-request-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.image-item {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.work-request-image {
    width: 100%;
    height: auto;
    display: block;
}

/* Related Items */
.related-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.related-item {
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
}

.related-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    text-decoration: none;
    color: #333;
    transition: all 0.2s ease;
}

.related-link:hover {
    background: #e9ecef;
    transform: translateX(4px);
}

.related-title {
    font-weight: 600;
}

/* Terms & Conditions */
.terms-conditions ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.terms-conditions li {
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
    position: relative;
    padding-left: 20px;
}

.terms-conditions li:before {
    content: "•";
    color: #2684FF;
    font-weight: bold;
    position: absolute;
    left: 0;
}

.terms-conditions li:last-child {
    border-bottom: none;
}

/* Payment Instructions */
.payment-instructions {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #2684FF;
}

.payment-instructions-content {
    color: #495057;
    line-height: 1.6;
    font-size: 14px;
}

.payment-instructions-content p {
    margin: 0 0 12px 0;
}

.payment-instructions-content p:last-child {
    margin-bottom: 0;
}

.payment-details h4 {
    margin: 20px 0 12px 0;
    color: #333;
}

.payment-details ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.payment-details li {
    padding: 4px 0;
}

.payment-reminder {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    padding: 16px;
    border-radius: 8px;
    margin-top: 20px;
}

.payment-complete {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    padding: 16px;
    border-radius: 8px;
    margin-top: 20px;
}

.overdue-notice {
    color: #721c24;
    font-weight: 600;
}

.paid-notice {
    color: #155724;
    font-weight: 600;
}

/* Sidebar */
.work-request-sidebar,
.quotation-sidebar,
.invoice-sidebar {
    display: flex !important;
    flex-direction: column !important;
    gap: 20px !important;
    min-height: 400px !important;
    width: 300px !important;
}

.sidebar-widget {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.sidebar-widget h4 {
    margin: 0;
    padding: 20px 20px 16px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
}

.request-info,
.quotation-info,
.invoice-info {
    list-style: none;
    padding: 20px;
    margin: 0;
}

.request-info li,
.quotation-info li,
.invoice-info li {
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
    font-size: 14px;
}

.request-info li:last-child,
.quotation-info li:last-child,
.invoice-info li:last-child {
    border-bottom: none;
}

/* Payment Summary */
.payment-summary {
    border-left: 4px solid #dc3545;
}

.payment-breakdown {
    padding: 20px;
}

.payment-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

.payment-item:last-child {
    border-bottom: none;
}

.payment-item.outstanding {
    color: #dc3545;
    font-weight: 600;
    font-size: 1.1rem;
}

/* Action Buttons */
.action-buttons {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.button {
    display: inline-block;
    padding: 12px 20px;
    background: #6c757d;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    text-align: center;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

.button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    color: white;
    text-decoration: none;
}

.button-primary {
    background: #2684FF;
}

.button-primary:hover {
    background: #1a6fd9;
}

/* Archive Grid */
.work-requests-grid,
.quotations-grid,
.invoices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

/* Card Styles */
.work-request-card,
.quotation-card,
.invoice-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.2s ease;
    border-left: 4px solid #2684FF;
}

.work-request-card:hover,
.quotation-card:hover,
.invoice-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.card-header {
    padding: 24px 24px 16px;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.card-title {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
}

.card-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.2s ease;
}

.card-title a:hover {
    color: #2684FF;
}

.card-content {
    padding: 0 24px 16px;
}

.customer-info,
.scope-info {
    margin-bottom: 12px;
    font-size: 14px;
    color: #666;
}

.quotation-total,
.invoice-amounts {
    margin-top: 16px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 14px;
}

.amount-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.amount-item:last-child {
    margin-bottom: 0;
}

.amount-item.balance.outstanding {
    color: #dc3545;
    font-weight: 600;
}

.amount-item.balance.paid {
    color: #28a745;
    font-weight: 600;
}

.card-excerpt {
    margin-top: 12px;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

.card-footer {
    padding: 16px 24px 24px;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
}

.card-dates {
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
    font-size: 12px;
    color: #666;
}

.created-date,
.invoice-date,
.completion-date,
.valid-until,
.due-date {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.overdue,
.expired {
    color: #dc3545;
    font-weight: 600;
}

.overdue-indicator,
.expired-indicator {
    background: #dc3545;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    margin-left: 8px;
}

.card-actions {
    display: flex;
    gap: 12px;
}

.card-actions .button {
    flex: 1;
    font-size: 12px;
    padding: 8px 12px;
}

/* No Posts Found */
.no-posts-found {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.no-posts-found h2 {
    color: #666;
    margin-bottom: 16px;
}

.no-posts-found p {
    color: #888;
    margin-bottom: 24px;
}

/* Pagination */
.archive-pagination {
    text-align: center;
    margin-top: 40px;
}

.archive-pagination .page-numbers {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 4px;
    background: #fff;
    color: #333;
    text-decoration: none;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

.archive-pagination .page-numbers:hover,
.archive-pagination .page-numbers.current {
    background: #2684FF;
    color: white;
    border-color: #2684FF;
}

/* Responsive Design */
@media (max-width: 480px) {
    .carpentry-single-work-request,
    .carpentry-single-quotation,
    .carpentry-single-invoice {
        padding: 1rem;
    }
    
    .work-request-content,
    .quotation-content,
    .invoice-content {
        grid-template-columns: 1fr !important;
    }
    
    .work-request-sidebar,
    .quotation-sidebar,
    .invoice-sidebar {
        order: -1;
    }
    
    
    .detail-grid {
        grid-template-columns: 1fr;
    }
    
    .work-requests-grid,
    .quotations-grid,
    .invoices-grid {
        grid-template-columns: 1fr;
    }
    
    .card-dates {
        flex-direction: column;
        gap: 8px;
    }
    
    .card-actions {
        flex-direction: column;
    }
    
    .archive-title {
        font-size: 2rem;
    }
    
    .work-request-title,
    .quotation-title,
    .invoice-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .carpentry-single-work-request,
    .carpentry-single-quotation,
    .carpentry-single-invoice,
    .carpentry-archive-work-requests,
    .carpentry-archive-quotations,
    .carpentry-archive-invoices {
        padding: 10px;
    }
    
    .work-request-header,
    .quotation-header,
    .invoice-header {
        padding: 20px;
    }
    
    .detail-section {
        padding: 20px;
    }
    
    .card-header,
    .card-content,
    .card-footer {
        padding: 16px;
    }
    
    .items-table th,
    .items-table td {
        padding: 8px;
        font-size: 12px;
    }
}

/* Print Styles */
@media print {
    .work-request-sidebar,
    .quotation-sidebar,
    .invoice-sidebar,
    .action-buttons,
    .card-actions {
        display: none !important;
    }
    
    .work-request-content,
    .quotation-content,
    .invoice-content {
        grid-template-columns: 1fr;
    }
    
    .items-table {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
