/* ========================================
   Sermon Page Styles
   ======================================== */

:root {
    --primary-color: #2c5aa0;
    --primary-dark: #1e4a7a;
    --sidebar-width: 280px;
    --date-panel-width: 300px;
    --gray-bg: #e5e7eb;
    --white: #ffffff;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans KR', sans-serif;
    color: var(--text-dark);
    overflow-x: hidden;
}

/* ========================================
   Main Container
   ======================================== */
.sermon-container {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* ========================================
   Left Sidebar
   ======================================== */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    color: var(--white);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 100;
    box-shadow: var(--shadow-lg);
}

/* Sidebar Header */
.sidebar-header {
    padding: 30px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.church-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.bible-verse {
    font-size: 0.85rem;
    opacity: 0.9;
}

/* Sermon Title Section */
.sermon-title-section {
    padding: 30px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.sermon-title {
    font-size: 1.3rem;
    font-weight: 600;
    text-align: center;
}

/* Service Menu */
.service-menu {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.service-btn {
    width: 100%;
    padding: 18px 20px;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--white);
    font-size: 1rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

.service-btn span {
    flex: 1;
}

.service-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    padding-left: 25px;
}

.service-btn.active {
    background: rgba(255, 255, 255, 0.2);
    border-left: 4px solid var(--white);
    font-weight: 600;
}

/* Back Home Link */
.back-home {
    padding: 20px;
    color: var(--white);
    text-decoration: none;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    transition: background 0.3s ease;
}

.back-home:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ========================================
   Date Selection Panel
   ======================================== */
.date-panel {
    position: fixed;
    right: -320px;
    top: 0;
    width: var(--date-panel-width);
    height: 100vh;
    background: var(--white);
    box-shadow: -2px 0 15px rgba(0,0,0,0.1);
    z-index: 300;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.date-panel.active {
    right: 0;
}

.date-panel-header {
    padding: 25px 20px;
    border-bottom: 2px solid var(--gray-bg);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.date-panel-header h3 {
    font-size: 1.2rem;
    color: var(--text-dark);
}

.close-panel {
    width: 35px;
    height: 35px;
    border: none;
    font-size: 2rem;
    line-height: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-weight: 300;
    color: var(--text-dark);
    position: relative;
}

.close-panel::before {
    content: '×';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -52%);
}

.date-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.date-item {
    padding: 15px 20px;
    margin-bottom: 10px;
    background: var(--white);
    border: 2px solid var(--gray-bg);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.date-item:hover {
    background: #f9fafb;
    border-color: var(--primary-color);
    transform: translateX(-5px);
}

.date-item.active {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.date-item-date {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.date-item-title {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Panel Overlay */
.panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 150;
}

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

/* ========================================
   Main Content Area
   ======================================== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    background: var(--gray-bg);
    padding: 40px;
    overflow-y: auto;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

/* Welcome State */
.welcome-state {
    max-width: 800px;
    text-align: center;
    margin-top: 100px;
}

.welcome-message h2 {
    font-size: 2rem;
    color: var(--text-dark);
    margin-bottom: 20px;
}

.welcome-message p {
    font-size: 1.1rem;
    color: var(--text-light);
    line-height: 1.8;
}

/* Content Paper */
.content-paper {
    width: 100%;
    max-width: 900px;
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 50px 60px;
    min-height: 600px;
    position: relative;
}

.paper-header {
    margin-bottom: 40px;
    border-bottom: 2px solid var(--gray-bg);
    padding-bottom: 20px;
}

.paper-header h2 {
    font-size: 2rem;
    color: var(--text-dark);
    margin-bottom: 15px;
    line-height: 1.4;
}

.content-meta {
    font-size: 0.95rem;
    color: var(--text-light);
}

.paper-body {
    font-size: 1.05rem;
    line-height: 2;
    color: var(--text-dark);
    min-height: 400px;
}

.paper-body p {
    margin-bottom: 20px;
}

.paper-body h3 {
    font-size: 1.3rem;
    margin-top: 30px;
    margin-bottom: 15px;
    color: var(--primary-color);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid var(--gray-bg);
}

.page-btn {
    padding: 12px 24px;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.page-btn:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.page-btn:disabled {
    background: var(--gray-bg);
    color: var(--text-light);
    cursor: not-allowed;
}

.page-info {
    font-size: 1rem;
    color: var(--text-light);
}

/* ========================================
   Mobile Menu Button
   ======================================== */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 200;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 12px;
    box-shadow: var(--shadow-md);
    transition: background 0.3s ease, transform 0.3s ease;
}

.mobile-menu-toggle span {
    width: 24px;
    height: 3px;
    background: var(--white);
    border-radius: 2px;
}

.mobile-menu-toggle:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

/* Mobile Overlay */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

/* Sidebar Close Button */
.sidebar-close {
    display: none;
    position: absolute;
    top: 30px;
    right: 15px;
    width: 40px;
    height: 40px;
    border: none;
    color: var(--white);
    font-size: 2.5rem;
    line-height: 1;
    cursor: pointer;
    z-index: 101;
    transition: all 0.3s ease;
}

.sidebar-close span {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) translateY(-1px);
    font-weight: 300;
    line-height: 1;
}

/* ========================================
   Responsive Design
   ======================================== */
@media screen and (max-width: 768px) {
    /* Show mobile menu button */
    .mobile-menu-toggle {
        display: flex;
    }

    /* Show mobile overlay */
    .mobile-overlay {
        display: block;
    }

    /* Show sidebar close button */
    .sidebar-close {
        display: block;
    }

    .sidebar {
        width: 85%;
        max-width: 320px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 250;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 80px 20px 20px;
    }

    .content-paper {
        padding: 30px 25px;
    }

    .paper-header h2 {
        font-size: 1.5rem;
    }

    .date-panel {
        width: 100%;
        right: -100%;
    }
}

/* Scrollbar Styles */
.service-menu::-webkit-scrollbar,
.date-list::-webkit-scrollbar,
.main-content::-webkit-scrollbar {
    width: 6px;
}

.service-menu::-webkit-scrollbar-track,
.date-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.service-menu::-webkit-scrollbar-thumb,
.date-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.main-content::-webkit-scrollbar-track {
    background: var(--gray-bg);
}

.main-content::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}
/* ========================================
   Auth Section Styles
   ======================================== */
.auth-section {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.auth-btn,
.admin-btn {
    width: 100%;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: var(--white);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
    display: block;
}

.auth-btn:hover,
.admin-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.admin-btn {
    background: rgba(255, 215, 0, 0.3);
    border-color: rgba(255, 215, 0, 0.5);
}

.admin-btn:hover {
    background: rgba(255, 215, 0, 0.4);
}

/* ========================================
   Delete Sermon Button
   ======================================== */
.delete-sermon-btn {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    padding: 6px 12px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}

.delete-sermon-btn:hover {
    background: #dc2626;
    transform: translateY(-50%) scale(1.05);
}

.date-item {
    position: relative;
}

.date-item:has(.delete-sermon-btn) .date-item-title {
    padding-right: 80px;
}
