/* ==========================================================================
   Layout - App Shell, Top Bar, Content Areas
   ========================================================================== */

/* Main layout */
.app {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Top bar */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 20px;
    background: #16213e;
    border-bottom: 1px solid #0f3460;
    flex-shrink: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Focus mode - hide top bar */
.app.focus-mode .top-bar {
    transform: translateY(-100%);
    opacity: 0;
    position: absolute;
    width: 100%;
    pointer-events: none;
}

.app.focus-mode .content {
    height: 100%;
}

/* Focus mode toggle button (floating) */
.focus-toggle {
    position: fixed;
    top: 8px;
    right: 8px;
    z-index: 50;
    background: rgba(15, 52, 96, 0.9);
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.2s, opacity 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.focus-toggle:hover, .focus-toggle:active {
    background: rgba(26, 74, 122, 0.95);
}

.app.focus-mode .focus-toggle {
    opacity: 0.3;
}

.app.focus-mode .focus-toggle:hover {
    opacity: 1;
}

.focus-toggle.hidden {
    display: none;
}

.book-title {
    font-size: 18px;
    font-weight: 500;
    color: #e94560;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 50%;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.library-btn {
    background: #0f3460;
    color: white;
    border: none;
    padding: 12px 18px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    min-height: 44px;
    transition: background 0.2s;
}

.library-btn:hover, .library-btn:active {
    background: #1a4a7a;
}

.gallery-btn {
    background: #0f3460;
    color: white;
    border: none;
    padding: 12px 18px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    min-height: 44px;
    transition: background 0.2s;
}

.gallery-btn:hover, .gallery-btn:active {
    background: #1a4a7a;
}

.highlights-btn {
    background: #0f3460;
    color: white;
    border: none;
    padding: 12px 18px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    min-height: 44px;
    transition: background 0.2s;
}

.highlights-btn:hover, .highlights-btn:active {
    background: #1a4a7a;
}

/* Main content area */
.content {
    display: flex;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

/* View containers (SPA router) */
.views {
    display: flex;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

.view {
    display: flex;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

/* Image pane (right) */
.image-pane {
    flex: 0 0 45%;
    display: flex;
    flex-direction: column;
    background: #0f0f1a;
    padding: 12px;
    overflow: hidden;
    position: relative;  /* For absolute positioning of inline style selection */
    min-height: 0;
    min-width: 0;
}

/* Image display area */
.image-display {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 0;
}

.image-container {
    max-width: 100%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.image-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #666;
    text-align: center;
    padding: 32px;
}

.image-placeholder svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.image-placeholder p {
    font-size: 14px;
}

.image-placeholder .placeholder-subtext {
    font-size: 12px;
    color: #555;
    margin-top: 8px;
}

/* Image info bar */
.image-info {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(22, 33, 62, 0.8);
    border-radius: 6px;
    margin-top: 10px;
    font-size: 12px;
    color: #888;
    flex-shrink: 0;
}

.image-source {
    color: #e94560;
}

/* Carousel controls */
.carousel-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.carousel-btn {
    background: #0f3460;
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.carousel-btn:hover {
    background: #1a4a7a;
}

.carousel-btn:disabled {
    background: #333;
    color: #666;
}

.carousel-index {
    color: #aaa;
    font-size: 12px;
    min-width: 40px;
    text-align: center;
}

/* Welcome message */
.welcome {
    text-align: center;
    padding: 60px 40px;
    max-width: 600px;
    margin: 0 auto;
}

.welcome h1 {
    font-size: 28px;
    color: #e94560;
    margin-bottom: 16px;
}

.welcome p {
    font-size: 16px;
    color: #888;
    line-height: 1.6;
}
