/* 푸터 강제 표시 - 긴급 수정 */

.footer,
#common-footer,
footer,
footer.footer,
footer#common-footer {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    background-color: #f8f9fa !important;
    padding: 12px 0 !important;
    margin-top: 20px !important;
    margin-bottom: 85px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    z-index: 1 !important;
    min-height: 50px !important;
    font-size: 14px !important;
    text-align: center !important;
}

/* 다크모드에서도 푸터 보이도록 */
body.dark-mode .footer,
body.dark-mode #common-footer,
body.dark-mode footer,
body.dark-mode footer.footer,
body.dark-mode footer#common-footer {
    background-color: #1f2937 !important;
    color: #e5e7eb !important;
}

/* 푸터 내용도 강제 표시 */
.footer *,
#common-footer *,
footer *,
footer.footer *,
footer#common-footer * {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: inherit !important;
}

/* 푸터 콘텐츠 레이아웃 */
.footer-content {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 0 20px !important;
    gap: 30px !important; /* reserved.와 다크모드 버튼 사이 간격 */
}

/* 테마 토글 버튼 - 높은 우선순위 */
footer .theme-toggle,
#common-footer .theme-toggle,
.footer .theme-toggle,
footer#common-footer .theme-toggle,
footer.footer .theme-toggle,
button.theme-toggle,
button#themeToggle {
    background: #6366f1 !important;
    color: white !important;
    border: none !important;
    padding: 8px 12px !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    font-size: 12px !important;
    margin-left: 40px !important; /* reserved.와 추가 간격 */
    margin-right: 0 !important; /* 다른 CSS 파일 오버라이드 */
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    flex-shrink: 0 !important; /* 버튼 크기 고정 */
    white-space: nowrap !important;
}

/* 태블릿 전용 스타일 - layout.css 오버라이드 */
@media (min-width: 769px) and (max-width: 1024px) {
    .footer,
    #common-footer,
    footer,
    footer.footer,
    footer#common-footer {
        margin-bottom: 85px !important;
        padding: 12px 0 !important;
        font-size: 14px !important;
    }

    .footer-content {
        flex-direction: row !important;
        gap: 30px !important;
        padding: 0 20px !important;
    }

    footer .theme-toggle,
    #common-footer .theme-toggle,
    .footer .theme-toggle,
    footer#common-footer .theme-toggle,
    footer.footer .theme-toggle,
    button.theme-toggle,
    button#themeToggle {
        background: #6366f1 !important;
        color: white !important;
        border: none !important;
        padding: 8px 12px !important;
        border-radius: 6px !important;
        cursor: pointer !important;
        font-size: 12px !important;
        margin-left: 40px !important;
        margin-right: 0 !important; /* layout.css에서 설정한 margin-right 제거 */
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        flex-shrink: 0 !important;
        white-space: nowrap !important;
    }
}

@media (max-width: 768px) {
    .footer,
    #common-footer,
    footer,
    footer.footer,
    footer#common-footer {
        margin-bottom: 90px !important;
        padding: 10px 0 !important;
        font-size: 12px !important;
    }

    .footer-content {
        flex-direction: column !important;
        gap: 15px !important; /* 모바일에서도 간격 조정 */
        padding: 0 16px !important;
    }

    footer .theme-toggle,
    #common-footer .theme-toggle,
    .footer .theme-toggle,
    footer#common-footer .theme-toggle,
    footer.footer .theme-toggle,
    button.theme-toggle,
    button#themeToggle {
        background: #6366f1 !important;
        color: white !important;
        border: none !important;
        font-size: 11px !important;
        padding: 6px 10px !important;
        border-radius: 6px !important;
        cursor: pointer !important;
        margin-left: 0 !important; /* 모바일에서는 세로 배치라 좌측 마진 제거 */
        margin-right: 0 !important;
        margin-top: 5px !important; /* 세로 간격 추가 */
        margin-bottom: 0 !important;
        flex-shrink: 0 !important;
        white-space: nowrap !important;
    }
}