/* ============================================
   CONECTECIDADE - ADMIN APP STYLES
   ============================================ */

:root {
    --primary-color: #2563eb;
    --secondary-color: #10b981;
    --dark-color: #1e293b;
    --light-bg: #f8fafc;
    --white: #ffffff;
    --sidebar-width: 260px;
    --sidebar-bg: #175a73;
    --sidebar-hover: #1a6a87;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--dark-color);
    background-color: var(--light-bg);
}

/* ============================================
   LOGIN PAGE
   ============================================ */

.login-page {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    min-height: 100vh;
}

.login-container {
    min-height: 100vh;
}

.login-page .card {
    border: none;
    border-radius: 20px;
}

.logo-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: white;
}

/* ============================================
   SIDEBAR
   ============================================ */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--sidebar-bg);
    color: white;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h4 {
    color: white;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.sidebar-nav .nav-item {
    display: block;
    padding: 1rem 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.sidebar-nav .nav-item:hover {
    background-color: var(--sidebar-hover);
    color: white;
    border-left-color: var(--primary-color);
}

.sidebar-nav .nav-item.active {
    background-color: var(--sidebar-hover);
    color: white;
    border-left-color: var(--secondary-color);
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* ============================================
   MAIN CONTENT
   ============================================ */

.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.main-content .navbar {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.content-section {
    animation: fadeIn 0.3s ease-in-out;
    min-height: calc(100vh - 80px);
}

/* ============================================
   KPI CARDS
   ============================================ */

.kpi-card {
    border: none;
    border-radius: 15px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.kpi-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.kpi-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
}

.kpi-primary .kpi-icon {
    background-color: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
}

.kpi-success .kpi-icon {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--secondary-color);
}

.kpi-warning .kpi-icon {
    background-color: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.kpi-info .kpi-icon {
    background-color: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

/* ============================================
   CARDS
   ============================================ */

.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.card-header {
    background-color: transparent;
    border-bottom: 2px solid var(--light-bg);
    font-weight: 600;
}

/* ============================================
   TABLES
   ============================================ */

.table {
    margin-bottom: 0;
}

.table thead {
    background-color: var(--light-bg);
}

.table th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    color: #64748b;
    padding: 1rem;
}

.table td {
    padding: 1rem;
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background-color: rgba(37, 99, 235, 0.05);
}

/* ============================================
   BADGES & STATUS
   ============================================ */

.badge {
    padding: 0.5rem 1rem;
    font-weight: 600;
    border-radius: 20px;
}

.status-badge {
    font-size: 0.875rem;
}

.status-aberto {
    background-color: #f59e0b;
    color: white;
}

.status-andamento {
    background-color: var(--primary-color);
    color: white;
}

.status-concluido {
    background-color: var(--secondary-color);
    color: white;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    padding: 0.6rem 1.2rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
}

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

.btn-primary:hover {
    background-color: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-success {
    background-color: var(--secondary-color);
    border: none;
}

.btn-success:hover {
    background-color: #059669;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.875rem;
}

/* ============================================
   FORMS
   ============================================ */

.form-label {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.form-control,
.form-select {
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.75rem;
    transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.15);
}

/* ============================================
   MODALS
   ============================================ */

.modal-content {
    border-radius: 15px;
    border: none;
}

.modal-header {
    border-bottom: 2px solid var(--light-bg);
}

.modal-footer {
    border-top: 2px solid var(--light-bg);
}

/* ============================================
   CHARTS
   ============================================ */

canvas {
    max-height: 300px;
}

/* ============================================
   QUESTIONNAIRE ITEMS
   ============================================ */

.question-item {
    background-color: white;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.question-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* ============================================
   PROGRESS BARS
   ============================================ */

.progress {
    height: 10px;
    border-radius: 10px;
    background-color: #e2e8f0;
}

.progress-bar {
    border-radius: 10px;
    transition: width 0.6s ease;
}

/* ============================================
   GRADIENT CARD
   ============================================ */

.bg-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .kpi-card {
        margin-bottom: 1rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .btn {
        font-size: 0.875rem;
    }
}

/* ============================================
   UTILITIES
   ============================================ */

.text-muted {
    color: #64748b !important;
}

.shadow-sm {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

.shadow {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
}

.shadow-lg {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15) !important;
}

/* ============================================
   LOADING STATES
   ============================================ */

.spinner-border {
    width: 2rem;
    height: 2rem;
}

.loading-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;
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-bg);
}

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

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: 3px solid rgba(37, 99, 235, 0.3);
    outline-offset: 2px;
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .sidebar,
    .navbar,
    .btn,
    .modal {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .card {
        break-inside: avoid;
    }
}

/* ============================================
   MAP STYLES
   ============================================ */

#map-section {
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden;
    min-height: calc(100vh - 80px);
    height: calc(100vh - 80px);
}

#map-container {
    position: relative;
    width: 100%;
    height: 100%;
}

#map {
    z-index: 1;
    width: 100% !important;
    height: 100% !important;
}

/* Estilo customizado para popups minimalistas */
.minimal-popup .leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    padding: 0;
}

.minimal-popup .leaflet-popup-content {
    margin: 0;
    padding: 0;
    min-width: 220px;
}

.minimal-popup .leaflet-popup-tip {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ticket-popup {
    padding: 0.75rem;
}

/* Marcador customizado */
.custom-marker {
    background: transparent;
    border: none;
}

.custom-marker svg {
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

/* Ajustes para leaflet na tela cheia */
.leaflet-container {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Legenda do mapa */
.map-legend {
    background: transparent !important;
    border: none !important;
}

.leaflet-control-zoom {
    border: none !important;
    border-radius: 6px !important;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1) !important;
}

.leaflet-control-zoom a {
    border: none !important;
    width: 32px !important;
    height: 32px !important;
    line-height: 32px !important;
    font-size: 18px !important;
    color: #333 !important;
    background-color: white !important;
}

.leaflet-control-zoom a:hover {
    background-color: #f5f5f5 !important;
    color: var(--primary-color) !important;
}

/* Ajuste para o tamanho de tela do mapa */
@media (max-width: 768px) {
    .ticket-popup {
        padding: 0.75rem;
    }
    
    .ticket-popup p {
        font-size: 0.8rem;
    }
    
    .leaflet-popup-content {
        min-width: 200px;
    }
}
