:root {
    /* High-Contrast, Color-Blind Safe Palette */
    --bg-color: #121212;
    --surface-color: #1e1e1e;
    --btn-bg: #2a2a2a;
    --btn-hover: #333333; 
    --accent-cyan: #00E5FF; /* Highly visible vivid blue */
    --accent-gold: #FFD700; /* Highly visible yellow for focus/hover */
    --border-color: #555555; /* Stronger border for structural clarity */
    --text-main: #FFFFFF;
    --text-muted: #E0E0E0; /* Brightened for better contrast/readability */
}

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    margin: 0;
    padding: 40px 16px 60px 16px;
}

/* Base Mobile Layout */
.page-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    gap: 24px;
}

.profile-section {
    text-align: center;
}

/* FIXED LOGO DISPLAY */
.profile-img {
    width: 100%;
    max-width: 260px;
    height: auto;
    border-radius: 16px;
    border: 2px solid var(--accent-cyan);
    box-shadow: 0 0 16px rgba(0, 229, 255, 0.25);
    object-fit: contain;
    transition: all 0.3s ease;
    margin: 0 auto;
    display: block;
}

.profile-title {
    margin: 16px 0 0 0;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.profile-bio {
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.5;
}

.links-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Category Header Divider */
.category-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
    margin-bottom: 4px;
}

.category-header span {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent-gold); 
    white-space: nowrap;
}

.category-header::before,
.category-header::after {
    content: "";
    flex-grow: 1;
    height: 2px; 
    background-color: var(--border-color);
}

/* Interactive Vibration Animation */
@keyframes subtle-buzz {
    0% { transform: translateY(-2px) translateX(0); }
    25% { transform: translateY(-2px) translateX(-1px) rotate(-0.5deg); }
    50% { transform: translateY(-2px) translateX(1px) rotate(0.5deg); }
    75% { transform: translateY(-2px) translateX(-1px) rotate(-0.5deg); }
    100% { transform: translateY(-2px) translateX(0); }
}

/* Standardized Button */
.btn {
    position: relative; /* REQUIRED for the new badge to stick to the corners */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: var(--btn-bg);
    color: var(--text-main);
    text-decoration: none;
    padding: 14px 16px;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    text-align: center;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

/* NEW BADGE STYLING */
.new-badge {
    position: absolute;
    top: -14px;
    left: -10px; /* Swapped to the left side */
    width: 65px; 
    height: auto;
    z-index: 10;
    pointer-events: none; 
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.6)); 
}

.btn:hover, .btn:focus {
    background-color: var(--btn-hover);
    border-color: var(--accent-cyan);
    box-shadow: 0 0 12px rgba(0, 229, 255, 0.2);
    /* Triggers the vibration loop rapidly */
    animation: subtle-buzz 0.15s linear infinite; 
    outline: none;
}

.btn-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
}

.btn-desc {
    font-size: 13px;
    font-weight: 400;
    color: var(--text-muted);
    line-height: 1.4;
}

.btn-highlight {
    background: linear-gradient(145deg, #163040, #1e1e1e);
    border-color: var(--accent-cyan);
}

/* NEW: Gold Highlight Button */
.btn-highlight-gold {
    background: linear-gradient(145deg, #332b00, #1e1e1e);
    border-color: var(--accent-gold);
}

.btn-highlight-gold:hover, .btn-highlight-gold:focus {
    border-color: #ffea00; /* Brighter gold on hover */
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.2);
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* ... existing code ... */

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Banners */
.banner-link {
    display: block;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid var(--border-color);
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.banner-link:hover, .banner-link:focus {
    border-color: var(--accent-gold);
    transform: translateY(-2px);
    outline: none;
}

.banner-img {
    width: 100%;
    height: auto;
    display: block;
}

/* Details Box */
.info-card {
    background: var(--surface-color);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 18px;
    font-size: 14px;
    line-height: 1.6;
    word-break: break-all;
    text-align: center;
}

.info-card p {
    margin: 8px 0;
}

.footer {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 32px;
    line-height: 1.8;
}

.footer a {
    color: var(--accent-cyan);
    text-decoration: underline;
    text-underline-offset: 3px;
    font-weight: 600;
}

.footer a:hover {
    color: var(--accent-gold);
}


/* ========================================= */
/* AFFILIATE PAGE SPECIFIC STYLES            */
/* ========================================= */

.app-container {
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    margin: 0 auto; 
    gap: 16px;
}

.page-title {
    text-align: center;
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 5px;
    color: var(--text-main);
    letter-spacing: 1px;
}

.disclaimer {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
    font-style: italic;
}

.btn-back {
    background: transparent;
    border: 2px dashed var(--border-color);
    flex-direction: row; 
    width: fit-content;
    margin: 0 auto 20px auto;
    padding: 10px 20px;
}

.btn-back .btn-title {
    color: var(--text-muted);
    margin-bottom: 0;
    font-size: 13px;
}

.btn-back:hover .btn-title {
    color: var(--accent-cyan);
}

.grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

/* ========================================= */
/* BIBLE PAGE SPECIFIC STYLES                */
/* ========================================= */

/* Sticky Audio Player */
.player-container {
    position: sticky;
    top: 10px;
    background: var(--surface-color);
    border: 2px solid var(--accent-cyan);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5), 0 0 15px rgba(0, 229, 255, 0.2);
    text-align: center;
    z-index: 100;
}

.now-playing-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent-cyan);
    margin-bottom: 4px;
}

#playingTitle {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
}

audio {
    width: 100%;
    height: 44px;
    outline: none;
    border-radius: 30px;
    color-scheme: dark; 
}

/* Book Dropdown Selection */
.selector-container {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.selector-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent-gold);
}

.book-select {
    width: 100%;
    background-color: var(--surface-color);
    color: var(--text-main);
    border: 2px solid var(--border-color);
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    appearance: none;
    /* Updated to use the Gold accent color for the dropdown arrow */
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23FFD700%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 16px top 50%;
    background-size: 12px auto;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.book-select:focus, .book-select:hover {
    border-color: var(--accent-gold);
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.2);
}

/* Chapter Grid */
.chapter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 12px;
    margin-top: 10px;
}

.chapter-btn {
    background-color: var(--btn-bg);
    color: var(--text-main);
    border: 2px solid var(--border-color);
    padding: 16px 0;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.chapter-btn:hover:not(.disabled) {
    background-color: var(--btn-hover);
    border-color: var(--accent-cyan);
    transform: translateY(-2px);
    box-shadow: 0 0 12px rgba(0, 229, 255, 0.2);
    /* Leverages the exact same animation you have on index.html */
    animation: subtle-buzz 0.15s linear infinite; 
    color: var(--accent-cyan);
}

.chapter-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background-color: transparent;
}

.chapter-btn.active {
    background: linear-gradient(145deg, #163040, #1e1e1e);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

/* ========================================= */
/* RESPONSIVE MEDIA QUERIES                  */
/* ========================================= */

/* Desktop Layout (Main Page) */
@media (min-width: 768px) {
    .page-wrapper {
        flex-direction: row;
        max-width: 960px;
        align-items: flex-start;
        gap: 48px;
        padding-top: 40px;
    }

    .profile-section {
        flex: 0 0 340px;
        position: sticky;
        top: 40px;
        background: var(--surface-color);
        padding: 40px 24px;
        border-radius: 20px;
        border: 2px solid var(--border-color);
    }

    .profile-img {
        max-width: 280px;
        border-width: 3px;
    }

    .profile-title {
        font-size: 26px;
    }

    .links-section {
        flex: 1; 
    }
}

/* Mobile Layout (Affiliate Page 3-Grid) */
@media (max-width: 480px) {
    .grid-3 {
        grid-template-columns: 1fr;
    }
}