@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --bg: #020617;
    --surface: #0f172a;
    --primary: #38bdf8;
    --primary-gradient: linear-gradient(135deg, #38bdf8 0%, #8b5cf6 100%);
    --surface-gradient: linear-gradient(180deg, rgba(30, 41, 59, 0.5) 0%, rgba(15, 23, 42, 0.8) 100%);
    --primary-hover: #0ea5e9;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #8b5cf6;
    --glass: rgba(15, 23, 42, 0.85);
    --border: rgba(255, 255, 255, 0.08);
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    --cross-ref: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --dict-card: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --multi-card: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

@font-face {
    font-family: 'TAUMB';
    src: url('TAUMB.ttf');
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3 {
    font-family: 'Outfit', sans-serif;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

/* Layout */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Book List (Split View) */
.book-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 768px) {
    .book-sections {
        grid-template-columns: 1fr;
    }
}

.section-title {
    margin-bottom: 15px;
    font-size: 1.2rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-left: 4px solid var(--primary);
    padding-left: 10px;
}

.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.card {
    background: var(--surface-gradient);
    border: 1px solid var(--border);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 20px 15px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
    font-weight: 500;
}

.card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--primary);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    background: rgba(56, 189, 248, 0.05);
}

.card.active {
    background: var(--primary-gradient);
    color: white;
    border: none;
}

.card-cross {
    background: var(--cross-ref) !important;
    color: white !important;
}

.card-dict {
    background: var(--dict-card) !important;
    color: white !important;
}


/* Chapter Selection */
.chapter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    gap: 10px;
}

.chapter-btn {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.chapter-btn:hover {
    background: var(--primary);
    color: white;
}

/* Verse View */
.back-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
}

.back-btn:hover {
    background: var(--surface);
}

.tools-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 10px;
    position: sticky;
    top: 0;
    background: var(--bg);
    z-index: 100;
    padding-top: 5px;
}

.tool-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 10px 20px;
    border-radius: 99px;
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.tool-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
}

.verse-item {
    margin-bottom: 20px;
    padding: 15px;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: border-color 0.2s;
}

.verse-item:hover {
    border-color: var(--primary);
}

.verse-item.highlight {
    background: rgba(56, 189, 248, 0.15);
    border-color: var(--primary);
}

.verse-num {
    font-weight: 700;
    color: var(--primary);
    margin-right: 10px;
}

/* Modal/Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg);
    z-index: 2000;
    display: none;
    flex-direction: column;
}

/* PPT Mode */
.ppt-mode {
    background: #000;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 60px;
    transition: all 0.5s ease;
}

.ppt-text {
    font-family: 'TAUMB', 'Inter', sans-serif;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 95%;
    width: 100%;
    margin-bottom: 0;
    line-height: 1.3;

    text-shadow: 0 4px 10px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}


.ppt-controls {
    display: none;
}

.ppt-btn {
    display: none;
}

.ppt-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
}

.ppt-nav-menu {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    padding: 10px 20px;
    border-radius: 12px;
    backdrop-filter: blur(5px);
    font-size: 0.9rem;
}

/* Search UI */
.search-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.search-input-wrap {
    display: flex;
    gap: 10px;
}

.search-input {
    flex: 1;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 1rem;
}

.search-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0 25px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
}

/* Audio Player */
.audio-player-fixed {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--glass);
    backdrop-filter: blur(10px);
    padding: 15px 30px;
    border-radius: 99px;
    border: 1px solid var(--border);
    display: none;
    align-items: center;
    gap: 15px;
    width: min(500px, 90%);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

audio {
    width: 100%;
    height: 35px;
}

/* Results Full Screen View */
.results-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg);
    z-index: 1500;
    padding: 20px;
    overflow-y: auto;
    display: none;
    flex-direction: column;
}

.results-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    position: sticky;
    top: 0;
    background: var(--bg);
    padding: 10px 0;
    z-index: 10;
    border-bottom: 1px solid var(--border);
}

.results-content {
    flex: 1;
}

select.search-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 20px;
    padding-right: 45px;
}


/* PPT Settings Image Grid */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 12px;
    max-height: 250px;
    overflow-y: auto;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.image-option {
    aspect-ratio: 16/9;
    border-radius: 8px;
    cursor: pointer;
    background-size: cover;
    background-position: center;
    border: 2px solid transparent;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.image-option:hover {
    transform: scale(1.05);
    border-color: var(--primary-hover);
}

.image-option.selected {
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary);
}

.image-option.selected::after {
    content: '✓';
    position: absolute;
    top: 5px;
    right: 5px;
    background: var(--primary);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
}

.image-option.none-option {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    font-size: 0.7rem;
    color: var(--text-muted);
}

