/* resources/css/invoices.css */
#card-element {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    height: 40px;
    width: 100%;
}

.breadcrumb-nav {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.breadcrumb-nav span {
    cursor: pointer;
    color: blue;
}

.breadcrumb-nav span:hover {
    text-decoration: underline;
}

.breadcrumb-nav span:not(:last-child)::after {
    content: "›";
    margin-left: 5px;
    color: #000;
}

/* Modern Filter Styles */
.filter-dropdown {
    position: relative;
    min-width: 140px;
}

.filter-dropdown .form-label {
    font-size: 0.75rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: #6c757d;
}

.filter-dropdown .form-select {
    border-radius: 8px;
    border: 1px solid #e9ecef;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
}

.filter-dropdown .form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

/* Search Box Modernization */
.search-box {
    min-width: 280px;
}

.search-box .form-control {
    border-radius: 8px;
    padding-left: 2.5rem;
    border: 1px solid #e9ecef;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    font-size: 0.875rem;
}

.search-box .form-control:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

.search-box-icon {
    left: 1rem;
    z-index: 4;
    color: #6c757d;
}

/* Date Range Styles */
.date-range-container {
    background: #f8f9fa;
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    display: none;
}

.date-range-container .form-label {
    font-size: 0.75rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #6c757d;
}

.date-range-container .form-control {
    border-radius: 6px;
    font-size: 0.875rem;
    border: 1px solid #dee2e6;
}

/* Button Styles */
.btn-sm {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .d-flex.flex-wrap {
        gap: 1rem !important;
    }

    .filter-dropdown {
        min-width: 100%;
    }

    .search-box {
        min-width: 100%;
    }

    .ms-auto {
        margin-left: 0 !important;
        width: 100%;
    }

    .date-range-container .d-flex {
        flex-direction: column;
        gap: 0.5rem;
    }

    .date-range-container .form-control {
        width: 100% !important;
    }

    /* DataTable-like responsive adjustments */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table th,
    .table td {
        white-space: nowrap;
        min-width: 120px;
    }

    .action-column {
        position: sticky;
        right: 0;
        background: white;
        z-index: 10;
        box-shadow: -2px 0 5px rgba(0,0,0,0.1);
    }
}

/* Loading States */
.filter-loading::after {
    right: 25px !important;
    width: 14px !important;
    height: 14px !important;
}

/* Hover Effects */
.form-select:hover {
    border-color: #ced4da;
}

.btn:hover {
    transform: translateY(-1px);
    transition: all 0.2s ease;
}

/* Table Improvements */
.table th {
    font-weight: 600;
    font-size: 0.875rem;
    color: #495057;
    background-color: #f8f9fa;
    border-top: none;
}

.table td {
    font-size: 0.875rem;
    vertical-align: middle;
}

.badge {
    font-size: 0.75rem;
    padding: 0.35rem 0.65rem;
}

/* DataTable-like features */
.table-hover tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.02);
}

/* Sort arrow styles */
th.sort {
    cursor: pointer;
    position: relative;
    user-select: none;
    background-image: none !important;
}

th.sort:hover {
    background-color: #e9ecef;
}

th.sort::after {
    content: " ↕";
    font-weight: normal;
    color: #6c757d;
    margin-left: 4px;
    font-size: 0.9em;
}

th.sort.asc::after {
    content: " ↑";
    font-weight: bold;
    color: #0d6efd;
}

th.sort.desc::after {
    content: " ↓";
    font-weight: bold;
    color: #0d6efd;
}

th.sort.active {
    background-color: #e9ecef;
}

/* Search box styles */
.search-box {
    position: relative;
}

.search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #6c757d;
    display: none;
}

.search-clear:hover {
    color: #0d6efd;
}

.search-results-counter {
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.search-input {
    padding-right: 30px !important;
}

/* Typing/searching indicator */
.search-indicator {
    position: absolute;
    left: 36px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    color: #6c757d;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease-in-out;
}

.search-indicator.show {
    opacity: 1;
}

.search-indicator .spinner {
    width: 14px; height: 14px;
    border: 2px solid #e9ecef;
    border-top: 2px solid #0d6efd;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
    animation: spin 0.9s linear infinite;
    vertical-align: -2px;
}

/* Loading overlay styles */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    border-radius: 0.375rem;
}

.loading-spinner {
    width: 2.5rem;
    height: 2.5rem;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0d6efd;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    margin-top: 1rem;
    color: #6c757d;
    font-weight: 500;
}

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

.filter-loading {
    position: relative;
    pointer-events: none;
}

.filter-loading::after {
    content: '';
    position: absolute;
    right: 35px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0d6efd;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-disabled {
    pointer-events: none;
    opacity: 0.7;
}

/* Mobile-specific responsive improvements */
@media (max-width: 576px) {
    .table-responsive {
        border: none;
    }

    .table thead {
        display: none;
    }

    .table tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid #dee2e6;
        border-radius: 0.375rem;
        padding: 0.75rem;
    }

    .table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem;
        border: none;
        border-bottom: 1px solid #f8f9fa;
    }

    .table tbody td:before {
        content: attr(data-label);
        font-weight: 600;
        color: #495057;
        margin-right: 1rem;
        flex: 1;
    }

    .table tbody td:last-child {
        border-bottom: none;
    }

    .action-column {
        position: static;
        box-shadow: none;
    }
}

/* Print styles */
@media print {
    .filter-dropdown,
    .search-box,
    .date-range-container,
    .btn {
        display: none !important;
    }

    .table {
        width: 100% !important;
    }
}
