/* Cuestionario Styles - REPRO Guatemala */

/* ================================
   LAYOUT Y CONTENEDORES
   ================================ */

.cuestionario-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2rem 0;
}

.cuestionario-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 2rem;
}

.cuestionario-header {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    padding: 2rem;
    text-align: center;
}

.cuestionario-header h1 {
    margin: 0;
    font-size: 2.5rem;
    font-weight: 300;
}

.cuestionario-header p {
    margin: 0.5rem 0 0 0;
    opacity: 0.9;
}

/* ================================
   NAVEGACIÓN DE SECCIONES
   ================================ */

.section-navigation {
    background: #f8f9fa;
    padding: 1rem 0;
    border-bottom: 1px solid #dee2e6;
}

.section-nav-item {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    margin: 0 0.25rem;
    border-radius: 25px;
    background: white;
    color: #6c757d;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 2px solid #e9ecef;
}

.section-nav-item:hover {
    background: #e9ecef;
    color: #495057;
    text-decoration: none;
}

.section-nav-item.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.section-nav-item.completed {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

.section-nav-item .section-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    margin-right: 0.5rem;
    font-weight: bold;
}

.section-nav-item.active .section-number,
.section-nav-item.completed .section-number {
    background: rgba(255, 255, 255, 0.3);
}

/* ================================
   INDICADORES DE PROGRESO
   ================================ */

.progress-container {
    padding: 1.5rem;
    background: white;
    border-bottom: 1px solid #dee2e6;
}

.progress-bar-custom {
    height: 8px;
    border-radius: 10px;
    background: #e9ecef;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50 0%, #45a049 100%);
    border-radius: 10px;
    transition: width 0.5s ease;
}

.progress-text {
    text-align: center;
    color: #6c757d;
    font-size: 0.9rem;
}

.section-indicators {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

.section-indicator {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e9ecef;
    color: #6c757d;
    font-weight: bold;
    transition: all 0.3s ease;
    cursor: pointer;
}

.section-indicator.active {
    background: #007bff;
    color: white;
    transform: scale(1.1);
}

.section-indicator.completed {
    background: #28a745;
    color: white;
}

.section-indicator.completed::before {
    content: '\f00c';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
}

/* ================================
   FORMULARIOS Y CAMPOS
   ================================ */

.cuestionario-content {
    padding: 2rem;
}

.section-title {
    color: #2c3e50;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid #4CAF50;
    font-weight: 600;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.form-control {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 0.75rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: #4CAF50;
    box-shadow: 0 0 0 0.2rem rgba(76, 175, 80, 0.25);
}

.form-control.is-invalid {
    border-color: #dc3545;
    animation: shake 0.5s ease-in-out;
}

.form-control.is-valid {
    border-color: #28a745;
}

.invalid-feedback {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #dc3545;
    animation: fadeIn 0.3s ease;
}

.valid-feedback {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #28a745;
}

/* ================================
   CAMPOS ESPECIALES
   ================================ */

.form-check {
    margin-bottom: 1rem;
}

.form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.125rem;
}

.form-check-label {
    font-weight: 500;
    margin-left: 0.5rem;
}

.form-select {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 0.75rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-select:focus {
    border-color: #4CAF50;
    box-shadow: 0 0 0 0.2rem rgba(76, 175, 80, 0.25);
}

/* ================================
   FIRMA DIGITAL
   ================================ */

.signature-container {
    margin: 2rem 0;
    text-align: center;
}

.signature-pad {
    border: 3px dashed #dee2e6;
    border-radius: 10px;
    background: #f8f9fa;
    margin: 1rem 0;
    position: relative;
    cursor: crosshair;
}

.signature-pad.signing {
    border-color: #4CAF50;
    background: white;
}

.signature-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #6c757d;
    font-style: italic;
    pointer-events: none;
}

.signature-controls {
    margin-top: 1rem;
}

.btn-clear-signature {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.btn-clear-signature:hover {
    background: #c82333;
}

/* ================================
   BOTONES DE NAVEGACIÓN
   ================================ */

.navigation-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

.btn-navigation {
    padding: 0.75rem 2rem;
    border-radius: 25px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-anterior {
    background: #6c757d;
    color: white;
}

.btn-anterior:hover {
    background: #5a6268;
    transform: translateX(-2px);
}

.btn-siguiente {
    background: #007bff;
    color: white;
}

.btn-siguiente:hover {
    background: #0056b3;
    transform: translateX(2px);
}

.btn-finalizar {
    background: #28a745;
    color: white;
}

.btn-finalizar:hover {
    background: #1e7e34;
    transform: scale(1.05);
}

.btn-guardar-borrador {
    background: #ffc107;
    color: #212529;
}

.btn-guardar-borrador:hover {
    background: #e0a800;
}

/* ================================
   ESTADO DE AUTO-GUARDADO
   ================================ */

.auto-save-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1050;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.auto-save-indicator.saving {
    background: #ffc107;
    color: #212529;
}

.auto-save-indicator.saved {
    background: #28a745;
    color: white;
}

.auto-save-indicator.error {
    background: #dc3545;
    color: white;
}

/* ================================
   ALERTAS Y NOTIFICACIONES
   ================================ */

.alert-custom {
    border: none;
    border-radius: 10px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid;
}

.alert-info-custom {
    background: #e3f2fd;
    border-left-color: #2196f3;
    color: #1565c0;
}

.alert-success-custom {
    background: #e8f5e8;
    border-left-color: #4caf50;
    color: #2e7d32;
}

.alert-warning-custom {
    background: #fff3e0;
    border-left-color: #ff9800;
    color: #ef6c00;
}

.alert-error-custom {
    background: #ffebee;
    border-left-color: #f44336;
    color: #c62828;
}

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

@media (max-width: 768px) {
    .cuestionario-container {
        padding: 1rem 0;
    }
    
    .cuestionario-header {
        padding: 1.5rem;
    }
    
    .cuestionario-header h1 {
        font-size: 2rem;
    }
    
    .cuestionario-content {
        padding: 1.5rem;
    }
    
    .section-navigation {
        padding: 0.5rem;
        overflow-x: auto;
    }
    
    .section-nav-item {
        margin: 0 0.125rem;
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    .section-indicators {
        gap: 0.5rem;
    }
    
    .section-indicator {
        width: 35px;
        height: 35px;
    }
    
    .navigation-buttons {
        flex-direction: column;
        gap: 1rem;
        padding: 1.5rem;
    }
    
    .btn-navigation {
        width: 100%;
        justify-content: center;
    }
    
    .signature-pad {
        height: 200px;
    }
}

@media (max-width: 576px) {
    .cuestionario-header h1 {
        font-size: 1.75rem;
    }
    
    .cuestionario-content {
        padding: 1rem;
    }
    
    .section-nav-item {
        padding: 0.5rem 0.75rem;
        margin: 0;
    }
    
    .section-nav-item .section-number {
        width: 25px;
        height: 25px;
        margin-right: 0.25rem;
    }
    
    .form-control {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

/* ================================
   ANIMACIONES
   ================================ */

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

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.stat-updated {
    animation: pulse 0.6s ease-in-out;
}

/* ================================
   ADMIN STYLES
   ================================ */

.admin-cuestionarios .card {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border: 1px solid rgba(0, 0, 0, 0.125);
}

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

.filter-controls {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.stats-cards {
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: #6c757d;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card.pendientes .stat-number {
    color: #ffc107;
}

.stat-card.en-progreso .stat-number {
    color: #17a2b8;
}

.stat-card.completados .stat-number {
    color: #28a745;
}

.bulk-actions {
    background: #e3f2fd;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid #2196f3;
}

.table-responsive {
    border-radius: 8px;
    overflow: hidden;
}

.table th {
    background: #f8f9fa;
    border-top: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

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

.sortable:hover {
    background: #e9ecef;
}

.sort-icon {
    margin-left: 0.5rem;
    opacity: 0.5;
}

.sortable.active .sort-icon {
    opacity: 1;
}

.progress-mini {
    height: 8px;
    border-radius: 4px;
}

.badge-status {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
}

.dropdown-menu {
    border: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.dropdown-item {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.dropdown-item:hover {
    background: #f8f9fa;
}

/* ================================
   UTILIDADES
   ================================ */

.text-muted-light {
    color: #9e9e9e !important;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.bg-gradient-success {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
}

.shadow-sm-custom {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.shadow-custom {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.border-radius-lg {
    border-radius: 12px !important;
}

.border-radius-xl {
    border-radius: 16px !important;
}