/* Custom styles for Sistema de Compras */

/* Ensure body takes full height */
html, body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* Card hover effects */
.card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

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

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

/* Table improvements */
.table-hover tbody tr:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.1);
}

/* Button group spacing */
.btn-group .btn {
    margin-right: 0;
}

/* Form improvements */
.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

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

/* Notification improvements */
.dropdown-menu {
    max-height: 400px;
    overflow-y: auto;
}

/* Timeline styles for history */
.timeline {
    position: relative;
    padding-left: 3rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 1rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--bs-border-color);
}

.timeline-item {
    position: relative;
    padding-bottom: 2rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -2rem;
    top: 0.5rem;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background: var(--bs-primary);
    border: 3px solid var(--bs-body-bg);
}

/* Loading states */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .card {
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }
}

/* Responsive improvements */
@media (max-width: 768px) {
    .btn-group {
        display: flex;
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group .btn {
        border-radius: var(--bs-border-radius) !important;
        margin-bottom: 0.25rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
}

/* Dashboard cards */
.dashboard-card {
    text-decoration: none;
    color: inherit;
}

.dashboard-card:hover {
    text-decoration: none;
    color: inherit;
}

/* File upload area */
.file-upload-area {
    border: 2px dashed var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
}

.file-upload-area:hover {
    border-color: var(--bs-primary);
    background-color: rgba(var(--bs-primary-rgb), 0.05);
}

.file-upload-area.dragover {
    border-color: var(--bs-success);
    background-color: rgba(var(--bs-success-rgb), 0.1);
}

/* Feather icon adjustments */
[data-feather] {
    width: 16px;
    height: 16px;
    vertical-align: text-bottom;
}

/* Status color improvements */
.status-waiting {
    color: var(--bs-warning);
}

.status-approved {
    color: var(--bs-info);
}

.status-purchased {
    color: var(--bs-primary);
}

.status-received {
    color: var(--bs-success);
}

.status-finished {
    color: var(--bs-success);
}

/* Package cards */
.package-card {
    border-left: 4px solid var(--bs-primary);
}

.package-card.received {
    border-left-color: var(--bs-success);
}

.package-card.pending {
    border-left-color: var(--bs-warning);
}

/* Empty state improvements */
.empty-state {
    padding: 4rem 2rem;
    text-align: center;
    color: var(--bs-text-muted);
}

.empty-state [data-feather] {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Animation for loading */
@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Sticky footer */
footer {
    margin-top: auto;
}

/* Toast notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1055;
}

/* Role-based color coding */
.role-administrador { color: var(--bs-danger); }
.role-comercial { color: var(--bs-warning); }
.role-comprador { color: var(--bs-info); }
.role-recebedor { color: var(--bs-success); }
.role-tributario { color: var(--bs-primary); }
.role-financeiro { color: var(--bs-secondary); }
.role-solicitante { color: var(--bs-body-color); }

/* Improved spacing */
.section-spacing {
    margin-bottom: 3rem;
}

/* Enhanced focus states */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
}

/* Better mobile navigation */
@media (max-width: 991.98px) {
    .navbar-nav {
        padding-top: 1rem;
    }
    
    .navbar-nav .nav-item {
        text-align: center;
    }
}
