/* Refined, readable, modern styling */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Georgia", serif;
    line-height: 1.75;
    color: #3d2817;
    background: #fef9e7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-size: 17px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

header {
    background: rgba(254, 249, 231, 0.95);
    border-bottom: 1px solid #e8d5b7;
    padding: 1.25rem 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

nav {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    transition: opacity 0.2s;
}

.logo:hover {
    opacity: 0.85;
}

.logo-img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e8d5b7;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.logo-text {
    font-size: 1.35rem;
    font-weight: 600;
    color: #991b1b;
    letter-spacing: -0.02em;
}

/* Hamburger Menu Button */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 101;
}

.menu-toggle span {
    width: 24px;
    height: 2px;
    background: #991b1b;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: #5c4a37;
    text-decoration: none;
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.nav-links a:hover {
    color: #991b1b;
    background: #fef5e7;
}

/* Bottom Navigation Bar (Mobile) */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(254, 249, 231, 0.98);
    border-top: 1px solid #e8d5b7;
    padding: 0.5rem 0;
    z-index: 200;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    text-decoration: none;
    color: #6b5d47;
    transition: all 0.2s ease;
    min-height: 60px;
}

.bottom-nav-item .nav-icon {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
    transition: transform 0.2s ease;
}

.bottom-nav-item .nav-label {
    font-size: 0.75rem;
    font-weight: 500;
}

.bottom-nav-item.active {
    color: #991b1b;
}

.bottom-nav-item.active .nav-icon {
    transform: scale(1.1);
}

.bottom-nav-item:active {
    transform: scale(0.95);
    opacity: 0.8;
}

main {
    max-width: 1000px;
    margin: 0 auto;
    padding: 4rem 2rem;
    flex: 1;
}

h1 {
    font-size: 2.75rem;
    margin-bottom: 2.5rem;
    color: #991b1b;
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.versions {
    display: grid;
    gap: 1.25rem;
}

.version-card {
    display: block;
    background: #fefaf0;
    border: 1px solid #e8d5b7;
    border-left: 4px solid #ea580c;
    padding: 2rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.version-card:hover {
    border-left-color: #991b1b;
    box-shadow: 0 4px 12px rgba(153,27,27,0.12);
    transform: translateY(-2px);
    border-color: #d4c4a8;
    background: #fef5e7;
}

.version-name {
    display: block;
    font-size: 1.35rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #991b1b;
    letter-spacing: -0.01em;
}

.version-desc {
    display: block;
    font-size: 1rem;
    color: #6b5d47;
    line-height: 1.6;
}

.content {
    background: #fefaf0;
    padding: 2.5rem;
    border: 1px solid #e8d5b7;
    border-left: 4px solid #ea580c;
    border-radius: 8px;
    line-height: 1.85;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.content p {
    margin-bottom: 1.5rem;
    color: #3d2817;
    font-size: 1.05rem;
}

.content p:last-child {
    margin-bottom: 0;
}

/* Study page styles */
.study-section {
    margin-bottom: 3rem;
}

.study-section:last-child {
    margin-bottom: 0;
}

.study-section h2 {
    font-size: 1.75rem;
    font-weight: 600;
    color: #991b1b;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e8d5b7;
    letter-spacing: -0.02em;
}

.study-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #c06030;
    margin-bottom: 0.75rem;
    margin-top: 1.5rem;
}

.beliefs {
    display: grid;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.belief-item {
    background: #fefaf0;
    padding: 1.5rem;
    border: 1px solid #e8d5b7;
    border-left: 4px solid #ea580c;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.belief-item:hover {
    border-left-color: #991b1b;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.belief-item h3 {
    margin-top: 0;
    margin-bottom: 0.75rem;
}

.belief-item p {
    margin-bottom: 0;
    line-height: 1.7;
}

.teachings-list,
.gospel-list,
.steps-list,
.living-list,
.reading-list {
    margin: 1.5rem 0;
    padding-left: 2rem;
    line-height: 1.85;
}

.teachings-list li,
.gospel-list li,
.steps-list li,
.living-list li,
.reading-list li {
    margin-bottom: 1.25rem;
    color: #3d2817;
}

.teachings-list li:last-child,
.gospel-list li:last-child,
.steps-list li:last-child,
.living-list li:last-child,
.reading-list li:last-child {
    margin-bottom: 0;
}

.teachings-list strong,
.gospel-list strong,
.steps-list strong {
    color: #991b1b;
    font-weight: 600;
}

.prayer-note {
    background: #fff0e0;
    padding: 1.25rem;
    border-left: 4px solid #ea580c;
    border-radius: 6px;
    margin-top: 1.5rem;
    font-style: italic;
    color: #5c4a37;
}

.reading-list a {
    color: #991b1b;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.reading-list a:hover {
    border-bottom-color: #991b1b;
}

footer {
    background: #fefaf0;
    border-top: 1px solid #e8d5b7;
    padding: 2rem;
    text-align: center;
    color: #6b5d47;
    font-size: 0.95rem;
    margin-top: auto;
}

footer p {
    color: #6b5d47;
    line-height: 1.6;
}

/* Mobile-first improvements */
@media (max-width: 768px) {
    body {
        font-size: 16px;
        padding-bottom: 70px; /* Space for bottom nav */
    }
    
    header {
        padding: 1rem 0;
        position: sticky;
        top: 0;
        z-index: 100;
    }
    
    nav {
        padding: 0 1rem;
        position: relative;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .logo {
        gap: 0.5rem;
        flex-shrink: 0;
    }
    
    .logo-img {
        width: 44px;
        height: 44px;
    }
    
    .logo-text {
        font-size: 1.1rem;
        line-height: 1.2;
    }
    
    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(254, 249, 231, 0.98);
        border-top: 1px solid #e8d5b7;
        flex-direction: column;
        gap: 0;
        padding: 0;
        margin-top: 0.5rem;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        backdrop-filter: blur(10px);
    }
    
    .nav-links.nav-open {
        max-height: 300px;
    }
    
    .nav-links a {
        display: block;
        padding: 1rem 1.5rem;
        border-bottom: 1px solid #e8d5b7;
        font-size: 1rem;
        font-weight: 500;
        width: 100%;
        text-align: left;
    }
    
    .nav-links a:last-child {
        border-bottom: none;
    }
    
    .nav-links a:active {
        background: #fef5e7;
    }
    
    /* Bottom Navigation */
    .bottom-nav {
        display: flex;
    }
    
    main {
        padding: 2rem 1rem;
    }
    
    h1 {
        font-size: 2rem;
        margin-bottom: 1.5rem;
        line-height: 1.3;
    }
    
    .content {
        padding: 1.5rem 1rem;
        border-radius: 6px;
    }
    
    .content p {
        font-size: 1rem;
        margin-bottom: 1.25rem;
    }
    
    .version-card {
        padding: 1.75rem 1.25rem;
        border-radius: 8px;
        min-height: 120px;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    
    .version-card:active {
        transform: scale(0.98);
    }
    
    .version-name {
        font-size: 1.3rem;
        margin-bottom: 0.75rem;
    }
    
    .version-desc {
        font-size: 1rem;
        line-height: 1.6;
    }
    
    .study-section {
        margin-bottom: 2rem;
    }
    
    .study-section h2 {
        font-size: 1.5rem;
        margin-bottom: 1.25rem;
        padding-bottom: 0.5rem;
    }
    
    .study-section h3 {
        font-size: 1.15rem;
        margin-top: 1.25rem;
    }
    
    .beliefs {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .belief-item {
        padding: 1.25rem 1rem;
    }
    
    .teachings-list,
    .gospel-list,
    .steps-list,
    .living-list,
    .reading-list {
        padding-left: 1.25rem;
        margin: 1.25rem 0;
    }
    
    .teachings-list li,
    .gospel-list li,
    .steps-list li,
    .living-list li,
    .reading-list li {
        margin-bottom: 1rem;
        font-size: 0.95rem;
    }
    
    .prayer-note {
        padding: 1rem;
        font-size: 0.95rem;
    }
    
    footer {
        padding: 1.5rem 1rem;
        font-size: 0.9rem;
    }
}

/* Extra small devices (phones in portrait) */
@media (max-width: 480px) {
    body {
        font-size: 15px;
    }
    
    nav {
        padding: 0 0.75rem;
    }
    
    .logo-text {
        font-size: 1rem;
        line-height: 1.2;
    }
    
    .logo-img {
        width: 36px;
        height: 36px;
    }
    
    .nav-links {
        gap: 0.25rem;
        margin-top: 0.5rem;
    }
    
    .nav-links a {
        font-size: 0.85rem;
        padding: 0.625rem 0.75rem;
        min-width: auto;
        flex: 1 1 auto;
    }
    
    main {
        padding: 1.5rem 0.75rem;
    }
    
    h1 {
        font-size: 1.75rem;
        margin-bottom: 1.25rem;
    }
    
    .content {
        padding: 1.25rem 0.75rem;
    }
    
    .version-card {
        padding: 1.5rem 1rem;
        min-height: 110px;
    }
    
    .version-name {
        font-size: 1.2rem;
    }
    
    .version-desc {
        font-size: 0.95rem;
    }
    
    .study-section h2 {
        font-size: 1.35rem;
    }
    
    .study-section h3 {
        font-size: 1.1rem;
    }
    
    .belief-item {
        padding: 1rem 0.75rem;
    }
    
    .teachings-list,
    .gospel-list,
    .steps-list,
    .living-list,
    .reading-list {
        padding-left: 1rem;
    }
    
    footer {
        padding: 1.25rem 0.75rem;
        font-size: 0.85rem;
    }
}

/* Very small devices */
@media (max-width: 360px) {
    .logo-text {
        font-size: 0.9rem;
    }
    
    .nav-links a {
        font-size: 0.8rem;
        padding: 0.5rem 0.625rem;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    .version-name {
        font-size: 1rem;
    }
}
