/* RUAMA ERP Custom Styles */

:root {
    --ruama-primary: #0d6efd;
    --ruama-secondary: #6c757d;
    --ruama-success: #198754;
    --ruama-danger: #dc3545;
    --ruama-warning: #ffc107;
    --ruama-info: #0dcaf0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: #f8f9fa;
}

/* Hero section */
.hero-section {
    background: linear-gradient(135deg, var(--ruama-primary) 0%, #0a58ca 100%);
}

/* Cards */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .08);
    transition: all 0.2s ease-in-out;
}

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

/* Navigation */
.navbar-brand {
    font-weight: 600;
    font-size: 1.5rem;
}

.nav-link {
    font-weight: 500;
    transition: color 0.2s ease;
}

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 0.5rem 1.2rem;
    transition: all 0.2s ease;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
}

/* Forms */
.form-control {
    border-radius: 8px;
    border: 1px solid #e0e6ed;
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
}

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

/* Tables */
.table th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
    border-bottom: 2px solid #e9ecef;
}

/* Stats cards */
.stats-card {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border-left: 4px solid var(--ruama-primary);
}

/* Loading spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Search results */
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e0e6ed;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
}

.search-result-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f8f9fa;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.search-result-item:hover {
    background-color: #f8f9fa;
}

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

/* Responsive fixes */
@media (max-width: 768px) {
    .hero-section {
        padding: 3rem 0;
    }

    .display-4 {
        font-size: 2.5rem;
    }

    .stats-cards .col-md-6 {
        margin-bottom: 1rem;
    }
}

/* Animation utilities */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Status badges */
.badge {
    font-weight: 500;
    padding: 0.5em 0.75em;
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Pagination styles */
.pagination {
    margin-bottom: 0;
}

.pagination .page-link {
    border-radius: 6px;
    border: 1px solid #e0e6ed;
    color: var(--ruama-primary);
    padding: 0.5rem 0.75rem;
    margin: 0 0.125rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.pagination .page-link:hover {
    background-color: var(--ruama-primary);
    border-color: var(--ruama-primary);
    color: white;
    transform: translateY(-1px);
}

.pagination .page-item.active .page-link {
    background-color: var(--ruama-primary);
    border-color: var(--ruama-primary);
    color: white;
    font-weight: 600;
}

.pagination .page-item.disabled .page-link {
    color: #6c757d;
    background-color: #f8f9fa;
    border-color: #e0e6ed;
}

/* Table pagination info */
.pagination-info {
    color: #6c757d;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Loading state for pagination */
.table-loading {
    position: relative;
}

.table-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

/* Responsive pagination */
@media (max-width: 576px) {
    .pagination .page-link {
        padding: 0.375rem 0.5rem;
        font-size: 0.875rem;
    }

    .pagination .page-item:not(.active):not(.disabled) .page-link {
        display: none;
    }

    .pagination .page-item:first-child .page-link,
    .pagination .page-item:last-child .page-link,
    .pagination .page-item.active .page-link {
        display: block;
    }

    .card-footer .d-flex {
        flex-direction: column;
        gap: 1rem;
    }

    .pagination-info {
        text-align: center;
        order: 2;
    }

    .pagination {
        justify-content: center;
        order: 1;
    }
}