/* Invoice Master - Custom Styles */

/* Global Styles */
:root {
    --primary-color: #0d6efd;
    --success-color: #198754;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #0dcaf0;
    --dark-color: #212529;
    --light-color: #f8f9fa;
}
.bg-orange {
    background-color: #fd7e14 !important; /* Bootstrap's warning orange */
    color: #fff !important;
}

input:invalid {
    box-shadow: none !important;
    background-image: none !important;
    outline: none !important;
    border: 1px solid #444 !important; /* Adjust for dark theme */
}

input:focus {
    outline: none;
    box-shadow: 0 0 0 0.15rem rgba(100, 100, 255, 0.25); /* Soft blue glow if you want */
    border-color: #666;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
}

/* Custom Card Styles */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: box-shadow 0.15s ease-in-out;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.125);
    font-weight: 600;
    padding: 1rem 1.25rem;
}

/* Dashboard Statistics Cards */
.stats-card {
    background: linear-gradient(135deg, var(--primary-color), #4dabf7);
    color: white;
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: transform 0.2s ease-in-out;
}

.stats-card:hover {
    transform: translateY(-5px);
}

.stats-card h3 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stats-card p {
    font-size: 1.1rem;
    margin-bottom: 0;
    opacity: 0.9;
}

/* Navigation Enhancements */
.navbar-brand {
    font-weight: 700;
    font-size: 1.4rem;
}

.navbar-nav .nav-link {
    font-weight: 500;
    padding: 0.75rem 1rem;
    transition: color 0.15s ease-in-out;
}

.navbar-nav .nav-link:hover {
    color: var(--primary-color) !important;
}

/* Form Enhancements */
.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.75rem 1rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.form-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: rgba(255, 255, 255, 0.9);
}

/* Button Enhancements */
.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 0.6rem 1.2rem;
    transition: all 0.15s ease-in-out;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-group .btn:hover {
    transform: none;
}

/* Table Enhancements */
.table {
    border-radius: 8px;
    overflow: hidden;
}

.table th {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    font-weight: 600;
    padding: 1rem 0.75rem;
}

.table td {
    padding: 0.875rem 0.75rem;
    border-color: rgba(255, 255, 255, 0.05);
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.025);
}

/* Badge Enhancements */
.badge {
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
}

/* Modal Enhancements */
.modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.125);
    padding: 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.125);
    padding: 1.5rem;
}

/* Alert Enhancements */
.alert {
    border: none;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.alert-dismissible .btn-close {
    padding: 1.25rem 1rem;
}

/* Footer Styles */
footer {
    margin-top: auto;
    background: linear-gradient(135deg, #212529, #343a40) !important;
}

.footer-brand-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: #9ec5fe;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease, transform 0.2s ease;
}

.footer-brand-link:hover {
    color: #cfe2ff;
    transform: translateY(-1px);
}

.footer-brand-logo {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    background: #fff;
}

/* Loading States */
.loading {
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-left: 8px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Invoice Form Specific */
.invoice-item-row {
    background-color: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
}

.invoice-totals {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.1), rgba(13, 110, 253, 0.05));
    border-radius: 10px;
    padding: 1.5rem;
}

.invoice-totals table {
    margin-bottom: 0;
}

.invoice-totals .table td {
    border: none;
    padding: 0.5rem 0;
}

/* Customer Summary Charts */
.chart-container {
    position: relative;
    height: 300px;
    margin: 1rem 0;
}

/* Admin Panel Specific */
.admin-nav {
    background: linear-gradient(135deg, #dc3545, #b02a37) !important;
}

.admin-alert-bar {
    background: linear-gradient(135deg, #ffc107, #ffcd39) !important;
    color: #212529 !important;
    font-weight: 600;
}

.admin-card {
    border-left: 4px solid var(--danger-color);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .card-body {
        padding: 1rem;
    }
    
    .table-responsive {
        border-radius: 8px;
    }
    
    .btn-group {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .btn-group .btn {
        border-radius: 6px !important;
    }
    
    .stats-card h3 {
        font-size: 2rem;
    }
}

@media (max-width: 576px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .btn-group .btn {
        width: auto;
        margin-bottom: 0;
    }
}

/* Print Utilities */
@media print {
    .no-print {
        display: none !important;
    }
    
    .print-break {
        page-break-after: always;
    }
    
    .print-avoid-break {
        page-break-inside: avoid;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Animation Utilities */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

/* Status Colors */
.status-draft { color: #6c757d; }
.status-sent { color: #0dcaf0; }
.status-paid { color: #198754; }
.status-overdue { color: #dc3545; }

.bg-status-draft { background-color: #6c757d; }
.bg-status-sent { background-color: #0dcaf0; }
.bg-status-paid { background-color: #198754; }
.bg-status-overdue { background-color: #dc3545; }

/* Icon Enhancements */
.fa-stack {
    margin-right: 0.5rem;
}

.icon-lg {
    font-size: 1.25em;
}

.icon-xl {
    font-size: 2em;
}

/* Data Visualization */
.progress {
    height: 8px;
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.1);
}

.progress-bar {
    border-radius: 4px;
}

/* Utility Classes */
.text-shadow {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.box-shadow {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.box-shadow-lg {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.border-gradient {
    border: 2px solid;
    border-image: linear-gradient(45deg, var(--primary-color), var(--info-color)) 1;
}

/* Focus States */
.form-control:focus,
.form-select:focus,
.btn:focus {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Loading Skeleton */
.skeleton {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.1) 25%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0.1) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
