/* Pastor's Study Bible - Layout Structure */

/* HEADER STYLES */
.header {
    background: linear-gradient(135deg, var(--secondary-color), var(--secondary-light));
    color: white;
    padding: var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-small);
    height: 60px;
}

.header h1 {
    font-size: var(--font-size-xl);
    margin: 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.user-info {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
}

#userDisplay {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-info-mobile {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.user-name {
    color: var(--text-light);
    font-size: 0.9rem;
}

.user-name-short {
    font-size: 0.8rem;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 1;
}

/* Mobile responsive for user name */
@media (max-width: 768px) {
    .user-name-short {
        max-width: 120px;
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .user-name-short {
        max-width: 80px;
        font-size: 0.7rem;
    }
}

/* DESKTOP NAVIGATION BAR (Above Panels) */
.desktop-navigation-bar {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-medium);
    padding: var(--spacing-sm) var(--spacing-md);
    box-shadow: var(--shadow-small);
}

/* MAIN LAYOUT - DESKTOP */
.main-container {
    display: flex;
    flex: 1;
    min-height: 0;
    gap: 0;
    padding: var(--spacing-md);
    position: relative;
}

.bible-panel {
    width: 50%;
    background: var(--bg-white);
    border-radius: var(--border-radius-large);
    box-shadow: var(--shadow-medium);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.notes-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Resize Handle - Desktop Only */
.resize-handle {
    width: var(--spacing-md);
    cursor: col-resize;
    background: transparent;
    position: relative;
    flex-shrink: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.resize-handle::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 3px;
    height: 60px;
    background: var(--border-color);
    border-radius: 2px;
    transition: all 0.2s ease;
}

.resize-handle:hover::before,
.resize-handle.resizing::before {
    background: var(--primary-color);
    height: 80px;
    width: 4px;
}

/* Vertical Resize Handle - Between Note Panels */
.vertical-resize-handle {
    height: var(--spacing-md);
    cursor: row-resize;
    background: transparent;
    position: relative;
    flex-shrink: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vertical-resize-handle::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    height: 3px;
    width: 60px;
    background: var(--border-color);
    border-radius: 2px;
    transition: all 0.2s ease;
}

.vertical-resize-handle:hover::before,
.vertical-resize-handle.resizing::before {
    background: var(--primary-color);
    width: 80px;
    height: 4px;
}

/* Desktop Notes Layout */
.desktop-notes {
    display: flex;
    flex-direction: column;
    gap: 0;
    height: 100%;
}

/* Mobile Notes Layout (hidden by default) */
.mobile-notes {
    display: none;
    flex-direction: column;
    height: 100%;
    background: var(--bg-white);
    border-radius: var(--border-radius-large);
    box-shadow: var(--shadow-medium);
    overflow: hidden;
}

/* Mobile-only elements - hidden on desktop */
.mobile-notes-toggle,
.mobile-resize-handle {
    display: none;
}

/* PANEL STYLES */
.notes-panel {
    background: var(--bg-white);
    border-radius: var(--border-radius-large);
    box-shadow: var(--shadow-medium);
    display: flex;
    flex-direction: column;
    min-height: 0; /* Important for flex children */
    overflow: hidden;
}

/* Default heights for note panels */
.desktop-notes #pastorNotesPanel:not(.collapsed):not([style*="height"]) {
    flex: 0 0 auto;
    height: 50%;
}

.desktop-notes #pastorNotesPanel:not(.collapsed)[style*="height"] {
    flex: 0 0 auto;
}

.desktop-notes #personalNotesPanel:not(.collapsed) {
    flex: 1 1 auto;
    min-height: 0;
}

.notes-panel.collapsed {
    flex: 0 0 50px !important;
    height: 50px !important;
    min-height: 50px;
    max-height: 50px;
}

.notes-panel.collapsed .notes-content {
    display: none !important;
}

.panel-header {
    background: var(--bg-light);
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-medium);
    border-radius: var(--border-radius-large) var(--border-radius-large) 0 0;
    font-weight: bold;
    flex-shrink: 0;
}

.notes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

/* NAVIGATION */
.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-sm);
    flex-wrap: nowrap;
    min-height: 40px;
}

.current-passage-nav {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
}

.breadcrumb-nav {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.85rem;
    overflow: hidden;
    white-space: nowrap;
}

.breadcrumb-item {
    background: none;
    border: none;
    padding: 0.2rem 0.4rem;
    border-radius: var(--border-radius);
    color: var(--primary-color);
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition-fast);
}

.breadcrumb-item:hover {
    background: var(--bg-light);
}

.breadcrumb-current {
    color: #495057;
    font-weight: 500;
    background: var(--bg-secondary);
}

.breadcrumb-separator {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.quick-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    position: relative;
    flex-shrink: 0;
    flex-wrap: nowrap;
}

/* Book overview styles */
.book-overview {
    padding: var(--spacing-xl);
    text-align: center;
    color: var(--text-secondary);
}

.book-overview h2 {
    color: var(--primary-color);
    margin-bottom: var(--spacing-md);
}

/* BREADCRUMB NAVIGATION */
.breadcrumb-container {
    margin: var(--spacing-sm) 0;
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--bg-secondary);
}

/* Clean Single Row Navigation */
.current-passage-nav .breadcrumb-nav {
    display: flex !important;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.current-passage-nav .breadcrumb-item {
    color: var(--primary-color);
    text-decoration: none;
    cursor: pointer;
    padding: 0.2rem var(--spacing-sm);
    border-radius: var(--border-radius);
    transition: var(--transition-fast);
    font-weight: 500;
    white-space: nowrap;
    font-size: 0.95rem;
}

.current-passage-nav .breadcrumb-item:hover {
    background: rgba(52, 152, 219, 0.1);
    text-decoration: none;
}

.current-passage-nav .breadcrumb-current {
    color: var(--text-primary);
    font-weight: 600;
    cursor: default;
    background: var(--bg-secondary);
}

.current-passage-nav .breadcrumb-separator {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin: 0 0.1rem;
}