:root {
    --bg: #000000;
    --card: #1c1c1e;
    --text: #ffffff;
    --text-dim: #8e8e93;
    --accent: #4ae3f5;
    --ios-green: #34c759;
    --danger: #ff453a;
    --nav-bg: rgba(28, 28, 30, 0.9);
    --input-focus: rgba(74, 227, 245, 0.2);
}
* {
    transition: 0.3s;
    outline: none;
}
[data-theme="light"] {
    --bg: #f2f2f7;
    --card: #ffffff;
    --text: #000000;
    --text-dim: #636366;
    --nav-bg: rgba(242, 242, 247, 0.9);
    --input-focus: rgba(0, 0, 0, 0.05);
}

* {
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    margin: 0;
    padding: 0;
}

body {
    font-family: "Inter", sans-serif;
    background: var(--bg);
    color: var(--text);
    transition: background 0.3s ease;
    padding-bottom: 90px;
    min-height: 100vh;
    overflow-x: hidden;
}

/* --- Header & Side Nav --- */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 15px 20px;
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    border-bottom: 0.5px solid var(--text-dim);
    display: flex;
    align-items: center;
    gap: 15px;
}
.header-top {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}
.header-top h1 {
    font-size: 1.8rem;
    font-weight: 700;
}
.icon-btn {
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
}

.side-nav {
    position: fixed;
    left: -280px;
    top: 0;
    width: 280px;
    height: 100%;
    background: rgba(100, 100, 100, 0.1);
    z-index: 1000;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 20px;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
}
.side-nav.active {
    left: 0;
}
.nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(16px);
    z-index: 999;
    display: none;
}
.nav-overlay.active {
    display: block;
}
.side-nav h2 {
    margin-bottom: 20px;
    border-bottom: 1px solid var(--text-dim);
    padding-bottom: 10px;
}
.side-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 0;
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
    border-radius: 8px;
}
.side-item:active {
    background: rgba(255, 255, 255, 0.05);
}

/* --- Ribbon & Templates --- */
.ribbon {
    margin: 15px;
    background: rgba(74, 227, 245, 0.1);
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--accent);
}
.ribbon small {
    font-weight: 700;
    color: var(--accent);
    display: block;
    margin-bottom: 8px;
    font-size: 0.65rem;
    display: flex;
    align-items: center;
    gap: 5px;
}
#ribbon-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
}
.ribbon-tag {
    background: var(--accent);
    color: #000;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
}

.template-card {
    background: var(--card);
    margin: 15px;
    padding: 20px;
    border-radius: 16px;
    border: 1px dashed var(--accent);
    opacity: 0.8;
}
.template-card h3 {
    color: var(--accent);
    font-size: 0.9rem;
    text-transform: uppercase;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* --- Note Cards --- */
.note-card {
    background: var(--card);
    margin: 15px;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.4s ease;
}
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(50px);
        margin-bottom: 10rem;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        margin-bottom: 15px;
    }
}
.note-card h1 {
    font-size: 2.2rem;
    margin: 10px 0;
    font-weight: 800;
}
.note-card h2 {
    font-size: 1.6rem;
    color: var(--accent);
    font-weight: 700;
}
.note-card h4 {
    font-family: "Playfair Display", serif;
    font-style: italic;
    border-left: 4px solid var(--accent);
    padding-left: 12px;
    margin: 12px 0;
    font-size: 1.1rem;
}
.note-card p {
    line-height: 1.6;
    font-size: 1.05rem;
    opacity: 0.9;
    white-space: pre-wrap;
}
.timestamp {
    font-size: 0.65rem;
    color: var(--text-dim);
    text-transform: uppercase;
    display: block;
    margin-bottom: 10px;
}

.card-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 15px;
    gap: 12px;
    border-top: 1px solid #333;
    padding-top: 12px;
}
.action-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* --- Input & Dictation Design --- */
.editor-container {
    position: relative;
    width: 100%;
    margin-top: 15px;
}
#entry-input {
    width: 100%;
    border-radius: 16px;
    padding: 20px;
    background: var(--bg);
    color: var(--text);
    border: 2px solid #333;
    font-family: inherit;
    font-size: 1.1rem;
    transition: 0.3s;
    outline: none;
    resize: none;
    line-height: 1.6;
}
#entry-input:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.02);
}

.dictate-btn {
    position: absolute;
    right: 15px;
    bottom: 15px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--card);
    color: var(--accent);
    border: 1px solid #444;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.3s;
}
.dictate-btn.active {
    background: var(--danger);
    color: #fff;
    animation: pulse 1.5s infinite;
    border: none;
}
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0px rgba(255, 69, 58, 0.4);
    }
    100% {
        box-shadow: 0 0 0 15px rgba(255, 69, 58, 0);
    }
}

/* --- Bible View --- */
.bible-controls {
    padding: 15px;
    background: var(--card);
    margin: 10px 15px;
    border-radius: 12px;
}
.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}
.search-wrapper input {
    width: 100%;
    padding: 14px 45px 14px 15px;
    border-radius: 2rem;
    border: none;
    background: var(--bg);
    color: var(--text);
    font-size: 1rem;
}
.search-wrapper input:hover {
    display: block;
    background: transparent;
    outline: none;
    border-radius: 0%;
    border: none;
    border-bottom: 1px solid cyan;
}
.search-wrapper .material-icons-round {
    position: absolute;
    right: 15px;
    color: var(--text-dim);
}
.selector-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 10px;
    position: fixed;
    right: 0;
    top: 70px;
    z-index: 999;
}
input:hover {
    outline: 1px solid skyblue;
}
select:hover {
    outline: 1px solid skyblue;
}
select {
    padding: 14px;
    border-radius: 1.5rem;
    background: var(--bg), 0.2;
    color: var(--text);
    border: 1px solid cyan;
    appearance: none;
    backdrop-filter: blur(16px);
}

.verse {
    padding: 15px 0;
    line-height: 1.8;
    border-bottom: 0.5px solid #2c2c2e;
    transition: 0.2s;
}
.verse.highlight {
    background: rgba(74, 227, 245, 0.15);
    border-radius: 8px;
    padding-left: 10px;
    padding: 1rem;
    border-left: 3px solid var(--accent);
}
.v-num {
    font-weight: 800;
    color: var(--accent);
    margin-right: 12px;
    font-size: 0.9rem;
}
.kw-highlight {
    background: var(--accent);
    color: #000;
    border-radius: 4px;
    padding: 0 2px;
}

/* --- Modals & Prompts --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(16px);
    z-index: 1000;
    display: flex;
    align-items: flex-end;
}
.ios-modal {
    animation: myModal 0.5s linear;
    width: 100%;
    background: var(--card);
    backdrop-filter: blur(16px);
    border-radius: 30px 30px 0 0;
    padding: 25px 25px 40px;
    position: relative;
}
@keyframes myModal {
    from {
        opacity: 0;
        transform: translateY(500px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.modal-close-bar {
    width: 45px;
    height: 5px;
    background: #333;
    border-radius: 10px;
    margin: -10px auto 25px;
}

.option-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin: 20px 0;
}
.opt-btn {
    padding: 22px;
    border-radius: 18px;
    border: 1.5px solid #333;
    background: var(--bg);
    color: var(--text);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 600;
}
.opt-btn .material-icons-round {
    font-size: 30px;
    color: var(--accent);
}

.confirm-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: var(--card);
    padding: 30px;
    border-radius: 24px;
    z-index: 2000;
    width: 90%;
    max-width: 340px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.confirm-dialog.active {
    transform: translate(-50%, -50%) scale(1);
    transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* --- Footer & FAB --- */
.fab {
    animation: fab 2s ease alternate infinite;
    position: fixed;
    bottom: 100px;
    right: 25px;
    width: 70px;
    height: 70px;
    border: none;
    border-radius: 20px;
    border: 1px solid white;
    text-shadow: 0 0 30px black;
    color: white;
    z-index: 99;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: transparent;
    backdrop-filter: blur(1px);
}
@keyframes fab {
    0% {
        box-shadow: 0 0 30px black;
        border: 1px solid black;
    }
    100% {
        box-shadow: 0 0 30px white;
        border: 1px solid white;
    }
}
.fab:active {
    transform: scale(0.5);
}
.bottom-nav {
    position: fixed;
    bottom: 0;
    width: 100%;
    height: 85px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: var(--nav-bg);
    backdrop-filter: blur(25px);
    border-top: 0.5px solid rgba(142, 142, 147, 0.2);
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 98;
}
.nav-item {
    background: none;
    border: none;
    color: var(--text-dim);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
}
.nav-item.active {
    color: var(--accent);
}

.hidden {
    display: none !important;
}

.section-title {
    padding: 25px 20px 10px;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: 1px;
    font-weight: 700;
}
#bible-display {
    padding: 10px 1rem;
}

.view {
    animation: openEffect 0.3s linear;
}
@keyframes openEffect {
    from {
        filter: blur(10px);
    }
    to {
        filter: blur(0);
    }
}
