/* =============================================
   Sistema de Tickets - MDNet - Custom Styles
   ============================================= */

:root {
    /* Cores de Prioridade */
    --priority-emergency: #C62828;
    --priority-high: #FF8F00;
    --priority-normal: #FBC02D;
    --priority-low: #43A047;
    
    /* Cores de Status */
    --status-open: #0D6EFD;
    --status-pending: #FFC107;
    --status-resolved: #198754;
    --status-closed: #6C757D;
    
    /* SLA */
    --sla-overdue: #DC3545;
    --sla-warning: #FF9800;
    --sla-ok: #4CAF50;
}

/* Global Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
}

/* Cards */
.card {
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-radius: 8px;
}

.card-body {
    padding: 1.5rem;
}

/* Summary Cards */
.card.bg-primary,
.card.bg-danger,
.card.bg-warning,
.card.bg-success {
    border-radius: 10px;
    transition: transform 0.2s;
}

.card.bg-primary:hover,
.card.bg-danger:hover,
.card.bg-warning:hover,
.card.bg-success:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Priority Badges */
.badge-priority {
    padding: 0.35em 0.65em;
    font-size: 0.85em;
    font-weight: 600;
    border-radius: 4px;
}

.priority-Emergency {
    background-color: var(--priority-emergency);
    color: white;
}

.priority-High {
    background-color: var(--priority-high);
    color: white;
}

.priority-Normal {
    background-color: var(--priority-normal);
    color: #000;
}

.priority-Low {
    background-color: var(--priority-low);
    color: white;
}

/* Status Badges */
.badge-status {
    padding: 0.35em 0.65em;
    font-size: 0.85em;
    font-weight: 600;
    border-radius: 4px;
}

.status-Open {
    background-color: var(--status-open);
    color: white;
}

.status-Pending {
    background-color: var(--status-pending);
    color: #000;
}

.status-Resolved {
    background-color: var(--status-resolved);
    color: white;
}

.status-Closed {
    background-color: var(--status-closed);
    color: white;
}

/* SLA Indicator */
.sla-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 4px;
}

.sla-overdue {
    background-color: var(--sla-overdue);
    animation: pulse-red 1.5s infinite;
}

.sla-warning {
    background-color: var(--sla-warning);
}

.sla-ok {
    background-color: var(--sla-ok);
}

@keyframes pulse-red {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Table Row Highlighting */
.table tbody tr.sla-overdue-row {
    border-left: 4px solid var(--sla-overdue);
    background-color: rgba(220, 53, 69, 0.05);
}

.table tbody tr.priority-emergency-row {
    background-color: rgba(198, 40, 40, 0.05);
}

/* DataTable Custom */
#tickets-table {
    font-size: 0.9rem;
}

#tickets-table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: #495057;
}

#tickets-table tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

/* Action Buttons */
.btn-action {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    margin: 0 2px;
}

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

/* Upload Modal */
#upload-progress {
    height: 25px;
}

.upload-success {
    background-color: #d1e7dd;
    border: 1px solid #badbcc;
    border-radius: 6px;
    padding: 1rem;
}

.upload-error {
    background-color: #f8d7da;
    border: 1px solid #f5c2c7;
    border-radius: 6px;
    padding: 1rem;
}

.upload-stats {
    display: flex;
    justify-content: space-around;
    margin-top: 1rem;
}

.upload-stat {
    text-align: center;
}

.upload-stat-value {
    font-size: 1.5rem;
    font-weight: bold;
}

.upload-stat-label {
    font-size: 0.85rem;
    color: #6c757d;
}

/* History Timeline */
.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
    border-left: 2px solid #dee2e6;
    padding-left: 20px;
}

.timeline-item:last-child {
    border-left: none;
}

.timeline-marker {
    position: absolute;
    left: -6px;
    top: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #0d6efd;
    border: 2px solid #fff;
}

.timeline-content {
    background-color: #f8f9fa;
    padding: 0.75rem;
    border-radius: 6px;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.timeline-user {
    font-weight: 600;
    color: #0d6efd;
}

.timeline-time {
    color: #6c757d;
}

.timeline-field {
    font-size: 0.85rem;
    color: #495057;
}

.timeline-change {
    display: flex;
    gap: 10px;
    margin-top: 0.5rem;
}

.timeline-old,
.timeline-new {
    flex: 1;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

.timeline-old {
    background-color: #fff3cd;
    border-left: 3px solid #ffc107;
}

.timeline-new {
    background-color: #d1e7dd;
    border-left: 3px solid #198754;
}

/* Filters */
.form-label {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.form-select-sm,
.form-control-sm {
    font-size: 0.875rem;
}

/* Bulk Actions */
#bulk-actions {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: #fff;
    border-left: 4px solid #0d6efd;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading Spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner-content {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .card-body {
        padding: 1rem;
    }
    
    #tickets-table {
        font-size: 0.8rem;
    }
    
    .btn-action {
        padding: 0.2rem 0.4rem;
        font-size: 0.75rem;
    }
}

/* Alerts */
.alert {
    border-radius: 8px;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

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

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

/* Tooltip */
.tooltip-inner {
    font-size: 0.85rem;
}

/* Navbar */
.navbar-brand {
    font-weight: 600;
    font-size: 1.25rem;
}

.nav-link {
    transition: all 0.2s;
}

.nav-link:hover {
    transform: translateY(-1px);
}

/* Modal */
.modal-header {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

.modal-title {
    font-weight: 600;
}
