@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;700&display=swap');

html, body {
    height: 100%;
    margin: 0;
    font-family: 'Noto Sans KR', sans-serif;
    background-color: #f0f2f5;
    color: #333;
    overflow: hidden;
}

.main-container {
    display: flex;
    width: 100%;
    height: 100%;
    transition: margin-left 0.3s ease;
}

/* --- Sidebar --- */
.sidebar {
    width: 280px;
    background-color: #fff;
    border-right: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: width 0.3s ease;
}

.sidebar.collapsed {
    width: 0;
    overflow: hidden;
    border-right: none;
}

.sidebar.collapsed .sidebar-header,
.sidebar.collapsed #podcast-list {
    display: none;
}


.sidebar-header {
    display: flex;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.sidebar-header h2 {
    margin: 0;
    color: #4a90e2;
    font-size: 1.2em;
}

#sidebar-toggle-btn {
    background: none;
    border: 1px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    color: #666;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

#sidebar-toggle-btn:hover {
    background-color: #f0f2f5;
    color: #4a90e2;
}

.sidebar.collapsed + .content-area #sidebar-toggle-btn {
    transform: rotate(180deg);
}


#podcast-list {
    list-style-type: none;
    padding: 10px;
    margin: 0;
    overflow-y: auto;
    flex-grow: 1;
}

#podcast-list li {
    padding: 12px 15px;
    margin-bottom: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
    border: 1px solid #eee;
    font-size: 0.95em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#podcast-list li:hover {
    background-color: #f0f8ff;
}

#podcast-list li.active {
    background-color: #4a90e2;
    color: white;
    font-weight: bold;
    border-color: #4a90e2;
}

/* --- Content Area --- */
.content-area {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    background-color: #fff;
    border-bottom: 1px solid #ddd;
    flex-shrink: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
    /* To make sure it doesn't grow and push controls away */
    flex-shrink: 0;
    min-width: 0; /* Prevents text from pushing the container */
}
.header-left h1 {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.main-header h1 {
    margin: 0;
    font-size: 1.5em;
}

.main-header p {
    margin: 4px 0 0;
    font-size: 0.9em;
    color: #666;
}

.controls {
    display: flex;
    align-items: center;
    gap: 20px;
    min-width: 250px;
}

#play-pause-btn {
    padding: 10px 25px;
    font-size: 1em;
    border: none;
    background-color: #4a90e2;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#play-pause-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

#play-pause-btn.playing {
    background-color: #d9534f;
}

.progress-container {
    background-color: #e0e0e0;
    border-radius: 5px;
    height: 10px;
    flex-grow: 1;
}

.progress-bar {
    background-color: #4a90e2;
    height: 100%;
    width: 0;
    border-radius: 5px;
    transition: width 0.1s linear;
}

/* --- Content Panels --- */
.content-panels {
    display: flex;
    flex-grow: 1;
    overflow: hidden;
    gap: 10px;
    padding: 10px;
}

.panel {
    flex: 1 1 33.33%;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: flex-basis 0.3s ease;
}

.panel.collapsed {
    flex-grow: 0;
    flex-basis: 60px !important;
}

.panel.collapsed .panel-content {
    display: none;
}

.panel.collapsed .panel-header h3 {
    opacity: 0;
}

#script-panel { flex-basis: 34%; }
#source-panel { flex-basis: 33%; }
#pdf-panel { flex-basis: 33%; }

.panel-header {
    padding: 10px 15px;
    background-color: #f9f9f9;
    border-bottom: 1px solid #ddd;
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h3 {
    margin: 0;
    font-size: 1.1em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity 0.3s ease;
}

.panel-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1em;
    color: #999;
    padding: 5px;
}
.panel-toggle-btn:hover {
    color: #4a90e2;
}


.panel-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 15px;
}

#pdf-content {
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

#pdf-content embed {
    width: 100%;
    height: 100%;
}
#pdf-content .pdf-placeholder {
    color: #888;
}


/* --- Script/Dialogue Styles --- */
.dialogue {
    margin-bottom: 15px;
    transition: background-color 0.3s ease;
    padding: 10px;
    border-radius: 8px;
}

.dialogue.playing {
    background-color: #e7f3ff;
}

.speaker {
    font-weight: 700;
    margin-bottom: 5px;
    font-size: 0.9em;
    color: #4a90e2;
}

.text {
    line-height: 1.6;
}

/* --- Source Markdown Styles --- */
#source-content {
    line-height: 1.7;
    font-size: 0.95em;
}

#source-content h1, #source-content h2, #source-content h3 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}
#source-content p { margin-bottom: 1em; }
#source-content ul, #source-content ol { padding-left: 20px; }
#source-content code {
    background-color: #eee;
    padding: 2px 5px;
    border-radius: 4px;
}
#source-content pre {
    background-color: #f8f8f8;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
} 