/* Estilos para la Encuesta de Reciclaje */

/* Ajuste para el body cuando el nav es fixed */
body {
    padding-top: 70px; /* Altura del nav */
}

.survey-container {
    max-width: 800px;
    margin: 20px auto 40px;
    padding: 20px;
    min-height: calc(100vh - 120px);
}

.survey-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px;
    background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
    border-radius: 15px;
    color: white;
    transition: all 0.3s ease;
}

.survey-header.compact {
    padding: 12px 20px;
    margin-bottom: 30px;
}

.survey-header h1 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    font-weight: 700;
    transition: opacity 0.3s ease, max-height 0.3s ease;
    max-height: 100px;
    overflow: hidden;
}

.survey-header.compact h1 {
    opacity: 0;
    max-height: 0;
    margin: 0;
}

.survey-header p {
    transition: opacity 0.3s ease, max-height 0.3s ease;
    overflow: hidden;
}

.survey-header.compact p:not(.progress-text) {
    opacity: 0;
    max-height: 0;
    margin: 0;
}

.survey-time {
    font-size: 0.95rem;
    opacity: 0.9;
    margin-bottom: 20px;
}

/* Barra de progreso */
.progress-bar {
    width: 100%;
    height: 8px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.survey-header.compact .progress-bar {
    height: 10px;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background-color: white;
    border-radius: 4px;
    transition: width 0.5s ease;
    width: 0%;
}

.progress-text {
    font-size: 0.9rem;
    opacity: 0.9;
    transition: all 0.3s ease;
}

.survey-header.compact .progress-text {
    font-size: 0.85rem;
    margin-bottom: 0;
}

/* Secciones del formulario */
.survey-section {
    display: none;
    animation: fadeIn 0.3s ease;
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.survey-section.active {
    display: block;
}

.survey-section h2 {
    color: #2E7D32;
    font-size: 1.4rem;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 2px solid #E8F5E9;
}

/* Grupos de preguntas */
.question-group {
    margin-bottom: 30px;
}

.question {
    display: block;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 15px;
    font-size: 1.05rem;
}

/* Opciones de radio */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radio-option {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: #F5F5F5;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.radio-option:hover {
    background: #E8F5E9;
    border-color: #4CAF50;
}

.radio-option input[type="radio"] {
    margin-right: 12px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.radio-option input[type="radio"]:checked + span {
    font-weight: 600;
    color: #2E7D32;
}

.radio-option input[type="radio"]:checked {
    accent-color: #4CAF50;
}

/* Opciones de checkbox */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.checkbox-option {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: #F5F5F5;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.checkbox-option:hover {
    background: #E8F5E9;
    border-color: #4CAF50;
}

.checkbox-option input[type="checkbox"] {
    margin-right: 12px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #4CAF50;
}

.checkbox-option input[type="checkbox"]:checked + span {
    font-weight: 600;
    color: #2E7D32;
}

.checkbox-counter {
    text-align: right;
    color: #666;
    font-size: 0.9rem;
    margin-top: 10px;
}

.checkbox-counter span {
    font-weight: 600;
    color: #2E7D32;
}

/* Grupo de ranking */
.ranking-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ranking-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: #F5F5F5;
    border-radius: 8px;
    gap: 15px;
}

.ranking-number select {
    width: 60px;
    padding: 5px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 600;
    background: white;
    cursor: pointer;
}

.ranking-number select:focus {
    outline: none;
    border-color: #4CAF50;
}

.ranking-help {
    text-align: center;
    color: #666;
    font-size: 0.9rem;
    margin-top: 10px;
    font-style: italic;
}

/* Campo de texto */
.text-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.text-input:focus {
    outline: none;
    border-color: #4CAF50;
    background: #F9FFF9;
}

/* Navegación */
.survey-navigation {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #E8F5E9;
}

.btn-nav {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-prev {
    background: #F5F5F5;
    color: #666;
}

.btn-prev:not(:disabled):hover {
    background: #E0E0E0;
}

.btn-prev:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-next, .btn-submit {
    background: #4CAF50;
    color: white;
    margin-left: auto;
}

.btn-next:hover, .btn-submit:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

/* Mensajes de éxito y error */
.success-message, .error-message {
    display: none;
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.5s ease;
}

.success-message.show, .error-message.show {
    display: block;
}

.success-message i {
    font-size: 4rem;
    color: #4CAF50;
    margin-bottom: 20px;
}

.error-message i {
    font-size: 4rem;
    color: #f44336;
    margin-bottom: 20px;
}

.success-message h2, .error-message h2 {
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.success-message p, .error-message p {
    color: #666;
    margin-bottom: 25px;
}

.btn-home, .btn-retry {
    display: inline-block;
    padding: 12px 30px;
    background: #4CAF50;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.btn-home:hover, .btn-retry:hover {
    background: #45a049;
    transform: translateY(-2px);
}

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

/* Responsive */
@media (max-width: 768px) {
    .survey-container {
        margin-top: 60px;
        padding: 15px;
    }

    .survey-header h1 {
        font-size: 1.4rem;
    }

    .survey-section {
        padding: 20px;
    }

    .survey-section h2 {
        font-size: 1.2rem;
    }

    .question {
        font-size: 1rem;
    }

    .radio-option, .checkbox-option {
        padding: 10px 12px;
    }

    .survey-navigation {
        flex-direction: column;
    }

    .btn-nav {
        width: 100%;
        justify-content: center;
    }

    .btn-next, .btn-submit {
        margin-left: 0;
    }
}

/* Ajustes para el navbar activo */
.nav-links a.active {
    color: #4CAF50;
    font-weight: 600;
}

/* Botón flotante de enviar */
.floating-submit-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
    display: none;  /* Oculto por defecto, se muestra desde sección 1 */
}

.fab-container {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

/* Contador de preguntas */
.questions-counter {
    background: white;
    padding: 8px 16px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    transform-origin: bottom right;
}

.questions-counter.hidden {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
}

.counter-number {
    font-size: 1.2rem;
    font-weight: 700;
    color: #f44336;
    min-width: 25px;
    text-align: center;
}

.counter-text {
    font-size: 0.9rem;
    color: #666;
    white-space: nowrap;
}

/* Estado completado del contador */
.questions-counter.completed {
    background: #E8F5E9;
}

.questions-counter.completed .counter-number {
    color: #4CAF50;
}

.questions-counter.completed .counter-text {
    color: #2E7D32;
}

/* Botón FAB */
.fab-button {
    background: #cccccc;
    color: white;
    border: none;
    border-radius: 30px;
    padding: 16px 24px;
    font-size: 1rem;
    font-weight: 600;
    cursor: not-allowed;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

.fab-button i {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.fab-button span {
    transition: all 0.3s ease;
}

/* Estado deshabilitado */
.fab-button:disabled {
    background: linear-gradient(135deg, #cccccc 0%, #999999 100%);
    opacity: 0.7;
}

/* Estado habilitado */
.fab-button:not(:disabled) {
    background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
    cursor: pointer;
    animation: pulse 2s infinite;
}

.fab-button:not(:disabled):hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
    padding-right: 30px;
}

.fab-button:not(:disabled):hover i {
    transform: translateX(3px) rotate(-15deg);
}

/* Animación de pulso cuando está listo */
@keyframes pulse {
    0% {
        box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
    }
    50% {
        box-shadow: 0 4px 20px rgba(76, 175, 80, 0.5);
    }
    100% {
        box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
    }
}

/* Efecto de onda al hacer clic */
.fab-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.fab-button:not(:disabled):active::before {
    width: 300px;
    height: 300px;
}

/* Responsive para móviles */
@media (max-width: 768px) {
    .floating-submit-button {
        bottom: 20px;
        right: 20px;
    }
    
    .questions-counter {
        padding: 6px 12px;
    }
    
    .counter-number {
        font-size: 1rem;
    }
    
    .counter-text {
        font-size: 0.8rem;
    }
    
    .fab-button {
        padding: 14px 20px;
        font-size: 0.95rem;
    }
    
    .fab-button i {
        font-size: 1.1rem;
    }
}

/* Animación de entrada */
@keyframes slideInUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translate(-50%, -20px);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

.floating-submit-button {
    animation: slideInUp 0.5s ease 0.5s both;
}

/* Ocultar el botón flotante cuando se muestra el mensaje de éxito */
.floating-submit-button.hidden {
    display: none;
}

/* Estilos para el autocompletado de colonias */
.autocomplete-container {
    position: relative;
    width: 100%;
}

.autocomplete-input {
    width: 100%;
    padding-right: 40px;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 250px;
    overflow-y: auto;
    background: white;
    border: 2px solid #ddd;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: none;
}

.autocomplete-dropdown.show {
    display: block;
}

.autocomplete-option {
    padding: 12px 15px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.autocomplete-option:last-child {
    border-bottom: none;
}

.autocomplete-option:hover,
.autocomplete-option.selected {
    background-color: #E8F5E9;
}

.autocomplete-option.highlighted {
    background-color: #C8E6C9;
}

.colonia-nombre {
    font-weight: 600;
    color: #2E7D32;
    display: block;
}

.colonia-municipio {
    font-size: 0.85rem;
    color: #666;
    margin-top: 2px;
}

.autocomplete-no-results {
    padding: 15px;
    text-align: center;
    color: #999;
    font-style: italic;
}

/* Indicador de carga */
.autocomplete-loading {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-top-color: #4CAF50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: none;
}

.autocomplete-input.loading ~ .autocomplete-loading {
    display: block;
}

@keyframes spin {
    to { transform: translateY(-50%) rotate(360deg); }
}

/* Ajustes para móviles */
@media (max-width: 768px) {
    .autocomplete-dropdown {
        max-height: 200px;
    }
    
    .autocomplete-option {
        padding: 10px 12px;
    }
}

/* Estilos para reCAPTCHA simulado */
.recaptcha-container {
    margin: 20px 0;
}

.recaptcha-box {
    background: #f9f9f9;
    border: 1px solid #d3d3d3;
    border-radius: 3px;
    padding: 9px 9px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.1s ease;
    max-width: 302px;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.08);
    position: relative;
}

.recaptcha-box:hover {
    border-color: #b3b3b3;
}

.recaptcha-box.verified {
    pointer-events: none;
}

.recaptcha-checkbox {
    width: 24px;
    height: 24px;
    border: 2px solid #c1c1c1;
    border-radius: 2px;
    background: white;
    position: relative;
    transition: all 0.15s ease;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.recaptcha-box:hover .recaptcha-checkbox {
    border-color: #b3b3b3;
}

.checkbox-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid #4285f4;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.5s linear infinite;
}

@media (max-width: 768px) {
    .checkbox-spinner {
        width: 14px;
        height: 14px;
        border-width: 2px;
    }
}

.recaptcha-box.loading .checkbox-spinner {
    display: block;
}

.checkbox-checkmark {
    display: none;
}

.recaptcha-box.verified .recaptcha-checkbox {
    background: #4285f4;
    border-color: #4285f4;
}

.recaptcha-box.verified .checkbox-checkmark {
    display: block;
    animation: checkmark 0.2s ease;
}

@keyframes checkmark {
    from {
        transform: scale(0) rotate(45deg);
    }
    to {
        transform: scale(1) rotate(0deg);
    }
}

.recaptcha-label {
    font-family: Roboto, helvetica, arial, sans-serif;
    font-size: 14px;
    line-height: 17px;
    color: #000;
    font-weight: 400;
    user-select: none;
    flex-shrink: 0;
}

.recaptcha-logo {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 4px;
    padding-left: 8px;
}

.recaptcha-logo img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.recaptcha-text {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1;
}

.recaptcha-text span:first-child {
    font-family: Roboto, helvetica, arial, sans-serif;
    font-size: 10px;
    line-height: 10px;
    color: #555;
    font-weight: 400;
    margin-bottom: 2px;
}

.recaptcha-links {
    font-family: Roboto, helvetica, arial, sans-serif;
    font-size: 8px;
    line-height: 8px;
    color: #555;
}


.help-text {
    font-size: 0.85rem;
    color: #666;
    margin-top: 5px;
    font-style: italic;
}

/* Responsive para móviles */
@media (max-width: 768px) {
    .recaptcha-box {
        max-width: 100%;
        padding: 8px 8px;
        gap: 10px;
    }
    
    .recaptcha-checkbox {
        width: 22px;
        height: 22px;
    }
    
    .recaptcha-label {
        font-size: 13px;
        flex: 1;
    }
    
    .recaptcha-logo {
        gap: 2px;
        padding-left: 4px;
    }
    
    .recaptcha-logo img {
        width: 28px;
        height: 28px;
    }
    
    .recaptcha-text {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
    }
    
    .recaptcha-text span:first-child {
        font-size: 9px;
        line-height: 9px;
    }
    
    .recaptcha-links {
        font-size: 7px;
        line-height: 7px;
    }
}