/* Invoice Tracker Frontend Styles */

.invoice-tracker-frontend {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    line-height: 1.6;
    color: #333;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Invoice Display */
.invoice-container {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    overflow: hidden;
    margin: 20px 0;
}

.invoice-header {
    background: linear-gradient(135deg, #2271b1, #135e96);
    color: #fff;
    padding: 30px;
    text-align: center;
}

.invoice-header h1 {
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 700;
}

.invoice-header .company-info {
    font-size: 14px;
    opacity: 0.9;
    margin-top: 10px;
}

.invoice-details {
    padding: 30px;
}

.invoice-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.invoice-meta h3 {
    margin: 0 0 15px 0;
    color: #2271b1;
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.invoice-meta p {
    margin: 5px 0;
    color: #666;
}

.invoice-items {
    margin: 30px 0;
}

.invoice-items h3 {
    margin: 0 0 20px 0;
    color: #2271b1;
    font-size: 18px;
    font-weight: 600;
}

.items-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.items-table th {
    background: #f8f9fa;
    color: #333;
    font-weight: 600;
    padding: 15px;
    text-align: left;
    border-bottom: 2px solid #e0e0e0;
}

.items-table td {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.items-table tr:nth-child(even) {
    background: #f8f9fa;
}

.items-table tr:hover {
    background: #e3f2fd;
}

.item-name {
    font-weight: 600;
    color: #333;
}

.item-description {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

.item-quantity,
.item-price,
.item-total {
    text-align: right;
    font-weight: 500;
}

/* Invoice Summary */
.invoice-summary {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 25px;
    margin: 30px 0;
}

.summary-table {
    width: 100%;
    font-size: 16px;
}

.summary-table td {
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
}

.summary-row {
    font-weight: 500;
}

.total-row {
    border-top: 3px solid #2271b1;
    font-size: 18px;
    font-weight: 700;
    background: #fff;
    margin-top: 15px;
    padding: 15px;
    border-radius: 6px;
    color: #2271b1;
}

.amount {
    text-align: right;
    font-weight: 600;
}

/* Invoice Footer */
.invoice-footer {
    background: #f8f9fa;
    padding: 25px 30px;
    border-top: 1px solid #e0e0e0;
    text-align: center;
    color: #666;
    font-size: 14px;
}

/* Status Badge */
.invoice-status {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 10px 0;
}

.status-draft {
    background: #f0f0f1;
    color: #50575e;
}

.status-sent {
    background: #cce5ff;
    color: #0073aa;
}

.status-paid {
    background: #d1e7dd;
    color: #0f5132;
}

.status-overdue {
    background: #f8d7da;
    color: #721c24;
}

/* Action Buttons */
.invoice-actions {
    margin: 30px 0;
    text-align: center;
}

.invoice-actions .button {
    display: inline-block;
    padding: 12px 24px;
    margin: 0 10px;
    background: #2271b1;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.invoice-actions .button:hover {
    background: #135e96;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(34, 113, 177, 0.3);
}

.invoice-actions .button.secondary {
    background: #6c757d;
}

.invoice-actions .button.secondary:hover {
    background: #5a6268;
}

.invoice-actions .button.success {
    background: #28a745;
}

.invoice-actions .button.success:hover {
    background: #218838;
}

/* Print Styles */
@media print {
    .invoice-tracker-frontend {
        margin: 0;
        padding: 0;
    }
    
    .invoice-container {
        box-shadow: none;
        border: none;
        border-radius: 0;
    }
    
    .invoice-actions {
        display: none;
    }
    
    .invoice-header {
        background: #2271b1 !important;
        -webkit-print-color-adjust: exact;
        color-adjust: exact;
    }
    
    .items-table {
        page-break-inside: avoid;
    }
    
    .invoice-summary {
        page-break-inside: avoid;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .invoice-tracker-frontend {
        padding: 10px;
    }
    
    .invoice-header {
        padding: 20px;
    }
    
    .invoice-header h1 {
        font-size: 24px;
    }
    
    .invoice-details {
        padding: 20px;
    }
    
    .invoice-meta {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .items-table {
        font-size: 14px;
    }
    
    .items-table th,
    .items-table td {
        padding: 10px 8px;
    }
    
    .invoice-actions .button {
        display: block;
        width: 100%;
        margin: 10px 0;
    }
}

/* Loading States */
.invoice-loading {
    text-align: center;
    padding: 50px;
    color: #666;
}

.invoice-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-left: 10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #2271b1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error States */
.invoice-error {
    background: #f8d7da;
    color: #721c24;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #f5c6cb;
    margin: 20px 0;
    text-align: center;
}

/* Success Messages */
.invoice-success {
    background: #d1e7dd;
    color: #0f5132;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #c3e6cb;
    margin: 20px 0;
    text-align: center;
}

/* Custom Invoice Templates */
.invoice-template-modern .invoice-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.invoice-template-classic .invoice-header {
    background: #2c3e50;
}

.invoice-template-minimal .invoice-header {
    background: #fff;
    color: #333;
    border-bottom: 3px solid #2271b1;
}

.invoice-template-minimal .invoice-header h1 {
    color: #2271b1;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .invoice-tracker-frontend {
        background: #1a1a1a;
        color: #e0e0e0;
    }
    
    .invoice-container {
        background: #2d2d2d;
        border-color: #404040;
    }
    
    .items-table {
        background: #2d2d2d;
    }
    
    .items-table th {
        background: #404040;
        color: #e0e0e0;
    }
    
    .items-table tr:nth-child(even) {
        background: #404040;
    }
    
    .invoice-summary {
        background: #404040;
    }
    
    .invoice-footer {
        background: #404040;
        color: #b0b0b0;
    }
}
