/* --- Footer --- */
footer {
    background: var(--header-gradient);
    color: var(--header-text);
    text-align: center;
    padding: var(--spacing-xl) var(--spacing-md) var(--spacing-lg);
    width: 100%;
    box-shadow: 
        0 -12px 40px rgba(0, 0, 0, 0.12), 
        0 -4px 16px rgba(0, 0, 0, 0.08),
        0 -2px 8px rgba(0, 0, 0, 0.04);
    backdrop-filter: blur(15px);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    position: relative;
    overflow: hidden;
    margin-top: auto; /* Esto empuja el footer al fondo */
    flex-shrink: 0; /* Evita que el footer se encoja */
}

/* Efecto de ondas sutiles en el footer */
footer::after {
    content: '';
    position: absolute;
    top: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.3) 25%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.3) 75%,
        rgba(255, 255, 255, 0.1) 100%);
    animation: waveShimmer 3s ease-in-out infinite;
}

@keyframes waveShimmer {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Efecto de partículas flotantes sutil */
footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px, 80px 80px, 120px 120px;
    animation: floatingParticles 20s linear infinite;
    pointer-events: none;
}

@keyframes floatingParticles {
    0% { transform: translateY(0); }
    100% { transform: translateY(-100px); }
}

footer p {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 500;
    opacity: 0.95;
    letter-spacing: 0.3px;
    line-height: 1.5;
}

.footer-contact {
    margin-top: var(--spacing-md);
    font-size: 0.85rem;
    opacity: 0.8;
}

.footer-contact a {
    color: inherit;
    text-decoration: none;
    transition: all 0.3s ease;
    border-bottom: 1px solid transparent;
}

.footer-contact a:hover {
    opacity: 1;
    border-bottom-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.footer-version-info {
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-lg);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-lg);
    flex-wrap: wrap;
    position: relative;
}

.footer-version-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.4) 50%, 
        transparent 100%);
}

#app-version-info {
    font-size: 0.85rem;
    opacity: 0.9;
    font-family: 'SF Mono', 'Monaco', 'Consolas', 'Courier New', monospace;
    font-weight: 600;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.06));
    padding: 6px 14px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.4s ease;
    backdrop-filter: blur(10px);
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

#app-version-info::before {
    content: 'v';
    opacity: 0.6;
    margin-right: 2px;
    font-size: 0.75em;
}

#app-version-info:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.1));
    transform: translateY(-2px) scale(1.02);
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 1;
}

#force-update-btn {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(15px);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    width: auto;
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.15),
        0 2px 8px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    justify-content: center;
}

#force-update-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0) 0%, 
        rgba(255, 255, 255, 0.3) 50%, 
        rgba(255, 255, 255, 0) 100%);
    transition: left 0.6s ease;
}

/* Añadir un icono de actualización animado */
#force-update-btn::after {
    content: '↻';
    font-size: 1.1em;
    animation: none;
    transition: transform 0.4s ease;
}

#force-update-btn:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.1));
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.2),
        0 4px 12px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

#force-update-btn:hover::after {
    transform: rotate(180deg);
}

#force-update-btn:hover::before {
    left: 100%;
}

#force-update-btn:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Estados especiales del botón de actualización */
#force-update-btn.updating {
    background: linear-gradient(135deg, rgba(76, 201, 240, 0.3), rgba(76, 201, 240, 0.1));
    border-color: rgba(76, 201, 240, 0.5);
    color: rgba(76, 201, 240, 1);
    cursor: not-allowed;
    pointer-events: none;
    animation: updateSpinning 1s linear infinite;
}

#force-update-btn.updating::after {
    content: '⟳';
    animation: updateSpinning 1s linear infinite;
}

@keyframes updateSpinning {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#force-update-btn.success {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.3), rgba(34, 197, 94, 0.1));
    border-color: rgba(34, 197, 94, 0.5);
    color: rgba(34, 197, 94, 1);
    animation: successPulse 0.8s ease;
}

#force-update-btn.success::after {
    content: '✓';
    animation: none;
    transform: scale(1.2);
}

#force-update-btn.error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.3), rgba(239, 68, 68, 0.1));
    border-color: rgba(239, 68, 68, 0.5);
    color: rgba(239, 68, 68, 1);
    animation: errorShake 0.8s ease;
}

#force-update-btn.error::after {
    content: '✗';
    animation: none;
    transform: scale(1.1);
}

@keyframes successPulse {
    0%, 100% { 
        transform: translateY(-3px) scale(1); 
        box-shadow: 0 8px 25px rgba(34, 197, 94, 0.3);
    }
    50% { 
        transform: translateY(-3px) scale(1.05); 
        box-shadow: 0 12px 35px rgba(34, 197, 94, 0.4);
    }
}

@keyframes errorShake {
    0%, 100% { transform: translateY(-3px) translateX(0); }
    15% { transform: translateY(-3px) translateX(-4px); }
    30% { transform: translateY(-3px) translateX(4px); }
    45% { transform: translateY(-3px) translateX(-2px); }
    60% { transform: translateY(-3px) translateX(2px); }
    75% { transform: translateY(-3px) translateX(-1px); }
    90% { transform: translateY(-3px) translateX(1px); }
}

/* Responsive design para footer */
@media (max-width: 480px) {
    footer {
        padding: var(--spacing-lg) var(--spacing-sm);
    }
    
    footer p {
        font-size: 0.9rem;
        line-height: 1.4;
    }
    
    .footer-version-info {
        flex-direction: column;
        gap: var(--spacing-md);
        margin-top: var(--spacing-md);
        padding-top: var(--spacing-md);
    }
    
    #app-version-info {
        font-size: 0.8rem;
        padding: 5px 12px;
    }
    
    #force-update-btn {
        font-size: 0.75rem;
        padding: 8px 16px;
        border-radius: 20px;
        min-width: 100px;
        letter-spacing: 0.6px;
    }
    
    #force-update-btn::after {
        font-size: 1em;
    }
}

/* Mejora para tablets */
@media (max-width: 768px) and (min-width: 481px) {
    .footer-version-info {
        gap: var(--spacing-md);
    }
    
    #force-update-btn {
        padding: 9px 18px;
        font-size: 0.78rem;
    }
}

/* Settings Button */
#settings-btn {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(15px);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    width: auto;
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.15),
        0 2px 8px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    justify-content: center;
}

#settings-btn:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.1));
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.2),
        0 4px 12px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

#settings-btn:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Settings Modal Styles */
.settings-modal-content {
    max-width: 500px;
    width: 90%;
}

.settings-section {
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
}

.settings-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.settings-section h4 {
    margin: 0 0 var(--spacing-md) 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.cache-info-container {
    background: var(--background-secondary);
    border-radius: 8px;
    padding: var(--spacing-md);
}

.cache-stats {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.cache-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-xs) 0;
}

.cache-stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.cache-stat-value {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.cache-divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: var(--spacing-sm) 0;
}

.settings-warning {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 8px;
    padding: var(--spacing-sm) var(--spacing-md);
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: var(--spacing-md);
}

.settings-weekly-goal-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--spacing-sm);
    align-items: end;
}

.settings-weekly-goal-controls label {
    grid-column: 1 / -1;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
}

#weekly-target-days-select {
    min-height: 42px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 12px;
    background: var(--background-secondary);
    color: var(--text-primary);
    font-weight: 600;
}

#weekly-target-save-btn {
    width: auto;
    padding: 10px 18px;
    min-height: 42px;
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.btn-danger:active {
    transform: translateY(0);
}

.btn-secondary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-secondary:active {
    transform: translateY(0);
}

.firebase-usage-list {
    margin-top: var(--spacing-md);
}

.firebase-usage-list ul {
    margin: var(--spacing-xs) 0 0 0;
    padding-left: 18px;
}

.firebase-usage-list li {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.error-text {
    color: #e74c3c;
    font-size: 0.9rem;
}

/* Responsive Settings Button */
@media (max-width: 480px) {
    #settings-btn {
        font-size: 0.75rem;
        padding: 8px 16px;
        border-radius: 20px;
        min-width: 100px;
        letter-spacing: 0.6px;
    }
    
    .settings-modal-content {
        width: 95%;
        margin: 10px;
    }

    .settings-weekly-goal-controls {
        grid-template-columns: 1fr;
    }

    #weekly-target-save-btn {
        width: 100%;
    }
}

@media (max-width: 768px) and (min-width: 481px) {
    #settings-btn {
        padding: 9px 18px;
        font-size: 0.78rem;
    }
}
