/* High Tech / Matrix / Agentic AI Theme */

:root {
    /* Color Palette */
    --bg-color: #050505;
    --bg-darker: #000000;
    --card-bg: rgba(10, 20, 30, 0.7);
    --card-border: rgba(0, 243, 255, 0.2);
    
    --primary-color: #00f3ff; /* Cyan/Blue Neon */
    --accent-color: #00ff41; /* Matrix Green */
    --text-color: #e0e0e0;
    --text-muted: #a0a0a0;
    
    --glow-cyan: 0 0 10px rgba(0, 243, 255, 0.5), 0 0 20px rgba(0, 243, 255, 0.3);
    --glow-green: 0 0 10px rgba(0, 255, 65, 0.5), 0 0 20px rgba(0, 255, 65, 0.3);
    
    /* Typography */
    --font-heading: 'Share Tech Mono', monospace;
    --font-body: 'Rajdhani', sans-serif;
    
    /* Layout */
    --container-width: 1200px;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* Background Effects */
#matrix-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.15; /* Subtle background */
}

.scanline {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0),
        rgba(255, 255, 255, 0) 50%,
        rgba(0, 0, 0, 0.1) 50%,
        rgba(0, 0, 0, 0.1)
    );
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 100;
    opacity: 0.6;
}

/* Typography */
h1, h2, h3 {
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 2px;
    color: white;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: all 0.3s ease;
}

a:hover {
    color: var(--accent-color);
    text-shadow: var(--glow-green);
}

/* Layout */
.bg-white {
    background-color: #050505; /* Dark background to cover scanline */
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

.section {
    padding: 80px 0;
    border-bottom: 1px solid rgba(0, 243, 255, 0.1);
    position: relative; /* Ensure z-index works */
}

/* Hero Section */
.hero {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 60px;
}

.hero-content {
    flex: 1;
    max-width: 650px;
}

.hero-title {
    font-size: 4rem;
    margin-bottom: 1rem;
    border-left: 5px solid var(--primary-color);
    padding-left: 20px;
    text-shadow: var(--glow-cyan);
    background: linear-gradient(90deg, #fff, var(--primary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.4rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
    font-family: var(--font-heading);
    border-left: 1px solid rgba(255,255,255,0.1);
    padding-left: 24px;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

/* Cyberpunk Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 15px 30px;
    font-family: var(--font-heading);
    font-weight: bold;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    position: relative;
    overflow: hidden;
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 243, 255, 0.2), transparent);
    transition: 0.5s;
}

.btn:hover {
    background: rgba(0, 243, 255, 0.1);
    box-shadow: var(--glow-cyan);
    border-color: #fff;
    color: #fff;
    text-shadow: 0 0 5px #fff;
}

.btn:hover::before {
    left: 100%;
}

.btn-read-online {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-read-pdf {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.btn-read-pdf:hover {
    background: rgba(0, 255, 65, 0.1);
    box-shadow: var(--glow-green);
    border-color: #fff;
}

.btn-listen-book {
    border-color: white;
    color: white;
}

/* Hero Image */
.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.book-cover {
    max-width: 500px;
    width: 100%;
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 30px rgba(0, 243, 255, 0.2);
    transition: all 0.5s ease;
    /* Removed filter */
}

.hero-image:hover .book-cover {
    transform: scale(1.05) rotateZ(2deg);
    box-shadow: 0 0 50px rgba(0, 243, 255, 0.5);
}

/* ... (implied context) ... */

/* Cards (Features) */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.feature-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 30px;
    position: relative;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

/* Corner Markers for HUD effect */
.feature-card::after {
    content: '';
    position: absolute;
    top: -1px;
    right: -1px;
    width: 20px;
    height: 20px;
    border-top: 2px solid var(--primary-color);
    border-right: 2px solid var(--primary-color);
    transition: all 0.3s ease;
}

.feature-card::before {
    content: '';
    position: absolute;
    bottom: -1px;
    left: -1px;
    width: 20px;
    height: 20px;
    border-bottom: 2px solid var(--primary-color);
    border-left: 2px solid var(--primary-color);
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.15);
    border-color: var(--primary-color);
}

.feature-card:hover::after,
.feature-card:hover::before {
    width: 100%;
    height: 100%;
    opacity: 0.1;
    background: var(--primary-color);
    z-index: -1;
}

.feature-icon {
    margin-bottom: 20px;
}

.feature-icon svg {
    width: 40px;
    height: 40px;
    stroke: var(--primary-color);
    filter: drop-shadow(0 0 5px var(--primary-color));
}

.feature-card h3 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.feature-card p {
    color: var(--text-muted);
    font-size: 1rem;
}

/* Sections */
.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 60px;
    color: white;
    text-shadow: 0 0 10px rgba(255,255,255,0.5);
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

.section-title::after {
    content: '';
    display: block;
    width: 100%;
    height: 2px;
    background: var(--accent-color);
    margin-top: 10px;
    box-shadow: var(--glow-green);
}

/* Audio Player */
.audio-content-wrapper {
    display: flex;
    align-items: center;
    gap: 40px;
    background: rgba(10, 20, 30, 0.5);
    border: 1px solid var(--card-border);
    padding: 40px;
    border-radius: 4px;
    position: relative;
    backdrop-filter: blur(5px);
}

.audio-description {
    flex: 1;
}

.audio-description h3 {
    color: var(--accent-color);
    margin-bottom: 10px;
}

.audio-player-container {
    flex: 1;
    border: 1px solid var(--card-border);
    padding: 15px;
    background: rgba(0, 0, 0, 0.8);
    min-height: auto;
    border-radius: 4px;
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.1);
}
/* Custom Player Styles */
.custom-player {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

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

.play-btn {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.play-btn:hover {
    background: rgba(0, 243, 255, 0.1);
    box-shadow: var(--glow-cyan);
    color: white;
    border-color: white;
}

.play-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.track-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.track-name {
    font-family: var(--font-heading);
    color: var(--primary-color);
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.progress-container {
    background: rgba(255, 255, 255, 0.1);
    height: 4px;
    width: 100%;
    border-radius: 2px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.progress-bar {
    background: var(--accent-color);
    height: 100%;
    width: 0%;
    box-shadow: var(--glow-green);
    transition: width 0.1s linear;
}

.time-display {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: right;
}

.visualizer {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 30px;
    opacity: 0.7;
    margin-top: 5px;
}

.bar {
    width: 100%;
    background: var(--primary-color);
    height: 5px; /* Default low height */
    transition: height 0.1s ease;
}

/* PDF Viewer */
#read-online {
    position: relative;
    z-index: 200; /* Ensure section is above scanline */
    background-color: #050505; /* Force dark background */
}

.pdf-viewer-container {
    height: 80vh;
    border: 1px solid var(--card-border);
    background: #000;
    position: relative;
    z-index: 201; /* Above scanline */
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}



iframe {
    position: relative;
    z-index: 5;
    background: white; /* Ensure it covers the loading text */
}

/* Footer */
footer {
    padding: 40px 0;
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.1);
    background: #000;
}

footer p {
    color: var(--text-muted);
    font-family: var(--font-heading);
    font-size: 0.9rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 15px; /* Slightly reduce padding on small screens */
    }

    .hero {
        flex-direction: column;
        text-align: center;
        padding-top: 100px;
        min-height: auto; /* Allow natural height */
        padding-bottom: 60px;
    }

    .hero-content {
        max-width: 100%;
        margin-bottom: 40px;
    }

    .hero-title {
        font-size: 2.5rem;
        border-left: none;
        padding-left: 0;
        margin-bottom: 20px;
    }

    .hero-subtitle {
        border-left: none;
        padding-left: 0;
        font-size: 1.1rem;
        margin-bottom: 30px;
    }

    .hero-buttons {
        display: flex !important;
        justify-content: center;
        flex-direction: column !important;
        width: 100%;
        gap: 15px;
    }

    .hero-buttons .btn {
        width: 100%;
        display: flex !important;
    }

    /* Adjust features grid for mobile */
    .features-grid {
        grid-template-columns: 1fr;
    }

    /* Mobile PDF Handling */
    .pdf-viewer-container {
        height: auto !important; /* Allow it to shrink to fit content */
        min-height: 200px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 20px;
    }

    .pdf-viewer-container object,
    .pdf-viewer-container iframe {
        display: none !important; /* Force hide the actual PDF viewer on mobile */
    }

    .mobile-pdf-fallback {
        display: flex !important;
        flex-direction: column;
        width: 100%;
    }
    
    .audio-content-wrapper {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
    
    .feature-card {
        margin-bottom: 0; /* Grid handles gap */
    }
}

/* Base styles for the fallback, hidden by default on desktop */
.mobile-pdf-fallback {
    display: none;
    align-items: center;
    justify-content: center; 
    height: 100%; 
    color: var(--text-muted); 
    text-align: center;
}
