/**
 * 우리마음상담센터 - 컴포넌트 스타일
 * 재사용 가능한 UI 컴포넌트
 */

/* ========================================
   스크롤 투 탑 버튼
   ======================================== */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: #3498DB;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
    transition: all 0.3s ease;
    z-index: 1000;
}

.scroll-to-top:hover {
    background: #27AE60;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.4);
}

/* ========================================
   모바일 메뉴
   ======================================== */
.mobile-menu {
    display: none;
    position: fixed;
    top: 130px; /* 헤더 바로 아래부터 시작 */
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1005;
    visibility: visible !important;
}

.mobile-menu.active {
    display: block;
}

.mobile-menu-container {
    background: white;
    width: 100%;
    height: calc(100vh - 130px);
    padding: 1rem;
    overflow-y: auto;
    border-top: 1px solid #eee;
    margin-top: 0;
    visibility: visible !important;
}

.mobile-menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-menu-list li {
    border-bottom: 1px solid #eee;
}

.mobile-menu-list li:last-child {
    border-bottom: none;
}

.mobile-menu-list a {
    color: #333;
    text-decoration: none;
    font-size: 1.1rem;
    display: block;
    padding: 1rem;
    transition: all 0.3s ease;
    font-weight: 500;
}

.mobile-menu-list a:hover {
    color: #27AE60;
    background: rgba(39, 174, 96, 0.1);
}

/* 햄버거 버튼 */
.hamburger-btn {
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    width: 40px;
    height: 40px;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    z-index: 1006;
}

.hamburger-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.05);
}

.hamburger-btn span {
    width: 20px;
    height: 2px;
    background: #27AE60;
    transition: all 0.3s ease;
    transform-origin: center;
}

.hamburger-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(0px, 6px);
}

.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(0px, -6px);
}

/* ========================================
   로딩 스피너
   ======================================== */
.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498DB;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ========================================
   반응형 컴포넌트
   ======================================== */
@media (max-width: 768px) {
    .scroll-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }
    
    .mobile-menu {
        top: 130px; /* 모바일 헤더 높이에 맞춤 */
    }
    
    .mobile-menu-container {
        height: calc(100vh - 130px);
    }
}

/* 모바일 줄바꿈 처리 */
.mobile-break {
    display: none;
}

@media (max-width: 768px) {
    .mobile-break br {
        display: none;
    }
}
