/* Universal Styles for Ancient Biblical Hebrew App */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Hebrew:wght@400;500;600&display=swap');

:root {
    --primary-gold: #ffd700;
    --light-gold: #f8e49b;
    --warm-cream: #e5c98d;
    --bg-dark: #181818;
    --card-dark: #232323;
    --card-brown: #26211A;
    --border-brown: #5c3e17;
    --border-dark: #444;
    --text-white: #ffffff;
    --hover-dark: #2e2e2e;
    --gradient-end: #272a2f;
    --purple-primary: #8a4fff;
    --purple-light: #c084fc;
    --hot-pink: #ff1493;
    --hot-pink-light: #ff69b4;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Manakahthey', 'Segoe UI', 'Noto Sans Hebrew', 'Roboto', Arial, sans-serif;
    background: var(--bg-dark);
    color: var(--warm-cream);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

.background-parchment {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 15% 25%, rgba(255, 215, 0, 0.03) 0%, transparent 40%),
        radial-gradient(circle at 85% 75%, rgba(248, 228, 155, 0.02) 0%, transparent 40%);
    z-index: -1;
}

/* Mobile App Navigation */
.mobile-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--card-dark);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    border-bottom: 1px solid var(--border-dark);
}

.mobile-nav::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-gold), var(--purple-primary), var(--primary-gold));
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

.hamburger-btn {
    background: none;
    border: 2px solid var(--purple-primary);
    color: var(--warm-cream);
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.2s;
}

.hamburger-btn:hover {
    border-color: var(--purple-light);
    background: var(--purple-primary);
    color: white;
    box-shadow: 0 0 10px rgba(138, 79, 255, 0.3);
}

.app-title {
    color: var(--primary-gold);
    font-size: 1.2rem;
    font-weight: 600;
    text-shadow: 0 0 6px rgba(255, 215, 0, 0.3);
    font-family: 'Manakahthey', 'Noto Sans Hebrew', serif;
    direction: rtl;
}

.back-btn {
    background: none;
    border: 2px solid var(--purple-primary);
    color: var(--warm-cream);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    text-decoration: none;
}

.back-btn:hover {
    border-color: var(--purple-light);
    background: var(--purple-primary);
    color: white;
    box-shadow: 0 0 10px rgba(138, 79, 255, 0.3);
}

/* Slide-out Menu */
.side-menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px;
    height: 100vh;
    background: var(--card-dark);
    transition: left 0.3s ease;
    z-index: 1001;
    padding-top: 4rem;
    border-right: 1px solid var(--border-dark);
}

.side-menu.open {
    left: 0;
}

.side-menu a {
    display: block;
    color: var(--warm-cream);
    text-decoration: none;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-dark);
    transition: all 0.2s;
}

.side-menu a:hover, .side-menu a.active {
    background: var(--purple-primary);
    color: white;
    border-left: 4px solid var(--primary-gold);
    box-shadow: inset 0 0 10px rgba(138, 79, 255, 0.2);
}

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.menu-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* Navigation Styles (for pages with horizontal nav) */
nav {
    background: var(--card-dark);
    padding: 1rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
    border-bottom: 1px solid var(--border-dark);
    position: relative;
}

nav::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-gold), var(--purple-primary), var(--primary-gold));
    animation: shimmer 3s ease-in-out infinite;
}

nav a {
    color: var(--warm-cream);
    text-decoration: none;
    font-weight: 500;
    padding: 0.3em 1em;
    border-radius: 5px;
    transition: background 0.2s, color 0.2s;
    border: 2px solid transparent;
}

nav a:hover, nav a.active {
    background: var(--hover-dark);
    color: var(--light-gold);
    border-color: var(--purple-light);
    text-shadow: 0 0 6px rgba(248, 228, 155, 0.3);
}

/* Header Styles */
header {
    text-align: center;
    padding: 2.5rem 1rem 1.5rem 1rem;
    background: linear-gradient(90deg, var(--card-dark) 60%, var(--gradient-end) 100%);
    border-bottom: 2px solid var(--border-brown);
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-gold), var(--purple-primary), var(--primary-gold));
    animation: shimmer 3s ease-in-out infinite;
}

header h1 {
    font-size: 2.5rem;
    color: var(--primary-gold);
    margin-bottom: 0.5rem;
    letter-spacing: 2px;
    font-weight: 600;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.3), 2px 2px 4px rgba(0, 0, 0, 0.5);
    font-family: 'Manakahthey', 'Noto Sans Hebrew', serif;
}

header .subtitle {
    font-size: 1.2rem;
    color: var(--warm-cream);
    opacity: 0.8;
    margin-top: 1rem;
}

.hebrew {
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    font-weight: 500;
    color: var(--light-gold);
    margin: 1rem 0;
    direction: rtl;
    font-family: 'Manakahthey', 'Noto Sans Hebrew', serif;
    line-height: 1.2;
    letter-spacing: 1px;
    opacity: 0.9;
    text-shadow: 0 0 8px rgba(248, 228, 155, 0.4), 1px 1px 3px rgba(0, 0, 0, 0.6);
}

.logo-container {
    margin-bottom: 1.5rem;
}

.app-logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid var(--primary-gold);
    padding: 4px;
    background: var(--card-brown);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    display: inline-block;
    overflow: hidden;
}

.logo-image {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    filter: brightness(0.9) contrast(1.1);
}

/* Main Content Area */
main {
    max-width: 900px;
    margin: 2rem auto;
    padding: 1rem;
    position: relative;
    z-index: 1;
}

/* Adjust for mobile nav */
body.mobile-nav-page {
    padding-top: 80px;
}

/* Button Styles */
button, .btn {
    background: var(--card-brown);
    border: 2px solid var(--purple-primary);
    border-radius: 10px;
    color: var(--warm-cream);
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    font-family: inherit;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

button:hover, .btn:hover {
    transform: translateY(-2px);
    border-color: var(--purple-light);
    box-shadow: 0 4px 12px rgba(138, 79, 255, 0.2);
    background: var(--card-dark);
}

button:active, .btn:active {
    transform: translateY(0);
}

/* Primary Button Styles */
button.primary, .btn.primary {
    background: var(--card-dark);
    color: var(--purple-primary);
    border-color: var(--purple-primary);
}

button.primary:hover, .btn.primary:hover {
    color: var(--purple-light);
    border-color: var(--purple-light);
    box-shadow: 0 4px 16px rgba(138, 79, 255, 0.3);
}

/* Bible Page Hot Pink Buttons */
.bible-page .hamburger-btn,
.bible-page .back-btn {
    border-color: var(--hot-pink);
}

.bible-page .hamburger-btn:hover,
.bible-page .back-btn:hover {
    border-color: var(--hot-pink-light);
    background: var(--hot-pink);
    box-shadow: 0 0 10px rgba(255, 20, 147, 0.3);
}

.bible-page .side-menu a:hover,
.bible-page .side-menu a.active {
    background: var(--hot-pink);
    color: white;
    border-left: 4px solid var(--primary-gold);
    box-shadow: inset 0 0 10px rgba(255, 20, 147, 0.2);
}

/* Card Styles */
.card, .book-card, .chapter-card {
    background: var(--card-brown);
    border: 2px solid var(--purple-primary);
    border-radius: 18px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.4);
    padding: 2rem 1rem 1.2rem 1rem;
    text-align: center;
    transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
    cursor: pointer;
    position: relative;
}

.card:hover, .book-card:hover, .chapter-card:hover {
    transform: translateY(-6px) scale(1.035);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    border-color: var(--purple-light);
}

.card .hebrew, .book-card .hebrew {
    display: block;
    font-size: 1.1rem;
    color: var(--light-gold);
    letter-spacing: 1px;
    margin-top: 0.35em;
    font-family: 'Manakahthey', 'Noto Sans Hebrew', serif;
    opacity: 0.9;
    text-shadow: 0 0 6px rgba(248, 228, 155, 0.3), 1px 1px 2px rgba(0, 0, 0, 0.6);
}

/* Bible Page Hot Pink Cards */
.bible-page .book-tile {
    border-color: var(--hot-pink);
}

.bible-page .book-tile:hover {
    border-color: var(--hot-pink-light);
    box-shadow: 0 8px 32px rgba(255, 20, 147, 0.4);
}

.bible-page .book-tile.available {
    border-color: var(--primary-gold);
}

.bible-page .book-tile.available:hover {
    border-color: var(--hot-pink-light);
    box-shadow: 0 8px 32px rgba(255, 105, 180, 0.4);
}

/* Grid Layouts */
.book-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.chapter-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(68px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.chapter-card {
    background: var(--card-dark);
    color: var(--primary-gold);
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    padding: 1rem 0.5rem;
    text-align: center;
    font-size: 1.15rem;
    cursor: pointer;
    border: 2px solid var(--border-brown);
    transition: all 0.18s ease;
    text-shadow: 0 0 4px rgba(255, 215, 0, 0.3);
}

.chapter-card:hover {
    background: var(--purple-primary);
    color: var(--text-white);
    transform: scale(1.05);
    border-color: var(--purple-light);
    text-shadow: none;
}

/* Hebrew Section Titles */
section h2 {
    color: var(--primary-gold);
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.8rem;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.3);
    font-family: 'Manakahthey', 'Noto Sans Hebrew', serif;
    direction: rtl;
}

/* Form Elements */
input, textarea, select {
    background: var(--card-dark);
    border: 2px solid var(--border-dark);
    border-radius: 8px;
    color: var(--warm-cream);
    padding: 0.75rem;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--purple-primary);
    box-shadow: 0 0 0 3px rgba(138, 79, 255, 0.1);
}

/* Footer Styles */
footer {
    text-align: center;
    padding: 2rem 1rem;
    background: var(--card-dark);
    border-top: 1px solid var(--border-dark);
    margin-top: 3rem;
    position: relative;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--purple-primary), transparent);
    opacity: 0.5;
}

footer p {
    color: var(--warm-cream);
    font-size: 0.95rem;
    opacity: 0.7;
}

/* Utility Classes */
.text-gold {
    color: var(--primary-gold);
    text-shadow: 0 0 6px rgba(255, 215, 0, 0.4), 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.text-center {
    text-align: center;
}

.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.p-1 { padding: 1rem; }
.p-2 { padding: 2rem; }

/* Loading Animation */
.loading {
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Responsive */
@media (max-width: 600px) {
    nav {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .book-list {
        grid-template-columns: 1fr;
    }
    
    .chapter-list {
        grid-template-columns: repeat(4, 1fr);
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    .hebrew {
        font-size: 1.4rem;
    }
    
    main {
        padding: 0.5rem;
    }
    
    .card, .book-card {
        padding: 1.5rem 1rem;
    }
    
    .app-title {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    nav {
        padding: 0.5rem;
    }
    
    header {
        padding: 2rem 0.5rem 1rem;
    }
    
    button, .btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
}
.logout-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 0.5rem 1rem;
    background: rgba(255, 0, 0, 0.3);
    color: #e5c98d;
    border: 1px solid rgba(255, 0, 0, 0.5);
    border-radius: 8px;
    cursor: pointer;
    z-index: 1000;
}
