/* Custom styles for LogUI */

:root {
    --primary-color: #0d6efd;
    --success-color: #198754;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
}

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

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

.table th {
    font-weight: 600;
    border-top: none;
}

.table td {
    vertical-align: middle;
}

.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
}

.sortable:hover {
    background-color: rgba(255, 255, 255, 0.2) !important;
    color: #000000 !important;
}

/* For light table headers */
.table-light .sortable:hover {
    background-color: rgba(0, 0, 0, 0.1) !important;
    color: #000000 !important;
}

.sortable i {
    margin-left: 5px;
    opacity: 0.7;
}

.priority-low {
    color: var(--success-color);
}

.priority-medium {
    color: var(--warning-color);
}

.priority-high {
    color: var(--danger-color);
}

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

.status-in-progress {
    color: var(--info-color);
}

.status-pending {
    color: var(--warning-color);
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.table-responsive {
    border-radius: 0.375rem;
}

.pagination-sm .page-link {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.card-header {
    background-color: rgba(0, 0, 0, 0.03);
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
}

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

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

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

.text-truncate {
    max-width: 200px;
}

.notes-cell {
    max-width: 250px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.actions-cell {
    width: 120px;
}

.date-cell {
    width: 120px;
}

.priority-cell {
    width: 80px;
}

.hours-cell {
    width: 80px;
}

@media (max-width: 768px) {
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .notes-cell {
        max-width: 100px;
    }
    
    .btn-group-sm .btn {
        padding: 0.25rem 0.5rem;
        font-size: 1rem;
        min-width: 36px;
        min-height: 36px;
    }
    .filter-bar .row.g-3 > [class^='col-'] {
        flex: 0 0 100%;
        max-width: 100%;
    }
    .filter-bar {
        flex-direction: column !important;
    }
    /* Hide less important columns by default on mobile */
    td[data-column='notes'], th[data-column='notes'],
    td[data-column='target_completion_date'], th[data-column='target_completion_date'],
    td[data-column='hours'], th[data-column='hours'] {
        display: none !important;
    }
}

/* PWA specific styles */
.pwa-install-banner {
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    color: white;
    padding: 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

.pwa-install-banner .btn {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
}

.pwa-install-banner .btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
}

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

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

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

.toast {
    background-color: white;
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}