@font-face {
  font-family: 'Fira Code';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/firacode/v27/uU9eCBsR6Z2vfE9aq3bL0fxyUs4tcw4W_GNsFVc.ttf) format('truetype');
}
@font-face {
  font-family: 'Fira Code';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/firacode/v27/uU9eCBsR6Z2vfE9aq3bL0fxyUs4tcw4W_D1sFVc.ttf) format('truetype');
}
@font-face {
  font-family: 'Fira Code';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/firacode/v27/uU9eCBsR6Z2vfE9aq3bL0fxyUs4tcw4W_A9sFVc.ttf) format('truetype');
}
@font-face {
  font-family: 'Fira Code';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/firacode/v27/uU9eCBsR6Z2vfE9aq3bL0fxyUs4tcw4W_ONrFVc.ttf) format('truetype');
}
@font-face {
  font-family: 'Fira Code';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/firacode/v27/uU9eCBsR6Z2vfE9aq3bL0fxyUs4tcw4W_NprFVc.ttf) format('truetype');
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Fira Code', 'Courier New', monospace;
}

body {
    background: #f5f5f5;
    font-family: 'Fira Code', 'Courier New', monospace;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    color: #2d3748;
    transition: all 0.3s ease;
}

body.dark-theme {
    background: #2d3748;
    color: #e2e8f0;
}

.book-container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border: 1px solid #e2e8f0;
    position: relative;
}

.book-container::before {
    display: none;
}

.book-content {
    border-top: none;
    background: #f5f5f5;
    padding: 40px 60px 60px 60px;
    min-height: 600px;
    position: relative;
    z-index: 5;
    margin-top: -1px;
}

.tab-navigation {
    background: white;
    border-bottom: none;
    padding: 15px 20px 0 20px;
    display: flex;
    flex-direction: column;
    min-height: auto;
    position: relative;
}

.tab-navigation-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 15px;
}

.logo-section {
    flex: 0 0 auto;
}

.logo {
    height: 60px;
    width: auto;
    border: none;
    outline: none;
}

.nav-tabs-container {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.nav-tabs-container::after {
    display: none;
}

.nav-tabs {
    display: flex;
    list-style: none;
    gap: 0;
    align-items: flex-end;
    position: relative;
    z-index: 10;
    margin-bottom: 0;
}

.nav-tabs li {
    margin: 0;
}

.nav-tabs a {
    display: block;
    padding: 12px 24px;
    background: #4a5568;
    color: #e2e8f0;
    text-decoration: none;
    border: 1px solid #718096;
    border-bottom: none;
    border-radius: 12px 12px 0 0;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
    position: relative;
    margin-right: -1px;
}

.nav-tabs a:hover {
    background: #718096;
    color: white;
}

.nav-tabs a.active {
    background: #f5f5f5;
    color: #1f2937;
    font-weight: 600;
    border-color: #d1d5db;
    border-bottom: none;
    z-index: 20;
    box-shadow: none;
}

body.dark-theme .nav-tabs a.active {
    background: #2d3748;
    color: #e2e8f0;
    border-color: #4a5568;
    box-shadow: none;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.theme-toggle-bottom {
    display: flex;
    align-items: flex-end;
}

/* THEME TOGGLE - Working Custom Icons with ::before pseudo-elements */
.theme-toggle {
    background: #f5f5f5 !important;
    color: #1f2937 !important;
    border: 1px solid #d1d5db !important;
    border-bottom: none !important;
    border-radius: 12px 12px 0 0 !important;
    width: 50px !important;
    height: 40px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
    position: relative !important;
    padding: 0 !important;
    font-family: inherit !important;
    overflow: visible !important;
}

/* Hide the spans completely and use the button's pseudo-elements instead */
.moon-icon,
.sun-icon {
    display: none !important;
}

/* LIGHT THEME: Create moon with ::before */
.theme-toggle::before {
    content: '' !important;
    position: absolute !important;
    width: 16px !important;
    height: 16px !important;
    border-radius: 50% !important;
    background: #4f46e5 !important;
    box-shadow: inset -5px -3px 0 0 #f5f5f5 !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
}

.theme-toggle:hover {
    background: #718096 !important;
}

/* Don't change moon color on hover - keep same background color */
.theme-toggle:hover::before {
    background: #4f46e5 !important;
    box-shadow: inset -5px -3px 0 0 #f5f5f5 !important;
}

/* DARK THEME: Create sun with ::before */
body.dark-theme .theme-toggle {
    background: #4a5568 !important;
    color: #1f2937 !important;
    border-color: #718096 !important;
}

body.dark-theme .theme-toggle::before {
    content: '' !important;
    position: absolute !important;
    width: 16px !important;
    height: 16px !important;
    border-radius: 50% !important;
    background: #fbbf24 !important;
    box-shadow: 
        0 0 0 2px transparent,
        /* Main cardinal rays */
        18px 0 0 -10px #fbbf24,
        -18px 0 0 -10px #fbbf24,
        0 18px 0 -10px #fbbf24,
        0 -18px 0 -10px #fbbf24,
        /* Diagonal rays */
        13px 13px 0 -10px #fbbf24,
        -13px -13px 0 -10px #fbbf24,
        13px -13px 0 -10px #fbbf24,
        -13px 13px 0 -10px #fbbf24 !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
}

body.dark-theme .theme-toggle:hover {
    background: #718096 !important;
}

/* Don't change sun color on hover */
body.dark-theme .theme-toggle:hover::before {
    background: #fbbf24 !important;
    box-shadow: 
        0 0 0 2px transparent,
        /* Main cardinal rays */
        18px 0 0 -10px #fbbf24,
        -18px 0 0 -10px #fbbf24,
        0 18px 0 -10px #fbbf24,
        0 -18px 0 -10px #fbbf24,
        /* Diagonal rays */
        13px 13px 0 -10px #fbbf24,
        -13px -13px 0 -10px #fbbf24,
        13px -13px 0 -10px #fbbf24,
        -13px 13px 0 -10px #fbbf24 !important;
}

.donation-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
}

.paypal-button {
    background: #f8f9fa;
    color: #4a5568;
    border: 1px solid #e2e8f0;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-family: inherit;
    font-size: 12px;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.paypal-button:hover {
    background: #e2e8f0;
    transform: translateY(-1px);
}

.bitcoin-qr {
    background: #f8f9fa;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffc500;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    padding: 8px 16px;
    gap: 6px;
    font-family: inherit;
    text-decoration: none;
}

.bitcoin-qr:hover {
    background: #e2e8f0;
    transform: translateY(-1px);
}

.bitcoin-text {
    color: #4a5568;
    font-weight: 500;
}

.lightning-icon {
    color: #ffc500;
    font-size: 14px;
}

.bitcoin-qr-tooltip {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    padding: 16px;
    display: none;
    z-index: 2000;
    min-width: 200px;
    text-align: center;
}

.bitcoin-qr-tooltip.active {
    display: block;
}

.bitcoin-qr-tooltip h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #333;
}

.qr-code-large {
    width: 160px;
    height: 160px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    font-size: 12px;
}

body.dark-theme .book-content {
    background: #2d3748;
}

body.dark-theme .book-container {
    background: #4a5568;
    border-color: #718096;
}

body.dark-theme .tab-navigation {
    background: #4a5568;
    border-color: #718096;
}

body.dark-theme .nav-tabs a {
    background: #4a5568;
    color: #e2e8f0;
    border-color: #718096;
}

body.dark-theme .nav-tabs a:hover {
    background: #718096;
    color: white;
}

body.dark-theme .nav-tabs a.active {
    background: #2d3748;
    color: #e2e8f0;
    border-color: #4a5568;
}

body.dark-theme .paypal-button {
    background: #718096;
    color: #e2e8f0;
    border-color: #9ca3af;
}

body.dark-theme .paypal-button:hover {
    background: #9ca3af;
}

body.dark-theme .bitcoin-qr {
    background: #718096;
    border-color: #9ca3af;
}

body.dark-theme .bitcoin-qr:hover {
    background: #9ca3af;
}

body.dark-theme .bitcoin-text {
    color: #e2e8f0;
}

body.dark-theme .lightning-icon {
    color: #ffc500;
}

body.dark-theme .bitcoin-qr-tooltip {
    background: #4a5568;
    border-color: #718096;
}

body.dark-theme .bitcoin-qr-tooltip h4 {
    color: #e2e8f0;
}

body.dark-theme .qr-code-large {
    background: #2d3748;
    border-color: #4a5568;
    color: #cbd5e0;
}

.hero-section {
    text-align: center;
    margin-bottom: 50px;
}

.hero-title {
    font-size: 42px;
    color: #1a202c;
    margin-bottom: 20px;
    font-weight: 700;
}

body.dark-theme .hero-title {
    color: #f7fafc;
}

.hero-subtitle {
    font-size: 18px;
    color: #4a5568;
    max-width: 700px;
    margin: 0 auto 40px;
    line-height: 1.7;
}

body.dark-theme .hero-subtitle {
    color: #cbd5e0;
}

.cta-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin: 40px 0;
}

.cta-button {
    background: #556B2F;
    color: white;
    padding: 14px 28px;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-family: inherit;
    transition: all 0.2s ease;
}

.cta-button:hover {
    background: #3D4A1F;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(85, 107, 47, 0.4);
}

.cta-button.secondary {
    background: white;
    border: 2px solid #e2e8f0;
    color: #556B2F;
}

.cta-button.secondary:hover {
    border-color: #556B2F;
    color: #3D4A1F;
    background: #f7fafc;
}

body.dark-theme .cta-button.secondary {
    background: #4a5568;
    border-color: #718096;
    color: #e2e8f0;
}

.features-grid,
.playlists-container {
    margin: 40px auto 0 auto;
    width: 100%;
    max-width: 100%;
    padding: 0;
    position: relative;
    left: 0;
    right: 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

.playlists-container {
    display: block;
}

.feature-card {
    background: white;
    padding: 32px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.feature-card:hover {
    border-color: #cbd5e0;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

body.dark-theme .feature-card {
    background: #4a5568;
    border-color: #718096;
}

body.dark-theme .feature-card:hover {
    border-color: #cbd5e0;
}

.feature-card h3 {
    margin-bottom: 12px;
    color: #2d3748;
    font-weight: 600;
    font-size: 18px;
}

body.dark-theme .feature-card h3 {
    color: #e2e8f0;
}

.feature-card p {
    color: #4a5568;
    font-size: 15px;
    line-height: 1.6;
}

body.dark-theme .feature-card p {
    color: #cbd5e0;
}

.page-title {
    font-size: 32px;
    color: #1a202c;
    margin-bottom: 12px;
    font-weight: 700;
}

body.dark-theme .page-title {
    color: #f7fafc;
}

.page-subtitle {
    font-size: 16px;
    color: #718096;
    margin-bottom: 40px;
    line-height: 1.6;
}

body.dark-theme .page-subtitle {
    color: #cbd5e0;
}

.playlist-item, .article-item {
    background: white;
    padding: 32px;
    border-radius: 12px;
    margin-bottom: 24px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

.playlist-item:hover, .article-item:hover {
    border-color: #cbd5e0;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

body.dark-theme .playlist-item,
body.dark-theme .article-item {
    background: #4a5568;
    border-color: #718096;
}

.playlist-header, .article-header {
    display: block;
    margin-bottom: 16px;
}

.playlist-info h3, .article-header h3 {
    color: #2d3748;
    margin-bottom: 4px;
    font-weight: 600;
    font-size: 20px;
}

body.dark-theme .playlist-info h3,
body.dark-theme .article-header h3 {
    color: #e2e8f0;
}

.playlist-meta {
    color: #718096;
    font-size: 14px;
}

body.dark-theme .playlist-meta {
    color: #cbd5e0;
}

.article-category {
    background: #556B2F;
    color: white;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
}

.embed-player {
    width: 100%;
    height: 160px;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-top: 16px;
}

body.dark-theme .embed-player {
    background: #2d3748;
    border-color: #718096;
}

.article-excerpt {
    color: #4a5568;
    margin-bottom: 16px;
    line-height: 1.7;
    font-size: 15px;
}

body.dark-theme .article-excerpt {
    color: #cbd5e0;
}

.read-more {
    color: #556B2F;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.read-more:hover {
    color: #3D4A1F;
    text-decoration: underline;
}

body.dark-theme .read-more {
    color: #9AE6B4;
}

body.dark-theme .read-more:hover {
    color: #68D391;
}

.about-content h2 {
    color: #1a202c;
    margin: 32px 0 16px 0;
    font-size: 24px;
    font-weight: 600;
}

body.dark-theme .about-content h2 {
    color: #f7fafc;
}

.about-content p {
    color: #4a5568;
    margin-bottom: 16px;
    line-height: 1.7;
    font-size: 15px;
}

body.dark-theme .about-content p {
    color: #cbd5e0;
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .tab-navigation {
        padding: 15px 15px 0 15px;
    }
    
    .tab-navigation-top {
        flex-direction: column;
        gap: 15px;
        margin-bottom: 15px;
    }
    
    .header-controls {
        flex-direction: row;
        gap: 12px;
    }
    
    .nav-tabs-container {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }
    
    .theme-toggle-bottom {
        order: 1;
    }
    
    .nav-tabs {
        flex-wrap: wrap;
        justify-content: center;
        gap: 4px;
        margin-bottom: 0;
        order: 2;
    }
    
    .nav-tabs a {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .book-content {
        padding: 24px 20px;
        margin-top: -1px;
    }
    
    .hero-title {
        font-size: 28px;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .logo {
        height: 50px;
    }
    
    .donation-buttons {
        flex-wrap: wrap;
        justify-content: center;
    }
}