/* common.css - 공통 스타일 */

/* =========================================
   기기 간 텍스트 크기 자동 조정 방지
   iOS/Android 브라우저가 좁은 화면에서
   글자 크기를 자체 보정하는 것을 막아
   S21(360px)·아이폰13(390px) 등 기기 간
   동일한 렌더링을 보장함
   ========================================= */
html {
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* =========================================
   기본 변수 설정 */
:root {
    --primary-color: #3b5998;
    --secondary-color: #8b9dc3;
    --accent-color: #dfe3ee;
    --light-color: #f7f7f7;
    --dark-color: #333333;
    --success-color: #4CAF50;
    --info-color: #2196F3;
    --warning-color: #FF9800;
    --danger-color: #F44336;
}

/* 다크 테마 변수 설정 */
[data-theme="dark"] {
    --primary-color: #4267B2;
    --secondary-color: #9EACCE;
    --accent-color: #38405a;
    --light-color: #2c3440;
    --dark-color: #f5f5f5;
    --success-color: #5CBA5F;
    --info-color: #42A5F5;
    --warning-color: #FFA726;
    --danger-color: #EF5350;
    
    background-color: #1a1a1a;
    color: #f5f5f5;
}

/* 기본 스타일 */
body {
    font-family: 'Noto Sans KR', sans-serif;
    color: var(--dark-color);
    background-color: #fff;
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

[data-theme="dark"] body {
    background-color: #1a1a1a;
    color: #f5f5f5;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
}

.section-title {
    position: relative;
    margin-bottom: 2.5rem;
    font-weight: 700;
}

.section-title:after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 70%;
    height: 3px;
    background-color: var(--primary-color);
}

section {
    padding: 5rem 0;
}

.btn {
    border-radius: 30px;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #2d4373;
    border-color: #2d4373;
}

.btn-outline-primary {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: white;
}

.shadow-custom {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* GNB (Global Navigation Bar) 스타일 */
.navbar {
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 1rem 0;
    transition: all 0.3s ease;
}

[data-theme="dark"] .navbar {
    background-color: #222;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.navbar-scrolled {
    padding: 0.5rem 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.2rem;
}

.navbar-nav .nav-link {
    color: var(--dark-color);
    font-weight: 500;
    padding: 0.5rem 1rem;
    position: relative;
    transition: all 0.3s ease;
}

[data-theme="dark"] .navbar-nav .nav-link {
    color: #f5f5f5;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: var(--primary-color);
}

.navbar-nav .nav-link:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.navbar-nav .nav-link:hover:after,
.navbar-nav .nav-link.active:after {
    width: 98%;
}

/* FOOTER 스타일 */
footer {
    background-color: var(--dark-color);
    color: white;
    padding: 3rem 0 2rem;
}

[data-theme="dark"] footer {
    background-color: #222;
    border-top: 1px solid #333;
}

footer h5 {
    color: white;
    margin-bottom: 1.5rem;
    font-weight: 600;
    position: relative;
    padding-bottom: 0.5rem;
}

footer h5:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background-color: var(--primary-color);
}

footer a {
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
}

footer a:hover {
    color: white;
    text-decoration: none;
}

footer .social-icons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    margin-right: 10px;
    transition: all 0.3s ease;
}

footer .social-icons a:hover {
    background-color: var(--primary-color);
}

footer .copyright {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

/* 모달 공통 스타일 */
.modal-content {
    border: none;
    border-radius: 10px;
    overflow: hidden;
}

[data-theme="dark"] .modal-content {
    background-color: #2c3440;
    color: #f5f5f5;
}

.modal-header {
    background-color: var(--primary-color);
    color: white;
    border-bottom: none;
    padding: 1.5rem;
}

.modal-footer {
    border-top: none;
    padding: 1.5rem;
}

[data-theme="dark"] .modal-footer {
    background-color: #2c3440;
}

/* 토스트 알림 스타일 */
.toast-container {
    z-index: 1070;
}

.toast {
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* 쿠키 동의 배너 스타일 */
.cookie-consent-banner {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 1140px;
    background-color: rgba(52, 58, 64, 0.95);
    color: #fff;
    padding: 1rem 1.5rem;
    z-index: 1060;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, 20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.cookie-consent-banner .cookie-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.cookie-text {
    flex: 1;
    padding-right: 1rem;
}

.cookie-text p {
    margin-bottom: 0;
    font-size: 0.95rem;
}

.cookie-text a {
    color: #90CAF9;
    text-decoration: underline;
    font-weight: 500;
    transition: color 0.2s ease;
}

.cookie-text a:hover {
    color: #BBDEFB;
}

.cookie-buttons {
    display: flex;
    gap: 0.5rem;
}

#cookie-accept {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

#cookie-accept:hover {
    background-color: #4267B2;
    border-color: #4267B2;
}

#cookie-decline {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.5);
}

#cookie-decline:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* 테마 토글 버튼 */
.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-left: 1rem;
    background-color: transparent;
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: var(--dark-color);
    transition: all 0.3s ease;
}

[data-theme="dark"] .theme-toggle {
    color: #f5f5f5;
    border-color: rgba(255, 255, 255, 0.2);
}

.theme-toggle:hover {
    background-color: rgba(0, 0, 0, 0.05);
    transform: scale(1.05);
}

[data-theme="dark"] .theme-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* 비밀번호 강도 미터 */
.password-strength-meter {
    margin-top: 0.5rem;
}

.password-strength-meter .progress {
    height: 5px;
    border-radius: 3px;
}

.strength-text {
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

/* 애니메이션 클래스 */
.fade-in {
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.fade-in-active {
    opacity: 1;
}

.animate-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

/* 반응형 디자인 */
@media (max-width: 991.98px) {
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .navbar-nav .nav-link {
        padding: 0.5rem 0.75rem;
    }
    
    .cookie-consent-banner .container {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .cookie-text {
        margin-bottom: 1rem;
        padding-right: 0;
    }
}

@media (max-width: 767.98px) {
    .navbar-brand {
        font-size: 1rem;
    }
    
    footer {
        padding: 2rem 0 1rem;
    }
    
    .section-title {
        margin-bottom: 2rem;
    }
    
    .section-title:after {
        width: 98%;
    }
    
    .cookie-buttons {
        width: 100%;
        justify-content: flex-end;
    }

    .alert {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative !important;
        z-index: 9999 !important;
        margin: 10px !important;
        padding: 15px !important;
    }
}

@media (max-width: 575.98px) {
    .btn {
        padding: 0.6rem 1.25rem;
    }

    /* 카드 푸터 버튼: 모바일에서 한 줄 배치 보장 */
    .card-footer .btn {
        padding: 0.4rem 0.85rem;
        font-size: 0.9rem;
        white-space: nowrap;
    }
    
    .cookie-text p {
        font-size: 0.85rem;
    }
    
    .cookie-buttons {
        justify-content: center;
        margin-top: 0.5rem;
    }
    
    .navbar-brand img {
        max-height: 30px;
    }
}

/* =========================================
   기본 레이아웃 (header.php 공통 스타일)
   ========================================= */
body {
    font-family: 'Noto Sans KR', sans-serif;
    line-height: 1.6;
}

.navbar-brand {
    font-weight: 700;
}

.main-content {
    min-height: calc(100vh - 200px);
}

.btn-kakao {
    background-color: #fee500;
    color: #000;
    border: none;
}

.btn-kakao:hover {
    background-color: #e6ce00;
    color: #000;
}

.modal-backdrop.show {
    opacity: 0.5;
}

.navbar {
    position: relative;
    z-index: 1030;
}

.dropdown-menu.show {
    z-index: 1050;
}

/* =========================================
   모바일 반응형 테이블/공통 요소
   576px 미만(모든 스마트폰)에서 적용
   ========================================= */
@media (max-width: 575.98px) {
    /* 테이블 헤더: 고정 크기 해제, 줄바꿈 허용 */
    .table th {
        font-size: 12px !important;
        white-space: normal !important;
        word-break: keep-all;
    }

    /* 테이블 셀 패딩 축소 */
    .table th,
    .table td {
        padding: 0.4rem 0.3rem;
        font-size: 0.8125rem; /* 13px */
    }

    /* 뱃지 크기 축소 */
    .badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }

    /* nowrap 인라인 스타일 모바일 해제 */
    .mobile-wrap {
        white-space: normal !important;
        word-break: keep-all;
    }
}

/* 360px 이하(구형·소형 기기) 추가 대응 */
@media (max-width: 360px) {
    .table th,
    .table td {
        padding: 0.3rem 0.2rem;
        font-size: 0.75rem; /* 12px */
    }
}