/* Theme Colors */
:root {
    /* Primary colors */
    --primary-color: #007bff;
    --primary-hover: rgba(0, 123, 255, 0.1);
    --primary-light: rgba(0, 123, 255, 0.1);
    
    /* Status colors */
    --status-nova: #0d6efd;
    --status-atribuida: #0dcaf0;
    --status-atendendo: #ffc107;
    --status-pendente: #dc3545;
    --status-solucionada: #198754;
    --status-encerrada: #6c757d;
    --status-cancelada: #343a40;
    
    /* Timeline markers */
    --marker-past: #0d6efd;
    --marker-current: #ffc107;
    --marker-solution: #198754;
    --marker-canceled: #6c757d;
    --marker-closed: #fd7e14;
    --marker-pending: #dc3545;
    
    /* Background colors */
    --bg-main: #f4f6f9;
    --bg-overlay: rgba(0, 0, 0, 0.5);
    
    /* Text colors */
    --text-primary: #333;
    --text-secondary: #666;
    --text-light: #fff;
    
    /* Border colors */
    --border-color: #ddd;
    --border-focus: #007bff;
    
    /* Error colors */
    --error-color: #dc3545;
}

/* Global styles */
body {
    background-color: var(--bg-main);
    color: var(--text-primary);
}

/* Layout components */
.btn-primary {
    background-color: var(--primary-color);
}

/* Table styles */
.table-hover tbody tr:hover,
.table-row-clickable:hover,
.table-row-clickable:focus {
    background-color: var(--primary-hover);
    cursor: pointer;
}

.table-row-clickable {
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.table-row-clickable:hover {
    background-color: rgba(0, 123, 255, 0.1);
}

.table-row-clickable:focus {
    outline: 2px solid #007bff;
    outline-offset: -2px;
}

/* Card overview styles */
.card.card-overview {
    height: 100%;
    display: flex;
    flex-direction: column;
}
.card.card-overview .card-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.resumo-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.resumo-item {
    padding: 0.5rem;
    border-bottom: 1px solid rgba(0,0,0,.125);
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
    align-items: center;
}

.resumo-item:last-child {
    border-bottom: none;
}

.resumo-item:hover {
    background-color: rgba(0,123,255,.1);
    cursor: pointer;
}

.resumo-item .equipamento {
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

/* Navbar styles */
.navbar-brand {
    --navbar-bg: rgba(255, 255, 255, 0);
    --navbar-bg-active: rgba(255, 255, 255, 0.1);
    --navbar-bg-hover: rgba(255, 255, 255, 0.15);
    
    color: var(--text-light) !important;
    background-color: var(--navbar-bg);
    border-radius: 0.375rem;
    padding: 0.5rem 1rem;
    margin: -0.5rem 0;
}

.navbar-brand.brand-active {
    background-color: var(--navbar-bg-active);
}

.navbar-brand.brand-active:hover {
    background-color: var(--navbar-bg-hover);
}

.card-header .collapse-toggle {
    padding: 0;
    background: none;
    border: none;
    color: inherit;
    opacity: 0.8;
}

.card-header .collapse-toggle:hover {
    opacity: 1;
}

.collapse-toggle i {
    transition: transform 0.2s;
}

/* Estilos para os painéis de reporte */
#panelEnel:not(.collapse),
#panelMaterial:not(.collapse) {
    display: block;
}

#panelConcluidos:not(.show) {
    display: none;
}

/* Estilos para imagens nos modais */
.modal-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
}

.image-navigation {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-overlay);
    color: var(--text-light);
    border: none;
    padding: 1rem;
    cursor: pointer;
    z-index: 1060;
}

.image-navigation.prev {
    left: 1rem;
}

.image-navigation.next {
    right: 1rem;
}

.image-counter {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-overlay);
    color: var(--text-light);
    padding: 0.5rem 1rem;
    border-radius: 15px;
    z-index: 1060;
}

/* Estilos para linhas clicáveis */
.table-row-clickable {
    cursor: pointer;
    transition: background-color 0.3s ease;
}

/* Estilos para linhas clicáveis em demandas */
.table-row-clickable {
    cursor: pointer;
    transition: background-color 0.3s ease;
}

/* Mobile title styles */
.navbar .container-fluid {
    position: relative;
}

@media (max-width: 991.98px) {
    .navbar-brand {
        width: 60px;
    }
    .navbar-toggler {
        width: 60px;
    }
    .text-center.flex-grow-1 {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        white-space: nowrap;
        pointer-events: none;
    }
}

/* Timeline styles */
.timeline-list {
    list-style: none;
    padding-left: 0;
    position: relative;
}

.timeline-list::before {
    content: "";
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
    padding-left: 35px;
    margin-bottom: 15px;
}

.timeline-marker {
    position: absolute;
    left: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: currentColor;
}

/* Status badges */
.badge-nova { background-color: var(--status-nova); }
.badge-atribuida { background-color: var(--status-atribuida); }
.badge-atendendo { background-color: var(--status-atendendo); }
.badge-pendente { background-color: var(--status-pendente); }
.badge-solucionada { background-color: var(--status-solucionada); }
.badge-encerrada { background-color: var(--status-encerrada); }
.badge-cancelada { background-color: var(--status-cancelada); }

/* Timeline markers */
.marker-past { color: var(--marker-past); }
.marker-current { color: var(--marker-current); }
.marker-solution { color: var(--marker-solution); }
.marker-canceled { color: var(--marker-canceled); }
.marker-closed { color: var(--marker-closed); }
.marker-pending { color: var(--marker-pending); }

/* Styles for image preview thumbnails */
.img-preview {
    width: 100px;
    height: 100px;
    object-fit: cover;
}

/* Timeline styles for details page */
.timeline-content {
    margin-left: 10px;
}

/* Gap utility for flex items */
.gap-3-custom {
    gap: 1rem;
}

/* Form validation visual feedback */
.form-invalid {
    border-color: var(--error-color);
}

.form-invalid-feedback {
    color: var(--error-color);
    font-size: 80%;
    margin-top: 0.25rem;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    .print-only {
        display: block !important;
    }
}

/* PDF Generation Styles */
.pdf-header {
    border-bottom: 1px solid #000;
    margin-bottom: 20px;
    padding-bottom: 10px;
}

.pdf-title {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 5px;
}

.pdf-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
}

.pdf-section {
    margin-bottom: 20px;
}

.pdf-section-title {
    font-size: 18px;
    font-weight: bold;
    border-bottom: 2px solid #eee;
    padding-bottom: 5px;
    margin-bottom: 10px;
}

.pdf-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.pdf-detail-item {
    margin-bottom: 5px;
}

.pdf-detail-label {
    font-weight: bold;
    color: var(--text-secondary);
}

.pdf-detail-value {
    margin-left: 5px;
}

.pdf-timeline {
    margin-left: 20px;
    padding-left: 20px;
    border-left: 2px solid var(--border-color);
}

.pdf-timeline-item {
    margin-bottom: 15px;
    position: relative;
}

.pdf-timeline-marker {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    position: absolute;
    left: -26px;
    top: 5px;
}

.pdf-image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.pdf-image-container {
    break-inside: avoid;
}

.pdf-image {
    max-width: 100%;
    height: auto;
    border: 1px solid #ddd;
}

@media print {
    .pdf-section {
        page-break-inside: avoid;
    }
    
    .pdf-image-grid {
        page-break-inside: avoid;
    }
}

/* Login page styles */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 400px;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo img {
    max-width: 150px;
    height: auto;
}

.login-form {
    padding: 2rem;
}

.login-error {
    margin-bottom: 1rem;
    color: var(--error-color);
}

/* Dashboard card styles */
.dashboard-card {
    height: 100%;
    transition: transform 0.2s;
}

.dashboard-card:hover {
    transform: translateY(-5px);
}

.dashboard-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.dashboard-title {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.dashboard-description {
    font-size: 0.9rem;
    color: #6c757d;
}

/* Positive status color for "resolvida" */
.bg-success,
.bg-resolvida {
    background-color: #198754 !important;
    color: #fff !important;
}
