:root {
    --primary: #9b6a38;
    --primary-light: #c79f6f;
    --bg-main: #faf9f8;
    --bg-card: #ffffff;
    --text-main: #1f2937;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --accent: #d4af37; 
    --danger: #ef4444;
    --success: #10b981;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
}

.font-playfair {
    font-family: 'Playfair Display', serif;
}

/* Landing Page */
.landing-body {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.landing-container {
    width: 100%;
    max-width: 400px;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 30px 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
}

.auth-card .logo-area {
    text-align: center;
    margin-bottom: 25px;
}

.auth-card .logo-area h1 {
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: 4px;
}

.auth-card .logo-area p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
input[type="password"] {
    width: 100%;
    padding: 12px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
    transition: all 0.2s;
}

input:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(155, 106, 56, 0.1);
}

.btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.btn:active {
    transform: scale(0.98);
}

.primary-btn {
    background: var(--primary);
    color: white;
}

.primary-btn:hover {
    opacity: 0.9;
}

.outline-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
}

.outline-btn:hover {
    background: rgba(0,0,0,0.03);
}

.divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
}
.divider::before, .divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border);
}
.divider span {
    padding: 0 10px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.switch-form {
    text-align: center;
    margin-top: 15px;
    font-size: 0.9rem;
    color: var(--text-muted);
}
.switch-form a {
    color: var(--primary-light);
    text-decoration: none;
}

.hidden {
    display: none !important;
}

.alert {
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    text-align: center;
}
.alert.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}
.alert.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* App Layout - Always bottom nav, no sidebar by default */
.app-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.sidebar {
    display: none;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding-bottom: 70px;
}

/* Search Bar */
.search-wrapper {
    position: relative;
    max-width: 600px;
    margin: 0 auto 30px;
    width: 100%;
}
.search-input {
    width: 100%;
    padding: 15px 50px 15px 20px;
    font-size: 1.1rem;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 30px;
    color: var(--text-main);
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    transition: all 0.2s;
}
.search-input:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(155, 106, 56, 0.1), 0 4px 12px rgba(0,0,0,0.03);
    outline: none;
}

/* Base Cards */
.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.03);
}

/* Verses */
.verse-card {
    margin-bottom: 15px;
}
.verse-card.priority {
    border-left: 4px solid var(--accent);
}
.verse-ref {
    color: var(--accent);
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.verse-text {
    font-size: 1.05rem;
    line-height: 1.6;
}

.history-item {
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}
.history-item:hover {
    background: rgba(0,0,0,0.03);
}
.history-item.saved {
    border-left: 2px solid var(--accent);
}

.save-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    padding: 4px;
    cursor: pointer;
}
.save-btn.active { color: var(--accent); }
.save-btn:hover { color: var(--accent); transform: scale(1.1); }

.tooltip {
    position: relative;
}

/* Settings Card */
.settings-card {
    padding: 25px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 20px;
    max-width: 800px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.03);
}

/* Admin Grids */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); 
    gap: 20px; 
    margin-bottom: 40px;
}

.admin-tables {
    display: grid; 
    grid-template-columns: 2fr 1fr; 
    gap: 30px;
}

/* Chatbot UI */
.chat-message {
    display: flex;
    max-width: 85%;
}
.chat-message.user {
    align-self: flex-end;
    margin-right: 15px;
}
.chat-message.bot {
    align-self: flex-start;
}
.message-content {
    padding: 15px 20px;
    border-radius: 18px;
    line-height: 1.5;
    font-size: 1.05rem;
}
.chat-message.user .message-content {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 15px rgba(155, 106, 56, 0.2);
}
.chat-message.bot .message-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-top-left-radius: 4px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}

.typing-indicator {
    display: flex;
    gap: 5px;
    padding: 5px 10px;
}
.typing-dot {
    width: 8px;
    height: 8px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out both;
}
.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

.chat-verse-card {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    padding: 15px;
    margin-top: 15px;
    border-radius: 12px;
    position: relative;
    transition: all 0.2s;
}

.chat-verse-card:hover {
    background: rgba(0, 0, 0, 0.04);
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

.highlight-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ffffff;
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.highlight-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    transform: scale(1.1);
}

.highlight-btn svg {
    width: 16px;
    height: 16px;
}

@media (max-width: 768px) {
    .highlight-btn {
        width: 36px;
        height: 36px;
        top: 8px;
        right: 8px;
        background: #ffffff;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
}

/* Bottom Navigation - ALWAYS visible */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.03);
    z-index: 1000;
}

.bottom-nav ul {
    display: flex;
    justify-content: space-around;
    align-items: center;
    list-style: none;
    padding: 0;
    margin: 0;
    height: 60px;
    max-width: 500px;
    margin: 0 auto;
}

.bottom-nav li {
    flex: 1;
    height: 100%;
}

.bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-decoration: none;
    height: 100%;
    font-size: 0.7rem;
    font-weight: 500;
    transition: color 0.2s;
}

.bottom-nav a svg {
    margin-bottom: 3px;
    opacity: 0.7;
}

.bottom-nav a:hover,
.bottom-nav a.active {
    color: var(--primary-light);
}

.bottom-nav a.active svg {
    opacity: 1;
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    border-top-color: var(--primary-light);
    animation: spin 1s ease-in-out infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .main-content {
        padding: 20px 15px 75px 15px !important;
    }
    
    .search-input {
        font-size: 1rem;
        padding: 12px 45px 12px 15px;
    }
    
    .auth-card .logo-area h1 {
        font-size: 1.75rem;
    }
    
    .admin-stats {
        grid-template-columns: 1fr;
    }
    
    .admin-tables {
        grid-template-columns: 1fr;
    }
    
    table, thead, tbody, th, td, tr {
        display: block;
    }
    
    thead tr {
        position: absolute;
        top: -9999px; left: -9999px;
    }
    
    td {
        position: relative;
        padding: 10px 0 !important;
        border-bottom: 1px solid rgba(255,255,255,0.05) !important;
    }
    
    td:last-child {
        border-bottom: 0 !important;
    }
}
