/* =============================================================================
   디자인교회 설교말씀 - 메인 스타일시트
   ============================================================================= */

/* -----------------------------------------------------------------------------
   1. RESET & VARIABLES
   ----------------------------------------------------------------------------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1a365d;
    --secondary-color: #3498db;
    --bg-color: #f5f6fa;
    --text-color: #2c3e50;
    --menu-width: 280px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
}

/* -----------------------------------------------------------------------------
   2. HEADER
   ----------------------------------------------------------------------------- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    padding: 0 20px;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.hamburger {
    width: 30px;
    height: 24px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hamburger span {
    display: block;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: 0.3s;
}

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

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

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

.header-title {
    color: white;
    margin-left: 20px;
    font-size: 1.2rem;
    font-weight: 500;
    flex: 1;
}

.header-icons {
    display: flex;
    align-items: center;
    gap: 4px;
}
.header-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.2s;
    background: transparent;
    border: none;
    padding: 0;
}
.header-icon:hover {
    background: rgba(255,255,255,0.1);
}
.header-icon svg {
    fill: white;
    width: 22px;
    height: 22px;
}
.header-youtube svg {
    fill: #FF0000;
}
.header-youtube:hover svg {
    fill: #CC0000;
}
.header-favorites {
    position: relative;
}
.favorites-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    background: #e74c3c;
    color: white;
    font-size: 10px;
    font-weight: 600;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* -----------------------------------------------------------------------------
   3. SIDEBAR
   ----------------------------------------------------------------------------- */
.sidebar {
    position: fixed;
    top: 60px;
    left: -100%;
    width: var(--menu-width);
    height: calc(100vh - 60px);
    height: calc(100dvh - 60px); /* 모바일 URL바 고려 */
    background: white;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    transition: left 0.3s ease;
    z-index: 999;
    display: flex;
    flex-direction: column;
}

.sidebar.active {
    left: 0;
}

/* Menu Scroll Area */
.menu-scroll {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

/* Menu Group (타이틀 + 메뉴 아이템) */
.menu-group {
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
}

.menu-group-title {
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Collapsible Menu Group (접히는 섹션) */
.menu-group.collapsible {
    padding: 4px 12px 8px;
}

.menu-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.75rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: background 0.2s;
}

.menu-group-header:hover {
    background: var(--bg-color);
}

.menu-group-arrow {
    font-size: 0.7rem;
    color: #888;
    transition: transform 0.2s ease;
}

.menu-group-arrow.expanded {
    transform: rotate(180deg);
}

.menu-group-items {
    /* 기본 표시 */
}

.menu-group.collapsible .menu-group-items {
    display: none;
    padding-left: 0;
    overflow: hidden;
}

.menu-group.collapsible .menu-group-items.show {
    display: block;
}

/* Menu Footer (하단 고정 단독 메뉴) */
.menu-footer {
    flex-shrink: 0;
    padding: 8px 12px;
    border-top: 1px solid #eee;
}

.menu-footer .menu-item {
    text-decoration: none;
    color: inherit;
}

.menu-item {
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
    margin-bottom: 1px;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.menu-item:hover {
    background: var(--bg-color);
}

.menu-item.active {
    background: var(--secondary-color);
    color: white;
}

.menu-item .count {
    background: #eee;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    color: #666;
    margin-left: auto;
}

.menu-item.active .count {
    background: rgba(255,255,255,0.3);
    color: white;
}

/* Ministry Menu (2-level) */

.ministry-category {
    margin-bottom: 1px;
}

.ministry-header {
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

.ministry-header:hover {
    background: var(--bg-color);
}

.ministry-header.expandable {
    cursor: pointer;
}

.ministry-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.ministry-name {
    flex: 1;
}

.ministry-expand-icon {
    font-size: 0.7rem;
    color: #888;
    transition: transform 0.2s ease;
}

.ministry-expand-icon.expanded {
    transform: rotate(180deg);
}

.ministry-submenu {
    display: none;
    padding-left: 10px;
    background: rgba(0,0,0,0.02);
    border-radius: 0 0 4px 4px;
    overflow: hidden;
}

.ministry-submenu.show {
    display: block;
}

.ministry-page-item {
    display: block;
    padding: 6px 12px 6px 24px;
    font-size: 0.85rem;
    color: #555;
    text-decoration: none;
    border-left: 2px solid transparent;
    transition: all 0.2s;
}

.ministry-page-item:hover {
    background: rgba(0,0,0,0.03);
    border-left-color: var(--primary-color);
    color: var(--primary-color);
}

.ministry-playlist-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.ministry-playlist-item .playlist-count {
    font-size: 0.8rem;
    color: #888;
    margin-left: 8px;
}

.ministry-playlist-item.active {
    background: rgba(0,0,0,0.05);
    border-left-color: var(--primary-color);
    color: var(--primary-color);
    font-weight: 500;
}

/* Ministry video card */
.ministry-video-card.playing {
    background: var(--primary-color);
    color: white;
}

.ministry-video-card.playing .meta {
    color: rgba(255,255,255,0.8);
}

.ministry-video-card.playing .play-btn {
    background: white;
    color: var(--primary-color);
}

.ministry-video-card .pin-btn {
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    font-size: 1rem;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.ministry-video-card .pin-btn:hover,
.ministry-video-card .pin-btn.active {
    opacity: 1;
}

/* (Legacy styles removed - now using .menu-group.collapsible) */

/* -----------------------------------------------------------------------------
   4. SEARCH
   ----------------------------------------------------------------------------- */
.search-container {
    padding: 10px 12px;
    background: #f8f9fa;
}

.search-input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.search-input:focus {
    border-color: var(--secondary-color);
}

/* -----------------------------------------------------------------------------
   5. OVERLAY
   ----------------------------------------------------------------------------- */
.overlay {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
    z-index: 998;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

/* -----------------------------------------------------------------------------
   6. MAIN CONTENT
   ----------------------------------------------------------------------------- */
.main-content {
    margin-top: 60px;
    padding: 20px;
    min-height: calc(100vh - 60px);
}

.content-title {
    font-size: 1.5rem;
    margin-bottom: 20px;
    text-align: center;
    color: var(--primary-color);
}

/* -----------------------------------------------------------------------------
   7. VIDEO CONTAINER
   ----------------------------------------------------------------------------- */
.video-container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto 20px;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
}

.video-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.no-content {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #888;
    font-size: 1.1rem;
}

/* -----------------------------------------------------------------------------
   8. SERMON INFO
   ----------------------------------------------------------------------------- */
.sermon-info {
    max-width: 900px;
    margin: 0 auto 20px;
    padding: 15px 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.sermon-info .title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.sermon-info .meta {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    color: #666;
}

.sermon-info .meta span {
    margin-right: 15px;
}

.sermon-info .meta .meta-icons {
    margin-left: auto;
    display: flex;
    gap: 4px;
}

.sermon-info .meta .pin-icon,
.sermon-info .meta .share-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    transition: opacity 0.2s;
}

.sermon-info .meta .pin-icon {
    font-size: 1.1rem;
    opacity: 0.5;
}

.sermon-info .meta .pin-icon.active {
    opacity: 1;
}

.sermon-info .meta .share-icon {
    color: #999;
}

.sermon-info .meta .share-icon:hover {
    color: var(--primary-color);
}

.sermon-info .meta .share-icon svg {
    width: 20px;
    height: 20px;
    display: block;
}

/* -----------------------------------------------------------------------------
   8.5. PLAYLIST TABS (본문 상단 표시 모드)
   ----------------------------------------------------------------------------- */
.playlist-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
    padding: 12px 15px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.playlist-tab {
    padding: 8px 16px;
    border: none;
    background: #f5f6fa;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #666;
    transition: all 0.2s;
    white-space: nowrap;
}

.playlist-tab:hover {
    background: #e8e9ed;
}

.playlist-tab.active {
    background: var(--primary-color);
    background: #1a365d;
    color: white;
}

.playlist-tab .tab-count {
    font-size: 0.8rem;
    opacity: 0.8;
    margin-left: 4px;
}

/* -----------------------------------------------------------------------------
   8.6. PLAYLIST HEADER (재생목록 정보 헤더)
   ----------------------------------------------------------------------------- */
.playlist-header {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    max-width: 900px;
    margin: 0 auto 15px;
    align-items: center;
}

.playlist-header-thumbnail {
    width: 100px;
    height: 56px;
    object-fit: cover;
    border-radius: 6px;
    background: #f0f0f0;
    flex-shrink: 0;
}

.playlist-header-info {
    flex: 1;
    min-width: 0;
}

.playlist-header-name {
    font-weight: 600;
    font-size: 1rem;
    color: #333;
    margin-bottom: 4px;
}

.playlist-header-description {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.4;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.playlist-header-count {
    font-size: 0.8rem;
    color: #888;
}

@media (max-width: 480px) {
    .playlist-header {
        padding: 12px;
        gap: 12px;
    }
    .playlist-header-thumbnail {
        width: 80px;
        height: 45px;
    }
    .playlist-header-name {
        font-size: 0.95rem;
    }
}

/* -----------------------------------------------------------------------------
   9. SERMON LIST & CARDS
   ----------------------------------------------------------------------------- */
.sermon-list {
    max-width: 900px;
    margin: 0 auto;
}

.sermon-card {
    background: white;
    border-radius: 10px;
    padding: 15px 20px;
    margin-bottom: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sermon-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.sermon-card.active {
    border-left: 4px solid var(--secondary-color);
    background: #f0f7ff;
}

.sermon-card .info {
    flex: 1;
}

.sermon-card .title {
    font-weight: 500;
    margin-bottom: 5px;
}

.sermon-card .meta {
    font-size: 0.85rem;
    color: #888;
}

.sermon-card .play-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--secondary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.sermon-card .actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sermon-card .unpin-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 4px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.sermon-card .unpin-btn:hover {
    opacity: 1;
}

/* -----------------------------------------------------------------------------
   10. ACTION BUTTONS
   ----------------------------------------------------------------------------- */
.action-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    margin-bottom: 10px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.action-btn {
    padding: 10px 20px;
    border: 2px solid var(--primary-color);
    background: white;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.action-btn:hover {
    background: var(--primary-color);
    color: white;
}

.action-btn.youtube-app-btn {
    border-color: #ff0000;
    color: #ff0000;
}

.action-btn.youtube-app-btn:hover {
    background: #ff0000;
    color: white;
}

/* -----------------------------------------------------------------------------
   11. WELCOME SCREEN
   ----------------------------------------------------------------------------- */
.welcome-screen {
    text-align: center;
    padding: 20px 18px;
}

.welcome-screen h2 {
    font-size: 1.7rem;
    margin-bottom: 7px;
    color: var(--primary-color);
}

.welcome-screen p {
    color: #666;
    font-size: 1rem;
    margin-bottom: 20px;
}

.mobile-menu-icon {
    display: none;
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-right: 2px;
}

/* -----------------------------------------------------------------------------
   12. LATEST SERMON (PWA)
   ----------------------------------------------------------------------------- */
.latest-sermon-section {
    display: none;
    max-width: 900px;
    margin: 0 auto 30px;
    text-align: left;
}

.latest-sermon-section.show {
    display: block;
}

.latest-sermon-section h3 {
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-bottom: 15px;
    text-align: center;
}

.latest-sermon-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.latest-sermon-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.latest-sermon-card .thumbnail {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    position: relative;
}

.latest-sermon-card .thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.latest-sermon-card .thumbnail .play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(0,0,0,0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.latest-sermon-card .card-info {
    padding: 15px 20px;
}

.latest-sermon-card .card-info .title {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--text-color);
}

.latest-sermon-card .card-info .meta {
    font-size: 0.85rem;
    color: #888;
}

.latest-sermon-card .card-info .meta .category-badge {
    display: inline-block;
    background: var(--secondary-color);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    margin-right: 8px;
}

.latest-youtube-btn {
    display: block;
    margin: 15px auto 0;
    padding: 12px 30px;
    text-align: center;
}

/* -----------------------------------------------------------------------------
   13. INSTALL GUIDE
   ----------------------------------------------------------------------------- */
.install-guide {
    margin-top: 40px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: left;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    display: none;
}

.install-guide.show {
    display: block;
}

.install-guide h3 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.install-section {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.install-section:last-of-type { margin-bottom: 15px; }
.install-section h4 { color: var(--secondary-color); font-size: 0.85rem; min-width: 80px; text-align: center; line-height: 1.4; margin: 0; }
.install-section ol { margin: 0; padding-left: 20px; color: #555; font-size: 0.85rem; line-height: 1.6; flex: 1; }

/* -----------------------------------------------------------------------------
   14. COPYRIGHT
   ----------------------------------------------------------------------------- */
.copyright {
    margin-top: 30px;
    padding: 15px;
    text-align: center;
    font-size: 0.85rem;
    color: #999;
}

/* -----------------------------------------------------------------------------
   15. PUSH NOTIFICATION SUBSCRIBE
   ----------------------------------------------------------------------------- */
.push-subscribe-section {
    margin-top: 30px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    display: none;
}
.push-subscribe-section.show {
    display: block;
}
.push-subscribe-section h3 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.push-subscribe-section h3 svg {
    width: 22px;
    height: 22px;
    fill: var(--primary-color);
}
.push-subscribe-section p {
    text-align: center;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 15px;
    line-height: 1.5;
}
.push-subscribe-btn {
    display: block;
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
    padding: 12px 20px;
    border: none;
    border-radius: 25px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
}
.push-subscribe-btn.subscribe {
    background: var(--secondary-color);
    color: white;
}
.push-subscribe-btn.subscribe:hover {
    background: #2980b9;
}
.push-subscribe-btn.subscribed {
    background: #27ae60;
    color: white;
}
.push-subscribe-btn.unsubscribe {
    background: #e74c3c;
    color: white;
}
.push-subscribe-btn.unsubscribe:hover {
    background: #c0392b;
}
.push-subscribe-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}
.push-status {
    text-align: center;
    font-size: 0.8rem;
    margin-top: 10px;
    color: #888;
}
.push-status.success {
    color: #27ae60;
}
.push-status.error {
    color: #e74c3c;
}

/* -----------------------------------------------------------------------------
   16. DIRECTIONS COMPACT (FOOTER)
   ----------------------------------------------------------------------------- */
.directions-compact {
    margin-top: 30px;
    padding: 15px 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    display: none;
}
.directions-compact.show {
    display: block;
}
.directions-compact h4 {
    color: var(--primary-color);
    font-size: 0.9rem;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}
.directions-compact h4 svg {
    width: 16px;
    height: 16px;
    fill: var(--primary-color);
}
.directions-compact .address-text {
    font-size: 0.8rem;
    color: #555;
    line-height: 1.5;
    margin-bottom: 4px;
}
.directions-compact .address-detail {
    font-size: 0.8rem;
    color: #555;
    line-height: 1.5;
    margin-bottom: 7px;
}
.directions-compact .map-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--primary-color);
    text-decoration: none;
    padding: 6px 12px;
    background: #f0f4f8;
    border-radius: 15px;
    transition: background 0.2s;
}
.directions-compact .map-link:hover {
    background: #e0e8f0;
}
.directions-compact .map-link svg {
    width: 12px;
    height: 12px;
    fill: currentColor;
}

/* -----------------------------------------------------------------------------
   17. LOADING & EMPTY STATE
   ----------------------------------------------------------------------------- */
.loading {
    padding: 20px;
    text-align: center;
    color: #888;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #888;
}

/* -----------------------------------------------------------------------------
   18. FLOATING CONTACT BUTTONS
   ----------------------------------------------------------------------------- */
.floating-buttons {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 1100;
}

.floating-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
}

.floating-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}

.floating-btn.kakao {
    background: #FFE812;
    color: #3C1E1E;
}

.floating-btn.phone {
    background: var(--primary-color);
    color: white;
}

.floating-btn.contact {
    background: var(--secondary-color);
    color: white;
}

.floating-btn svg {
    width: 28px;
    height: 28px;
}

.floating-btn.phone.unavailable {
    opacity: 0.5;
    cursor: not-allowed;
}

.phone-tooltip {
    position: absolute;
    right: 70px;
    background: #333;
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 0.85rem;
    white-space: nowrap;
    display: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.phone-tooltip::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    border: 8px solid transparent;
    border-left-color: #333;
    border-right: none;
}

.floating-btn.phone.unavailable:hover + .phone-tooltip {
    display: block;
}

/* -----------------------------------------------------------------------------
   19. BANNERS
   ----------------------------------------------------------------------------- */
/* Welcome Top Banner */
.banner-welcome_top {
    padding: 12px 16px;
    text-align: center;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 10px;
    border-radius: 8px;
    word-break: keep-all;
    overflow-wrap: break-word;
}
.banner-welcome_top .banner-content {
    margin-bottom: 4px;
    white-space: pre-wrap;
}
.banner-welcome_top .banner-link {
    display: inline-block;
    font-size: 13px;
    opacity: 0.9;
    text-decoration: none;
    color: inherit;
}
.banner-welcome_top .banner-link:hover {
    text-decoration: underline;
}

/* Floating Banner */
.banner-floating {
    position: fixed;
    bottom: 20px;
    right: 90px;
    max-width: 320px;
    padding: 12px 40px 12px 16px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1050;
    animation: bannerSlideUp 0.3s ease;
    font-size: 14px;
    line-height: 1.5;
    text-align: right;
    word-break: keep-all;
    overflow-wrap: break-word;
}
.banner-floating .banner-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: inherit;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.7;
}
.banner-floating .banner-close:hover {
    opacity: 1;
}
.banner-floating .banner-content {
    white-space: pre-wrap;
}
.banner-floating .banner-link {
    display: inline-block;
    margin-top: 4px;
    font-size: 13px;
    opacity: 0.9;
    text-decoration: none;
    color: inherit;
}
.banner-floating .banner-link:hover {
    text-decoration: underline;
}
@keyframes bannerSlideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.banner img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 4px;
}

/* -----------------------------------------------------------------------------
   20. iOS KAKAOTALK BROWSER POPUP
   ----------------------------------------------------------------------------- */
.kakao-ios-popup {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 20px;
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
    z-index: 9999;
    animation: slideUp 0.3s ease;
}
.kakao-ios-popup.show {
    display: block;
}
@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}
.kakao-ios-popup .popup-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 12px;
}
.kakao-ios-popup .popup-guide {
    font-size: 14px;
    color: #4a5568;
    line-height: 1.6;
    margin-bottom: 16px;
}
.kakao-ios-popup .popup-guide b {
    color: #1a202c;
}
.kakao-ios-popup .popup-btn {
    display: block;
    width: 100%;
    padding: 14px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
}
.kakao-ios-popup .popup-btn:active {
    opacity: 0.9;
}
.kakao-ios-popup .popup-dismiss {
    display: block;
    margin-top: 12px;
    text-align: center;
    font-size: 13px;
    color: #718096;
    cursor: pointer;
}

/* -----------------------------------------------------------------------------
   21. SCROLLBAR
   ----------------------------------------------------------------------------- */
.categories-section::-webkit-scrollbar { width: 6px; }
.categories-section::-webkit-scrollbar-track { background: #f1f1f1; }
.categories-section::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
.categories-section::-webkit-scrollbar-thumb:hover { background: #999; }

/* -----------------------------------------------------------------------------
   22. DESKTOP RESPONSIVE
   ----------------------------------------------------------------------------- */
@media (min-width: 769px) {
    .sidebar { left: 0; width: var(--menu-width); }
    .main-content { margin-left: var(--menu-width); }
    .hamburger { display: none; }
    .overlay { display: none; }
    .header-title { margin-left: 0; }
}

/* -----------------------------------------------------------------------------
   23. MOBILE RESPONSIVE
   ----------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .content-title { font-size: 1.2rem; }
    .action-buttons { flex-direction: column; align-items: center; }
    .action-btn { width: 200px; text-align: center; }
    .mobile-menu-icon { display: inline; }

    .floating-buttons {
        bottom: 15px;
        right: 15px;
    }
    .floating-btn {
        width: 50px;
        height: 50px;
    }
    .floating-btn svg {
        width: 24px;
        height: 24px;
    }

    .banner-floating {
        bottom: 15px;
        right: 80px;
        max-width: calc(100% - 100px);
    }
}

/* -----------------------------------------------------------------------------
   24. YOUTUBE CHANNEL POPUP
   ----------------------------------------------------------------------------- */
.youtube-popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 20px;
}
.youtube-popup-overlay.show {
    display: flex;
}
.youtube-popup {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    animation: popupFadeIn 0.2s ease;
}
@keyframes popupFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
.youtube-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}
.youtube-popup-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}
.youtube-popup-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #888;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}
.youtube-popup-body {
    padding: 20px;
}
.youtube-popup-desc {
    font-size: 0.9rem;
    color: #666;
    margin: 0 0 16px 0;
    line-height: 1.5;
}
.youtube-channel-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.youtube-channel-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: #f8f9fa;
    border-radius: 12px;
    gap: 12px;
}
.youtube-channel-info {
    flex: 1;
    min-width: 0;
}
.youtube-channel-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: #1a202c;
    margin-bottom: 4px;
}
.youtube-channel-desc {
    font-size: 0.8rem;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.youtube-channel-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    background: #FF0000;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    transition: background 0.2s;
}
.youtube-channel-link:hover {
    background: #CC0000;
}
.youtube-channel-link svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}
.youtube-popup-note {
    font-size: 0.8rem;
    color: #888;
    margin: 16px 0 0 0;
    text-align: center;
}
.youtube-popup-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px 16px;
    border-top: 1px solid #eee;
}
.youtube-dismiss-check {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #666;
}
.youtube-dismiss-check input {
    width: 16px;
    height: 16px;
    cursor: pointer;
}
.youtube-popup-close-btn {
    padding: 8px 20px;
    background: #eee;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
}
.youtube-popup-close-btn:hover {
    background: #ddd;
}
.youtube-channel-list .loading {
    text-align: center;
    color: #888;
    padding: 20px;
}
.youtube-channel-list .empty {
    text-align: center;
    color: #888;
    padding: 20px;
    font-size: 0.9rem;
}

/* -----------------------------------------------------------------------------
   25. SERMON CTA (설교 후 교회 방문 유도)
   ----------------------------------------------------------------------------- */
.sermon-cta {
    max-width: 900px;
    margin: 20px auto 0;
    padding: 20px 24px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 12px;
    color: white;
    position: relative;
    animation: sermonCtaFadeIn 0.5s ease;
}

@keyframes sermonCtaFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.sermon-cta-content {
    text-align: center;
}

.sermon-cta-content h4 {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.sermon-cta-content p {
    font-size: 0.9rem;
    opacity: 0.95;
    margin-bottom: 16px;
}

.sermon-cta-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.sermon-cta-btn {
    padding: 10px 24px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}

.sermon-cta-btn.primary {
    background: white;
    color: var(--primary-color);
}

.sermon-cta-btn.primary:hover {
    background: #f0f0f0;
}

.sermon-cta-btn.secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.sermon-cta-btn.secondary:hover {
    background: rgba(255,255,255,0.1);
}

.sermon-cta-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(255,255,255,0.2);
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.sermon-cta-close:hover {
    background: rgba(255,255,255,0.3);
}

@media (max-width: 480px) {
    .sermon-cta {
        margin: 15px 0 0;
        padding: 16px 20px;
    }

    .sermon-cta-buttons {
        flex-direction: column;
        align-items: center;
    }

    .sermon-cta-btn {
        width: 180px;
        text-align: center;
    }
}

/* -----------------------------------------------------------------------------
   26. OFFLINE POPUP
   ----------------------------------------------------------------------------- */
.offline-popup {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    background: #e74c3c;
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 10000;
    display: none;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    max-width: calc(100% - 40px);
}

.offline-popup.show {
    display: flex;
}

.offline-popup svg {
    flex-shrink: 0;
}

.offline-popup-text {
    flex: 1;
}

.offline-popup-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.offline-popup-close:hover {
    background: rgba(255,255,255,0.3);
}

/* -----------------------------------------------------------------------------
   27. OPTIONS MENU
   ----------------------------------------------------------------------------- */
.header-options svg {
    fill: white;
    width: 22px;
    height: 22px;
}

.options-menu {
    display: none;
    position: fixed;
    top: 54px;
    right: 45px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 1001;
    min-width: 180px;
    padding: 8px 0;
}

.options-menu.show {
    display: block;
    animation: optionsSlideDown 0.15s ease;
}

@keyframes optionsSlideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.options-menu-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    font-size: 0.9rem;
    color: #333;
}

.options-menu-desc {
    padding: 4px 16px 12px;
    font-size: 0.75rem;
    color: #888;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #1a365d;
    background-color: var(--primary-color);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}
