/**
 * Sistema de Pesquisa de Satisfação
 * Estilos CSS - Tema Verde Saúde
 */

:root {
    /* Cores Principais - Verde Saúde */
    --primary: #198754;
    --primary-dark: #146c43;
    --primary-light: #20c997;
    --primary-bg: #d1e7dd;
    
    /* Cores Secundárias */
    --secondary: #6c757d;
    --success: #198754;
    --info: #0dcaf0;
    --warning: #ffc107;
    --danger: #dc3545;
    --light: #f8f9fa;
    --dark: #212529;
    
    /* Cores de Texto */
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --text-muted: #adb5bd;
    
    /* Cores de Background */
    --bg-body: #f0f4f3;
    --bg-card: #ffffff;
    --bg-sidebar: #1a3d2e;
    --bg-header: #ffffff;
    
    /* Sombras */
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.15);
    
    /* Bordas */
    --border-color: #dee2e6;
    --border-radius: 0.5rem;
    --border-radius-lg: 1rem;
    
    /* Transições */
    --transition: all 0.3s ease;
    
    /* Sidebar */
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 70px;
}

/* Reset e Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-body);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* Scrollbar Personalizada */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* ====================== */
/* Layout Principal */
/* ====================== */

.wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, var(--bg-sidebar) 0%, #0d261b 100%);
    color: #fff;
    z-index: 1000;
    transition: var(--transition);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-header {
    padding: 1.5rem;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.sidebar-logo i {
    color: var(--primary-light);
}

.sidebar-nav {
    padding: 1rem 0;
}

.nav-section {
    padding: 0.5rem 1.5rem;
    margin-top: 1rem;
}

.nav-section-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 0.5rem;
}

.nav-item {
    margin: 0.25rem 0.75rem;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: rgba(255, 255, 255, 0.8);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.nav-link.active {
    background: var(--primary);
    color: #fff;
}

.nav-link i {
    width: 24px;
    font-size: 1.1rem;
    margin-right: 0.75rem;
}

.nav-link .badge {
    margin-left: auto;
}

/* Sidebar Collapsed */
.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed-width);
}

.sidebar-collapsed .sidebar-logo span,
.sidebar-collapsed .nav-section-title,
.sidebar-collapsed .nav-link span {
    display: none;
}

.sidebar-collapsed .nav-link {
    justify-content: center;
    padding: 0.75rem;
}

.sidebar-collapsed .nav-link i {
    margin: 0;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: var(--transition);
}

.sidebar-collapsed .main-content {
    margin-left: var(--sidebar-collapsed-width);
}

/* Header */
.main-header {
    position: sticky;
    top: 0;
    background: var(--bg-header);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.sidebar-toggle:hover {
    background: var(--light);
    color: var(--primary);
}

.page-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.header-user:hover {
    background: var(--light);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.user-info {
    line-height: 1.3;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Content Area */
.content {
    padding: 1.5rem;
}

/* Breadcrumb */
.breadcrumb-wrapper {
    margin-bottom: 1.5rem;
}

.breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    color: var(--text-muted);
}

/* ====================== */
/* Cards */
/* ====================== */

.card {
    background: var(--bg-card);
    border: none;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    background: transparent;
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
}

/* Stat Cards */
.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card .stat-icon {
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 4rem;
    opacity: 0.1;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.stat-card .stat-change {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
    margin-top: 0.5rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

.stat-card .stat-change.positive {
    background: var(--primary-bg);
    color: var(--primary);
}

.stat-card .stat-change.negative {
    background: #f8d7da;
    color: var(--danger);
}

/* Card Variants */
.card-primary {
    border-left: 4px solid var(--primary);
}

.card-success {
    border-left: 4px solid var(--success);
}

.card-warning {
    border-left: 4px solid var(--warning);
}

.card-danger {
    border-left: 4px solid var(--danger);
}

.card-info {
    border-left: 4px solid var(--info);
}

/* ====================== */
/* Buttons */
/* ====================== */

.btn {
    font-weight: 500;
    padding: 0.5rem 1.25rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-primary:hover {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-success {
    background: var(--success);
    border-color: var(--success);
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
}

.btn-icon {
    width: 38px;
    height: 38px;
    padding: 0;
    justify-content: center;
}

.btn-icon.btn-sm {
    width: 30px;
    height: 30px;
}

/* ====================== */
/* Forms */
/* ====================== */

.form-label {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.form-control,
.form-select {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.625rem 1rem;
    transition: var(--transition);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.15);
}

.form-control-lg {
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
}

.input-group-text {
    background: var(--light);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.form-switch .form-check-input:checked {
    background-color: var(--primary);
}

.form-text {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ====================== */
/* Tables */
/* ====================== */

.table {
    margin-bottom: 0;
}

.table th {
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    padding: 1rem;
    background: var(--light);
    border-bottom: 2px solid var(--border-color);
}

.table td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
}

.table tbody tr:hover {
    background: rgba(25, 135, 84, 0.03);
}

.table-responsive {
    border-radius: var(--border-radius);
}

/* ====================== */
/* Badges */
/* ====================== */

.badge {
    font-weight: 500;
    padding: 0.35rem 0.65rem;
    border-radius: 0.375rem;
}

.badge-primary {
    background: var(--primary-bg);
    color: var(--primary);
}

.badge-success {
    background: #d1e7dd;
    color: #146c43;
}

.badge-warning {
    background: #fff3cd;
    color: #997404;
}

.badge-danger {
    background: #f8d7da;
    color: #842029;
}

.badge-info {
    background: #cff4fc;
    color: #055160;
}

.badge-secondary {
    background: #e9ecef;
    color: #6c757d;
}

/* ====================== */
/* Alerts */
/* ====================== */

.alert {
    border: none;
    border-radius: var(--border-radius);
    padding: 1rem 1.25rem;
}

.alert-success {
    background: #d1e7dd;
    color: #0f5132;
}

.alert-danger {
    background: #f8d7da;
    color: #842029;
}

.alert-warning {
    background: #fff3cd;
    color: #664d03;
}

.alert-info {
    background: #cff4fc;
    color: #055160;
}

/* ====================== */
/* Modals */
/* ====================== */

.modal-content {
    border: none;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
}

.modal-title {
    font-weight: 600;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
}

/* ====================== */
/* Dropdowns */
/* ====================== */

.dropdown-menu {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 0.5rem;
}

.dropdown-item {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: var(--transition);
}

.dropdown-item:hover {
    background: var(--light);
}

.dropdown-item.active {
    background: var(--primary);
}

/* ====================== */
/* Login Page */
/* ====================== */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a3d2e 0%, #0d261b 100%);
    padding: 2rem;
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo i {
    font-size: 3rem;
    color: var(--primary);
}

.login-logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 1rem;
}

.login-form .form-control {
    padding: 0.75rem 1rem;
}

.login-form .btn {
    padding: 0.75rem;
    font-size: 1rem;
}

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
}

.login-footer a {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ====================== */
/* Public Survey Page */
/* ====================== */

.survey-page {
    min-height: 100vh;
    background: var(--bg-body);
    padding: 2rem;
}

.survey-container {
    max-width: 700px;
    margin: 0 auto;
}

.survey-header {
    text-align: center;
    margin-bottom: 2rem;
}

.survey-header h1 {
    color: var(--primary);
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.survey-card {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.survey-question {
    margin-bottom: 2rem;
}

.survey-question:last-child {
    margin-bottom: 0;
}

.survey-question-title {
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.survey-question-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    font-size: 0.875rem;
    margin-right: 0.75rem;
}

/* Rating Scale */
.rating-scale {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.rating-scale .rating-option {
    flex: 1;
    min-width: 50px;
}

.rating-scale input[type="radio"] {
    display: none;
}

.rating-scale label {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 50px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
}

.rating-scale label:hover {
    border-color: var(--primary);
    background: var(--primary-bg);
}

.rating-scale input[type="radio"]:checked + label {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

/* NPS Scale */
.nps-scale {
    display: flex;
    gap: 0.25rem;
}

.nps-scale .nps-option {
    flex: 1;
}

.nps-scale input[type="radio"] {
    display: none;
}

.nps-scale label {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
}

.nps-scale label:hover {
    border-color: var(--primary);
}

.nps-scale input[type="radio"]:checked + label {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

.nps-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Choice Options */
.choice-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.choice-option {
    position: relative;
}

.choice-option input {
    display: none;
}

.choice-option label {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.choice-option label:hover {
    border-color: var(--primary);
}

.choice-option input:checked + label {
    border-color: var(--primary);
    background: var(--primary-bg);
}

.choice-option label::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    margin-right: 0.75rem;
    transition: var(--transition);
}

.choice-option input[type="checkbox"] + label::before {
    border-radius: 4px;
}

.choice-option input:checked + label::before {
    border-color: var(--primary);
    background: var(--primary);
    box-shadow: inset 0 0 0 3px #fff;
}

/* Survey Success */
.survey-success {
    text-align: center;
    padding: 3rem 2rem;
}

.survey-success-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--primary-bg);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2.5rem;
}

.survey-success h2 {
    color: var(--primary);
    margin-bottom: 1rem;
}

/* ====================== */
/* Dashboard Charts */
/* ====================== */

.chart-container {
    position: relative;
    height: 300px;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
    justify-content: center;
}

.chart-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.chart-legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

/* ====================== */
/* DataTables */
/* ====================== */

.dataTables_wrapper {
    padding: 0;
}

.dataTables_filter input {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.5rem 1rem;
    margin-left: 0.5rem;
}

.dataTables_length select {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.25rem 0.5rem;
}

.dataTables_info {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.dataTables_paginate .paginate_button {
    border-radius: var(--border-radius) !important;
    margin: 0 2px;
}

.dataTables_paginate .paginate_button.current {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #fff !important;
}

/* ====================== */
/* Utilities */
/* ====================== */

.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger { color: var(--danger) !important; }
.text-info { color: var(--info) !important; }
.text-muted { color: var(--text-muted) !important; }

.bg-primary { background-color: var(--primary) !important; }
.bg-primary-light { background-color: var(--primary-bg) !important; }
.bg-success { background-color: var(--success) !important; }
.bg-warning { background-color: var(--warning) !important; }
.bg-danger { background-color: var(--danger) !important; }
.bg-info { background-color: var(--info) !important; }

.border-primary { border-color: var(--primary) !important; }

.rounded-lg { border-radius: var(--border-radius-lg) !important; }

.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow { box-shadow: var(--shadow) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }

.cursor-pointer { cursor: pointer; }

.divider {
    height: 1px;
    background: var(--border-color);
    margin: 1.5rem 0;
}

/* ====================== */
/* Animations */
/* ====================== */

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.pulse {
    animation: pulse 2s infinite;
}

/* ====================== */
/* Loading States */
/* ====================== */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner-border-lg {
    width: 3rem;
    height: 3rem;
}

/* ====================== */
/* Print Styles */
/* ====================== */

@media print {
    .sidebar,
    .main-header,
    .no-print {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}

/* ====================== */
/* Responsive */
/* ====================== */

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar-open .sidebar {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .sidebar-open .main-content::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }
}

@media (max-width: 767.98px) {
    .content {
        padding: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .stat-card .stat-value {
        font-size: 1.5rem;
    }
    
    .page-title {
        font-size: 1.1rem;
    }
    
    .header-user .user-info {
        display: none;
    }
    
    .rating-scale,
    .nps-scale {
        flex-wrap: wrap;
    }
    
    .rating-scale .rating-option,
    .nps-scale .nps-option {
        flex: 0 0 calc(20% - 0.5rem);
    }
}

@media (max-width: 575.98px) {
    .login-card {
        padding: 1.5rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
    }
    
    .table-responsive {
        font-size: 0.85rem;
    }
}

/* ====================== */
/* Dark Mode Support (Future) */
/* ====================== */

@media (prefers-color-scheme: dark) {
    /* Preparado para futuro suporte a tema escuro */
}
