/* Global Back Button Positioning Fix */
/* This file ensures back button appears consistently above the footer across all pages */

.back-button-container {
    position: fixed;
    bottom: 1rem; /* Much closer to bottom when footer not visible */
    right: 2rem;
    z-index: 1000;
    transition: bottom 0.3s ease; /* Smooth transition when adjusting position */
}

/* When footer is visible, push button up */
.footer-visible .back-button-container {
    bottom: 3.5rem; /* Moves up when footer is in view */
}

.btn-back {
    display: flex;
    align-items: center;
    gap: 0.4rem; /* Slightly tighter gap */
    padding: 0.35rem 1rem; /* Much smaller height - reduced from 0.75rem 1.5rem */
    background: #2C3E50;
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem; /* Font size unchanged as requested */
    box-shadow: 0 4px 16px rgba(37, 51, 86, 0.3);
    border: 2px solid #2C3E50;
    white-space: nowrap;
    transition: all 0.2s ease;
    line-height: 1.2; /* Tighter line height for compact look */
}

.btn-back:hover {
    background: white;
    color: #2C3E50;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 51, 86, 0.4);
    text-decoration: none;
}

.btn-back:active {
    transform: translateY(0);
}

.btn-back i {
    font-size: 0.9rem;
}

/* Tablet responsive */
@media (max-width: 768px) {
    .back-button-container {
        bottom: 0.75rem; /* Closer to bottom on tablet */
        right: 1rem;
    }
    
    .footer-visible .back-button-container {
        bottom: 3rem; /* Push up when footer visible */
    }
    
    .btn-back {
        padding: 0.3rem 0.85rem; /* Compact on tablet */
        font-size: 0.85rem;
        border-radius: 30px;
    }
    
    .btn-back span {
        display: inline; /* Keep text on tablets */
    }
    
    .btn-back i {
        font-size: 0.85rem;
    }
}

/* Mobile responsive */
@media (max-width: 480px) {
    .back-button-container {
        bottom: 0.5rem; /* Very close to bottom on mobile */
        right: 0.75rem;
    }
    
    .footer-visible .back-button-container {
        bottom: 2.5rem; /* Push up when footer visible */
    }
    
    .btn-back {
        padding: 0.25rem 0.6rem; /* Very compact on mobile */
        font-size: 0.75rem;
        min-width: 44px; /* Accessibility minimum */
        border-width: 1.5px;
        border-radius: 24px;
    }
    
    .btn-back span {
        display: none; /* Hide text on mobile, icon only */
    }
    
    .btn-back i {
        margin-right: 0;
        font-size: 0.8rem;
    }
}

/* Ensure content doesn't overlap with back button - scope to main content only */
#main-content {
    padding-bottom: 4rem;
}

/* Special case for chat module - might need different positioning */
.chat-module .back-button-container {
    bottom: 5rem; /* Slightly higher for chat module if needed */
}