/* Custom styles for Invoice System */

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: #333;
    background-color: #f9fafb;
}

/* Enhanced Sticky Footer Styles */
.footer {
    background: linear-gradient(135deg, #212529 0%, #343a40 100%);
    border-top: 3px solid #007bff;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #007bff, transparent);
}

.footer-link {
    transition: all 0.3s ease;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

.footer-link:hover {
    color: #007bff !important;
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.footer-link i {
    transition: transform 0.3s ease;
}

.footer-link:hover i {
    transform: scale(1.1);
}

/* Responsive footer adjustments */
@media (max-width: 768px) {
    .footer {
        padding: 1.5rem 0 !important;
    }

    .footer-links {
        gap: 1rem !important;
    }

    .footer-link {
        font-size: 0.85rem;
    }
}

/* Main content area spacing */
main {
    padding-bottom: 2rem;
}

main .container {
    padding-bottom: 3rem;
}

/* Global styles */
.container {
    max-width: 1200px;
}

/* Enhanced spacing for content above footer */
.content-wrapper {
    margin-bottom: 4rem;
}

/* Ensure proper spacing on all pages */
.page-content {
    min-height: calc(100vh - 200px);
}

.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Button enhancements */
.btn {
    border-radius: 6px;
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Navbar enhancements */
.navbar {
    padding: 0.75rem 1rem;
}

.navbar-brand {
    font-weight: 600;
    letter-spacing: -0.5px;
}

.dropdown-menu {
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dropdown-item {
    transition: background-color 0.15s ease;
}

.dropdown-item:hover {
    background-color: #f0f4f8;
}

/* Messages styling */
.messages-container {
    margin-bottom: 1.5rem;
}

.alert {
    padding: 1rem;
    border-radius: 8px;
}

/* Form styles */
.form-group {
    margin-bottom: 1.25rem;
}

.form-control, .form-select {
    border-radius: 6px;
    border-color: #dee2e6;
    padding: 0.625rem 0.75rem;
    font-size: 0.95rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

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

.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #495057;
}

.item-row {
    background-color: #f8f9fa;
    padding: 1.25rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.item-row:hover {
    background-color: #f0f4f8;
}

.remove-row {
    color: #dc3545;
    cursor: pointer;
    transition: all 0.2s ease;
}

.remove-row:hover {
    color: #b02a37;
    transform: scale(1.1);
}

/* Table styles */
.table-responsive {
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.table {
    margin-bottom: 0;
}

.table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
    border-bottom-width: 1px;
    padding: 0.75rem 1rem;
}

.table td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
}

.table tbody tr {
    transition: background-color 0.15s ease;
}

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

/* Enhanced Converted Offer Styles */
.converted-offer {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%) !important;
    border-left: 4px solid #28a745 !important;
    position: relative;
    transition: all 0.3s ease;
}

/* Enhanced Converted Proforma Offer Styles */
.converted-proforma-offer {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%) !important;
    border-left: 4px solid #ffc107 !important;
    position: relative;
    transition: all 0.3s ease;
}



.converted-offer:hover {
    background: linear-gradient(135deg, #c3e6cb 0%, #b8dcc0 100%) !important;
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.2);
}

.converted-proforma-offer:hover {
    background: linear-gradient(135deg, #ffeaa7 0%, #ffd93d 100%) !important;
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.2);
}

/* Text styling for converted offers */
.converted-offer td {
    color: #155724 !important;
    font-weight: 500;
}

/* Text styling for converted proforma offers */
.converted-proforma-offer td {
    color: #664d03 !important;
    font-weight: 500;
}

.converted-offer .badge {
    background: linear-gradient(135deg, #28a745, #20c997) !important;
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.converted-proforma-offer .badge {
    background: linear-gradient(135deg, #ffc107, #ffca2c) !important;
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Enhanced button styling for converted offers - match outline style */
.converted-offer .btn-outline-light {
    background-color: transparent;
    border-color: #28a745;
    color: #28a745;
    font-weight: 500;
    transition: all 0.2s ease;
}

.converted-offer .btn-outline-light:hover {
    background-color: #28a745;
    border-color: #28a745;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.converted-offer .btn-outline-light:focus {
    box-shadow: 0 0 0 0.25rem rgba(40, 167, 69, 0.25);
}

/* Enhanced button styling for proforma converted offers - match outline style */
.converted-proforma-offer .btn-outline-light {
    background-color: transparent;
    border-color: #ffc107;
    color: #ffc107;
    font-weight: 500;
    transition: all 0.2s ease;
}

.converted-proforma-offer .btn-outline-light:hover {
    background-color: #ffc107;
    border-color: #ffc107;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.converted-proforma-offer .btn-outline-light:focus {
    box-shadow: 0 0 0 0.25rem rgba(255, 193, 7, 0.25);
}



/* Status indicator for converted offers */
.converted-offer::after {
    content: '✓ Konvertovano';
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    background: #28a745;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.converted-offer:hover::after {
    opacity: 1;
}

/* Status indicator for proforma converted offers */
.converted-proforma-offer::after {
    content: '✓ Predračun';
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    background: #ffc107;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.converted-proforma-offer:hover::after {
    opacity: 1;
}

/* Offer actions container - continuous horizontal layout */
.offer-actions-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    white-space: nowrap;
    min-width: 250px;
}

.offer-actions-container .btn {
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.2s ease;
    width: 36px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.offer-actions-container .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.offer-actions-container .btn-outline-primary {
    border-color: #007bff;
    color: #007bff;
}

.offer-actions-container .btn-outline-primary:hover {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
}

.offer-actions-container .btn-outline-secondary {
    border-color: #6c757d;
    color: #6c757d;
}

.offer-actions-container .btn-outline-secondary:hover {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
}

.offer-actions-container .btn-outline-info {
    border-color: #17a2b8;
    color: #17a2b8;
}

.offer-actions-container .btn-outline-info:hover {
    background-color: #17a2b8;
    border-color: #17a2b8;
    color: white;
}

.offer-actions-container .btn-outline-success {
    border-color: #28a745;
    color: #28a745;
}

.offer-actions-container .btn-outline-success:hover {
    background-color: #28a745;
    border-color: #28a745;
    color: white;
}

.offer-actions-container .btn-outline-danger {
    border-color: #dc3545;
    color: #dc3545;
}

.offer-actions-container .btn-outline-danger:hover {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
}

.offer-actions-container .btn-outline-light {
    background-color: transparent;
    border-color: #28a745;
    color: #28a745;
}

.offer-actions-container .btn-outline-light:hover {
    background-color: #28a745;
    border-color: #28a745;
    color: white;
}

/* Special handling for proforma converted offers in actions container */
.converted-proforma-offer .offer-actions-container .btn-outline-light:hover {
    background-color: #ffc107;
    border-color: #ffc107;
    color: white;
}

/* Converted status button - match outline style of other buttons */
.offer-actions-container .converted-status-btn {
    background-color: transparent !important;
    border-color: #28a745 !important;
    color: #28a745 !important;
    font-weight: 500;
    cursor: default;
    opacity: 1 !important;
    width: 36px;
    height: 32px;
}

.offer-actions-container .converted-status-btn:disabled {
    background-color: transparent !important;
    border-color: #28a745 !important;
    color: #28a745 !important;
    opacity: 1 !important;
}

.offer-actions-container .converted-status-btn:hover {
    background-color: transparent !important;
    border-color: #28a745 !important;
    color: #28a745 !important;
    transform: none !important;
    box-shadow: none !important;
}

.offer-actions-container .converted-status-btn .bi-check-circle {
    color: #28a745;
}

/* Proforma converted status button - match outline style of other buttons */
.offer-actions-container .converted-proforma-status-btn {
    background-color: transparent !important;
    border-color: #ffc107 !important;
    color: #ffc107 !important;
    font-weight: 500;
    cursor: default;
    opacity: 1 !important;
    width: 36px;
    height: 32px;
}

.offer-actions-container .converted-proforma-status-btn:disabled {
    background-color: transparent !important;
    border-color: #ffc107 !important;
    color: #ffc107 !important;
    opacity: 1 !important;
}

.offer-actions-container .converted-proforma-status-btn:hover {
    background-color: transparent !important;
    border-color: #ffc107 !important;
    color: #ffc107 !important;
    transform: none !important;
    box-shadow: none !important;
}

.offer-actions-container .converted-proforma-status-btn .bi-file-earmark-text {
    color: #ffc107;
}

/* Ensure no responsive behavior - maintain horizontal layout always */
@media (max-width: 768px) {
    .converted-offer::after {
        display: none;
    }

    .converted-offer {
        border-left-width: 3px !important;
    }

    .converted-proforma-offer::after {
        display: none;
    }

    .converted-proforma-offer {
        border-left-width: 3px !important;
    }

    /* Keep horizontal layout on all screen sizes */
    .offer-actions-container {
        display: flex !important;
        flex-direction: row !important;
        align-items: center;
        justify-content: center;
        gap: 2px;
        white-space: nowrap;
        min-width: 250px;
    }

    .offer-actions-container .btn {
        width: 36px !important;
        height: 32px !important;
        flex-shrink: 0 !important;
    }

    /* Keep horizontal layout for invoice actions too */
    .invoice-actions-container {
        display: flex !important;
        flex-direction: row !important;
        align-items: center;
        justify-content: center;
        gap: 2px;
        white-space: nowrap;
        min-width: 250px;
    }

    .invoice-actions-container .btn {
        width: 36px !important;
        height: 32px !important;
        flex-shrink: 0 !important;
    }
}

/* Table cell alignment for action column */
.offer-actions-container {
    overflow: visible !important;
}

/* Table container without horizontal scroll */
.table-container {
    width: 100%;
    overflow: visible;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.table-container .table {
    margin-bottom: 0;
    table-layout: auto;
}

/* Ensure table doesn't create horizontal scroll */
.table-responsive {
    overflow-x: visible !important;
}

/* Invoice actions container - continuous horizontal layout */
.invoice-actions-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    white-space: nowrap;
    min-width: 250px;
}

.invoice-actions-container .btn {
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.2s ease;
    width: 36px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.invoice-actions-container .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.invoice-actions-container .btn-outline-primary {
    border-color: #007bff;
    color: #007bff;
}

.invoice-actions-container .btn-outline-primary:hover {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
}

.invoice-actions-container .btn-outline-secondary {
    border-color: #6c757d;
    color: #6c757d;
}

.invoice-actions-container .btn-outline-secondary:hover {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
}

.invoice-actions-container .btn-outline-info {
    border-color: #17a2b8;
    color: #17a2b8;
}

.invoice-actions-container .btn-outline-info:hover {
    background-color: #17a2b8;
    border-color: #17a2b8;
    color: white;
}

.invoice-actions-container .btn-outline-danger {
    border-color: #dc3545;
    color: #dc3545;
}

.invoice-actions-container .btn-outline-danger:hover {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
}

/* Enhanced accessibility for converted offers */
.converted-offer:focus-within {
    outline: 2px solid #28a745;
    outline-offset: 2px;
}

.converted-proforma-offer:focus-within {
    outline: 2px solid #ffc107;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .converted-offer {
        background: #e8f5e8 !important;
        border-left-color: #006600 !important;
    }

    .converted-offer td {
        color: #003300 !important;
    }

    .converted-offer .btn-outline-light {
        border-color: #006600;
        color: #003300;
    }

    .converted-proforma-offer {
        background: #fff8e1 !important;
        border-left-color: #cc9900 !important;
    }

    .converted-proforma-offer td {
        color: #663300 !important;
    }

    .converted-proforma-offer .btn-outline-light {
        border-color: #cc9900;
        color: #663300;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .converted-offer,
    .converted-offer .btn-outline-light,
    .converted-offer::after {
        transition: none;
    }

    .converted-offer:hover {
        transform: none;
    }

    .converted-proforma-offer,
    .converted-proforma-offer .btn-outline-light,
    .converted-proforma-offer::after {
        transition: none;
    }

    .converted-proforma-offer:hover {
        transform: none;
    }
}



/* Enhanced Invoice Management Styles */
.invoice-row {
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.invoice-row:hover {
    background-color: #f8f9fa;
    border-left-color: #007bff;
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.1);
}

/* Customer avatar styling */
.customer-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #007bff, #0056b3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2);
}

/* Enhanced button styling for invoices */
.invoice-actions .btn {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 44px; /* Touch-friendly minimum size */
}

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

.invoice-actions .btn-outline-primary {
    border-color: #007bff;
    color: #007bff;
}

.invoice-actions .btn-outline-primary:hover {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
}

.invoice-actions .btn-outline-secondary {
    border-color: #6c757d;
    color: #6c757d;
}

.invoice-actions .btn-outline-secondary:hover {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
}

.invoice-actions .btn-outline-info {
    border-color: #17a2b8;
    color: #17a2b8;
}

.invoice-actions .btn-outline-info:hover {
    background-color: #17a2b8;
    border-color: #17a2b8;
    color: white;
}

.invoice-actions .btn-outline-danger {
    border-color: #dc3545;
    color: #dc3545;
}

.invoice-actions .btn-outline-danger:hover {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
}

/* Enhanced table styling */
.table-dark th {
    background-color: #343a40;
    border-color: #454d55;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 0.85rem;
}

/* Badge enhancements */
.badge.fs-6 {
    font-size: 0.9rem !important;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Statistics cards */
.card {
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* Responsive adjustments for invoice actions */
@media (max-width: 992px) {
    .invoice-actions .btn {
        padding: 0.375rem 0.5rem;
        min-width: 40px;
    }

    .invoice-actions .btn-group {
        flex-direction: column;
        gap: 2px;
    }

    .invoice-actions .btn-group .btn {
        border-radius: 4px !important;
    }
}

@media (max-width: 768px) {
    .invoice-row {
        font-size: 0.9rem;
    }

    .customer-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }

    .invoice-actions .btn {
        padding: 0.25rem 0.4rem;
        font-size: 0.8rem;
    }
}

/* Invoice detail page styling */
.invoice-detail-actions .btn {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 44px;
}

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

/* Responsive adjustments for invoice detail actions */
@media (max-width: 992px) {
    .invoice-detail-actions .btn {
        padding: 0.375rem 0.5rem;
        min-width: 40px;
    }
}

@media (max-width: 768px) {
    .invoice-detail-actions .btn-group {
        flex-direction: column;
        gap: 2px;
    }

    .invoice-detail-actions .btn-group .btn {
        border-radius: 4px !important;
    }

    .invoice-detail-actions .btn {
        padding: 0.25rem 0.4rem;
        font-size: 0.8rem;
    }
}

/* PDF styles */
.pdf-container {
    max-width: 100%;
    overflow-x: auto;
}

/* Currency and number formatting */
.currency-symbol {
    font-weight: bold;
}

.text-right {
    text-align: right;
}

/* Offer/Invoice detail view */
.detail-header {
    background: linear-gradient(to right, #f8f9fa, #e9ecef);
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.detail-header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: linear-gradient(to bottom, #007bff, #6610f2);
}

.detail-header h2 {
    margin-bottom: 1rem;
    font-weight: 600;
    color: #212529;
}

.detail-header p {
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.detail-header strong {
    color: #495057;
    font-weight: 600;
}

.detail-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.detail-actions .btn {
    min-width: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Additional utility classes */
.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #212529;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e9ecef;
}

.badge {
    font-weight: 500;
    padding: 0.5em 0.75em;
    border-radius: 6px;
}

.badge-pill {
    border-radius: 50rem;
}

.shadow-hover {
    transition: box-shadow 0.2s ease;
}

.shadow-hover:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Print styles */
@media print {
    .no-print {
        display: none;
    }

    .container {
        width: 100%;
        max-width: 100%;
    }
}
