:root {
    --bg-color: #000000;
    --card-bg: rgba(30, 30, 30, 0.7);
    --header-bg: #121212;
    --accent: #FFD700;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
}

body.light-mode {
    --bg-color: #f5f6fa;
    --card-bg: rgba(255, 255, 255, 0.9);
    --header-bg: #ffffff;
    --accent: #d32f2f;
    --text-primary: #212121;
    --text-secondary: #555555;
    --glass-bg: rgba(0, 0, 0, 0.05);
    --glass-border: rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    overflow-x: hidden;
    height: 100vh;
}

#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Header & Tabs */
header {
    background-color: var(--header-bg);
    color: var(--text-primary);
    padding-top: env(safe-area-inset-top);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.top-nav {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 10px 16px;
    height: 60px;
}

.logo-container {
    height: 32px;
    margin-right: 12px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.app-logo {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.top-nav .title {
    font-size: 1.1rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.top-icons {
    display: flex;
    flex-shrink: 0;
}

/* Modal Styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal {
    background: #1e1e1e;
    width: 90%;
    max-width: 400px;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-btn {
    width: 100%;
    padding: 12px;
    background: #333;
    border: none;
    color: white;
    border-radius: 10px;
    margin-bottom: 10px;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.modal-btn i {
    color: #f1c40f;
}

.add-new-list {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.add-new-list input {
    flex: 1;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 10px;
    border-radius: 8px;
}

/* Slideshow / PPT Styling */
#slideshow-view {
    background-color: #000;
    transition: none; /* Instant transition for PPT */
    display: flex;
    flex-direction: column;
}

#slideshow-view[data-bg-type="image"] {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.slideshow-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 16px;
    padding-top: env(safe-area-inset-top, 16px);
    z-index: 5010;
    background: linear-gradient(rgba(0,0,0,0.6), transparent);
}

.slideshow-container {
    flex: 1;
    display: flex;
    align-items: center;
    overflow-x: auto;
    /* Enable horizontal scrolling */
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    /* PPT-like snapping */
    -webkit-overflow-scrolling: touch;
    height: 100vh;
    width: 100vw;
}

.slideshow-container::-webkit-scrollbar {
    display: none;
}

@font-face {
    font-family: 'TAUMB';
    src: url('https://tamilstudybible.in/TCSB/data/fonts/TAUMB.ttf') format('truetype'),
         url('https://tamilstudybible.in/TCSB/data/TAUMB.ttf') format('truetype');
}

.slide {
    flex: 0 0 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center; /* Center by default */
    padding: 2rem;
    padding-top: env(safe-area-inset-top, 2rem);
    padding-bottom: env(safe-area-inset-bottom, 2rem);
    padding-left: env(safe-area-inset-left, 3rem);
    padding-right: env(safe-area-inset-right, 3rem);
    text-align: center;
    font-family: 'TAUMB', 'Outfit', sans-serif;
    line-height: 1.4;
    color: #ffffff;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.8);
    word-break: break-word;
    scroll-snap-align: start;
    box-sizing: border-box;
    overflow: hidden; /* No scrollbars for slides */
}

.slide-content-box {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Smart centering: removed as we now use flexbox justify-center */

/* Hide inactive slides logic removed because we use scrolling now */
.slide.active {
    display: flex;
}

#slideshow-view.overlay {
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    z-index: 5000;
    /* Ensure it is on top */
}

#slideshow-view.overlay::before {
    display: none;
    /* Hide the dark overlay for PPT to show the gradient clearly */
}

@media (max-width: 480px) {
    .slide {
        font-size: 1.5rem;
        padding: 20px;
    }
}

.slideshow-status {
    font-weight: 500;
    font-size: 1.2rem;
}

/* Stanza Shortcut Menu */
.stanza-menu-wrapper {
    position: absolute;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    z-index: 5010;
}

.stanza-menu-fab {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--accent);
    color: #000;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
    cursor: pointer;
    margin-top: 12px;
    transition: transform 0.2s;
}

.stanza-menu-fab:active {
    transform: scale(0.9);
}

.stanza-shortcut-list {
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 60vh;
    overflow-y: auto;
    backdrop-filter: blur(10px);
    transform-origin: bottom right;
    transition: all 0.3s ease;
}

.stanza-shortcut-list.hidden {
    display: none !important;
}

/* PPT Settings Modal */
.settings-group {
    margin-bottom: 20px;
    text-align: left;
}

.settings-group label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.settings-group select, .settings-group input[type="color"] {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 10px;
    color: white;
    outline: none;
}

.settings-group select option {
    color: #000000;
    background-color: #ffffff;
}

.settings-group input[type="color"] {
    height: 45px;
    padding: 5px;
}

.settings-help {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 4px;
    font-style: italic;
}

#slideshow-view.hidden {
    display: none !important;
}

/* Home PPT Settings Button */
.ppt-settings-btn {
    margin-top: 15px;
    width: 100%;
    background: linear-gradient(135deg, #FFD700, #DAA520);
    color: #000;
    font-weight: 700;
    border: none;
    padding: 12px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.ppt-settings-btn:active {
    transform: scale(0.98);
}

.stanza-shortcut-item {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    white-space: nowrap;
    transition: background-color 0.2s;
}

.stanza-shortcut-item:hover, .stanza-shortcut-item:active {
    background: var(--accent);
    color: #000;
}



.icon-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.2rem;
    padding: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}

.icon-btn:active {
    transform: scale(0.9);
}

.tabs {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 0 8px;
}

.tabs::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 12px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    position: relative;
    cursor: pointer;
}

.tab-btn.active {
    color: var(--accent);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20%;
    right: 20%;
    height: 3px;
    background-color: var(--accent);
    border-radius: 3px 3px 0 0;
}

/* Main Content */
main {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    padding-bottom: 80px;
}

/* Home / Index */

.alphabet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 12px;
    margin-top: 12px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 480px) {
    .alphabet-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 8px;
    }
}

.alphabet-btn {
    background-color: #ffffff;
    color: #000000;
    border: none;
    border-radius: 12px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
    margin: 0 auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

@media (max-width: 480px) {
    .alphabet-btn {
        width: 55px;
        height: 55px;
        font-size: 1.2rem;
    }
}

.alphabet-btn:active {
    transform: scale(0.9);
    background-color: #eee;
}

.shortcuts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 24px;
}

.shortcut-item {
    background: var(--card-bg);
    padding: 20px 10px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--glass-border);
}

.shortcut-item i {
    font-size: 1.5rem;
}

.color-red {
    color: #ff5252;
}

.color-blue {
    color: #448aff;
}

.color-green {
    color: #4caf50;
}

/* Cards (Artists/Albums) */
.list-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.card {
    background: var(--card-bg);
    border-radius: 16px;
    display: flex;
    overflow: hidden;
    height: 100px;
    border: 1px solid var(--glass-border);
    transition: transform 0.2s;
}

.card:active {
    transform: scale(0.98);
}

.card-img,
.card-icon {
    width: 100px;
    height: 100px;
    background-color: #333;
    object-fit: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    /* Larger icon */
    color: #FFD700;
    background: linear-gradient(135deg, #2a2a2a, #1a1a1a);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.4);
    border-right: 1px solid var(--glass-border);
}

.card-icon i {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.card-info {
    flex: 1;
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Song List Items */
.song-list-item {
    display: flex;
    align-items: center;
    padding: 16px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.song-num {
    width: 30px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.song-info {
    flex: 1;
    margin-right: 12px;
}

.song-title {
    font-size: 1.05rem;
    font-weight: 500;
}

.song-actions {
    display: flex;
    gap: 8px;
}

/* Lyrics Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-color);
    background-size: cover;
    background-position: center;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.overlay::before {
    display: none;
}

.overlay.hidden {
    transform: translateY(100%);
}

.lyrics-header {
    position: relative;
    display: flex;
    align-items: center;
    padding: 16px;
    padding-top: env(safe-area-inset-top, 16px);
}

.lyrics-title {
    flex: 1;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 12px;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lyrics-top-icons {
    display: flex;
    gap: 4px;
}

.lyrics-meta {
    position: relative;
    text-align: left;
    padding-left: 56px;
    /* Align with title */
    margin-bottom: 24px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.lyrics-body {
    position: relative;
    flex: 1;
    overflow-y: auto;
    padding: 0 24px;
    font-size: 1.2rem;
    white-space: pre-wrap;
    line-height: 1.8;
    line-height: 1.8;
    white-space: pre-wrap;
    text-align: left;
    padding-bottom: 100px;
}

@media (max-width: 480px) {
    .lyrics-body {
        font-size: 1.1rem;
        padding: 0 16px 100px 16px;
    }

    .lyrics-title {
        font-size: 1.1rem;
    }
}

.fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: #ff5252;
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(255, 82, 82, 0.4);
    z-index: 1001;
    cursor: pointer;
}

/* Loader */
#loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Search Styling */
.search-container, .list-search-container {
    margin-bottom: 20px;
    position: sticky;
    top: -16px; /* Offset parent padding */
    z-index: 50;
    background-color: var(--bg-color);
    padding: 10px 0;
    margin: -16px -0px 16px -0px; /* Counter main padding */
    padding: 16px 16px 10px 16px;
}

.search-bar, .list-search-bar {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    backdrop-filter: blur(10px);
}

.search-bar input, .list-search-input {
    background: none;
    border: none;
    color: var(--text-primary);
    width: 100%;
    font-size: 1rem;
    outline: none;
    font-family: inherit;
}

/* Extras Section (Contact & Other Apps) */
.extras-section {
    margin-top: 24px;
    padding: 20px;
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px solid var(--glass-border);
}

.extras-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--accent);
}

.other-app-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background: var(--glass-bg);
    border-radius: 12px;
    margin-bottom: 12px;
    text-decoration: none;
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    transition: transform 0.2s;
}

.other-app-item:active {
    transform: scale(0.98);
}

.other-app-icon {
    width: 40px;
    height: 40px;
    background: var(--accent);
    color: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-right: 12px;
}

.other-app-details {
    flex: 1;
}

.other-app-name {
    font-weight: 500;
    font-size: 1rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    color: var(--text-primary);
    text-decoration: none;
}

.contact-item i {
    color: var(--accent);
    font-size: 1.2rem;
}

/* Font Size Adjuster */
.font-size-adjuster {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--glass-bg);
    padding: 6px 12px;
    border-radius: 20px;
    margin-right: 10px;
    border: 1px solid var(--glass-border);
}

.font-size-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-weight: bold;
    font-size: 1.1rem;
    cursor: pointer;
}

.font-size-display {
    font-size: 0.9rem;
    color: var(--text-secondary);
    min-width: 30px;
    text-align: center;
}

.search-bar input::placeholder, .list-search-input::placeholder {
    color: var(--text-secondary);
}

#search-results, #songs-container {
    min-height: 200px;
}

/* Admin Panel Styles */
.admin-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px 0;
}

.admin-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    backdrop-filter: blur(10px);
}

.admin-card h3 {
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.admin-card input {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 12px 16px;
    color: var(--text-primary);
    width: 100%;
    margin-bottom: 20px;
    outline: none;
    text-align: center;
    font-size: 1.1rem;
}

.admin-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.admin-tab-btn {
    flex: 1;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 500;
}

.admin-tab-btn.active {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
}

.admin-form {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.admin-form h4 {
    margin-bottom: 8px;
    color: var(--accent);
}

.admin-form input, 
.admin-form textarea, 
.admin-form select {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 12px 16px;
    color: var(--text-primary);
    width: 100%;
    outline: none;
    font-family: inherit;
    font-size: 1rem;
}

.admin-form select option {
    background: #121212;
    color: white;
}

.select-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.select-group label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.primary-btn {
    background: var(--accent);
    color: #000;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.primary-btn:active {
    transform: scale(0.98);
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid var(--glass-border);
    padding: 12px;
    border-radius: 12px;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
}

.hidden {
    display: none !important;
}

/* Slideshow System */
.slideshow-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    opacity: 0.3;
    transition: opacity 0.3s;
}

.slideshow-header:hover {
    opacity: 1;
}

.slideshow-container {
    flex: 1;
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.slideshow-container::-webkit-scrollbar {
    display: none;
}

.slide {
    flex: 0 0 100%;
    width: 100vw;
    height: 100vh;
    scroll-snap-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 10px; /* Minimal padding for edge-to-edge feel */
    box-sizing: border-box;
    overflow: hidden;
}

.slide-content-box {
    display: inline-block; /* Crucial for width measurement */
    text-align: center;
    line-height: 1.1; /* Tighten for bigger fonts */
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    word-wrap: break-word;
    max-width: 90%; /* Use 90% width as requested */
}

/* Stanza FAB and Menu */
.stanza-menu-fab {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 1001;
}

#stanza-shortcut-list {
    position: fixed;
    bottom: 100px;
    left: 30px;
    background: rgba(0,0,0,0.9);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 10px;
    max-height: 60vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 1001;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* Sidebar Styling */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100%;
    background-color: var(--card-bg);
    z-index: 2001;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 2px 0 10px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
}

.sidebar.active {
    transform: translateX(0);
}

.sidebar.hidden {
    display: none;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    backdrop-filter: blur(2px);
}

.sidebar-overlay.hidden {
    display: none;
}

.sidebar-header {
    display: flex;
    align-items: center;
    padding: 20px;
    background-color: var(--bg-color);
    border-bottom: 1px solid var(--glass-border);
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    margin-right: 15px;
}

.sidebar-title {
    flex: 1;
    font-size: 1.2rem;
    font-weight: 600;
}

.sidebar-menu {
    list-style: none;
    padding: 10px 0;
    margin: 0;
    overflow-y: auto;
}

.sidebar-menu li {
    padding: 15px 20px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.02);
}

.sidebar-menu li i {
    width: 30px;
    font-size: 1.2rem;
    margin-right: 10px;
    text-align: center;
}

.primary-btn {
    background: var(--accent);
    color: #000;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.primary-btn:active {
    transform: scale(0.98);
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid var(--glass-border);
    padding: 12px;
    border-radius: 12px;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
}

.hidden {
    display: none !important;
}

/* Slideshow System */
.slideshow-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    opacity: 0.3;
    transition: opacity 0.3s;
}

.slideshow-header:hover {
    opacity: 1;
}

.slideshow-container {
    flex: 1;
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.slideshow-container::-webkit-scrollbar {
    display: none;
}

.slide {
    flex: 0 0 100%;
    width: 100vw;
    height: 100vh;
    scroll-snap-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 10px; /* Minimal padding for edge-to-edge feel */
    box-sizing: border-box;
    overflow: hidden;
}

.slide-content-box {
    display: inline-block; /* Crucial for width measurement */
    text-align: center;
    line-height: 1.1; /* Tighten for bigger fonts */
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    word-wrap: break-word;
    max-width: 90%; /* Use 90% width as requested */
}

/* Stanza FAB and Menu */
.stanza-menu-fab {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 1001;
}

#stanza-shortcut-list {
    position: fixed;
    bottom: 100px;
    left: 30px;
    background: rgba(0,0,0,0.9);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 10px;
    max-height: 60vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 1001;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* Sidebar Styling */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100%;
    background-color: var(--card-bg);
    z-index: 2001;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 2px 0 10px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
}

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

.sidebar.hidden {
    display: none;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    backdrop-filter: blur(2px);
}

.sidebar-overlay.hidden {
    display: none;
}

.sidebar-header {
    display: flex;
    align-items: center;
    padding: 20px;
    background-color: var(--bg-color);
    border-bottom: 1px solid var(--glass-border);
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    margin-right: 15px;
}

.sidebar-title {
    flex: 1;
    font-size: 1.2rem;
    font-weight: 600;
}

.sidebar-menu {
    list-style: none;
    padding: 10px 0;
    margin: 0;
    overflow-y: auto;
}

.sidebar-menu li {
    padding: 15px 20px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.02);
}

.sidebar-menu li i {
    width: 30px;
    font-size: 1.2rem;
    margin-right: 10px;
    text-align: center;
}

.sidebar-menu li:active {
    background-color: rgba(255,255,255,0.05);
}

/* Extras toggles */
.extras-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

/* Theme Icon Styling */
body.light-mode #theme-icon.fa-sun {
    color: #f39c12;
}
