/* ========================================
   JAVDEV BIBLE - MAIN STYLES
   ======================================== */

/* CSS Variables for consistent theming */
:root {
    --primary-color: #0A4D68;
    --secondary-color: #088395;
    --accent-color: #05BFDB;
    --light-accent: #00FFCA;
    --dark-bg: #0A1929;
    --text-light: #FFFFFF;
    --text-gray: #B0BEC5;
    --card-bg: #FFFFFF;
    --shadow-light: rgba(0, 0, 0, 0.1);
    --shadow-medium: rgba(0, 0, 0, 0.2);
    --code-bg: #1E1E1E;
    --code-text: #D4D4D4;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #F5F7FA;
}

/* Hero Section */
.hero-section {
    position: relative;
    min-height: 60vh;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 50%, var(--accent-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    overflow: visible;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 25, 41, 0.3);
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 900px;
    width: 100%;
}

.main-title {
    font-size: 5.5rem;
    color: var(--text-light);
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    font-weight: 700;
}

.subtitle {
    font-size: 1.4rem;
    color: var(--light-accent);
    margin-bottom: 2.5rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* Search Container */
.search-container {
    display: flex;
    gap: 1rem;
    max-width: 700px;
    margin: 0 auto;
    padding: 0 1rem;
}

#searchInput {
    flex: 1;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    border: 3px solid var(--light-accent);
    border-radius: 50px;
    outline: none;
    background: rgba(255, 255, 255, 0.95);
    transition: all 0.3s ease;
}

#searchInput:focus {
    background: white;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.search-btn {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    background: var(--light-accent);
    color: var(--dark-bg);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-btn:hover {
    background: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

/* Search Results */
.search-results {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 700px;
    max-height: 400px;
    overflow-y: auto;
    background: white;
    border-radius: 12px;
    margin-top: 1rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

.search-result-item {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #E0E0E0;
    cursor: pointer;
    transition: background 0.2s ease;
}

.search-result-item:hover {
    background: #F5F5F5;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-title {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.3rem;
}

.search-result-category {
    font-size: 0.85rem;
    color: var(--secondary-color);
    margin-bottom: 0.3rem;
}

.search-result-excerpt {
    font-size: 0.9rem;
    color: #666;
}

.no-results {
    padding: 2rem;
    text-align: center;
    color: #666;
}

/* Content Wrapper */
.content-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.intro-section {
    text-align: center;
    margin-bottom: 3rem;
}

.intro-section h2 {
    font-size: 2.2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.intro-section p {
    font-size: 1.1rem;
    color: #555;
    max-width: 800px;
    margin: 0 auto;
}

/* Category Grid */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.category-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 15px var(--shadow-light);
    transition: all 0.3s ease;
    border-left: 4px solid var(--accent-color);
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px var(--shadow-medium);
}

.category-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.category-card h3 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.category-card p {
    color: #666;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.topic-list {
    list-style: none;
    padding: 0;
}

.topic-list li {
    margin-bottom: 0.6rem;
}

.topic-list a {
    color: var(--secondary-color);
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    display: inline-block;
    padding: 0.3rem 0;
}

.topic-list a:hover {
    color: var(--accent-color);
    transform: translateX(5px);
    font-weight: 600;
}

.topic-list a::before {
    content: '▸ ';
    color: var(--accent-color);
    font-weight: bold;
}

/* Footer */
.site-footer {
    background: var(--dark-bg);
    color: var(--text-gray);
    text-align: center;
    padding: 2rem;
    margin-top: 4rem;
}

.site-footer p {
    margin: 0.5rem 0;
}

/* ========================================
   TOPIC PAGE STYLES
   ======================================== */

.topic-page {
    background: #F5F7FA;
    min-height: 100vh;
}

/* Topic Header */
.topic-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 2rem 0;
    box-shadow: 0 4px 15px var(--shadow-medium);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.breadcrumb {
    font-size: 0.9rem;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.breadcrumb a {
    color: var(--light-accent);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.topic-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.topic-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

.back-btn {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.6rem 1.5rem;
    background: var(--light-accent);
    color: var(--dark-bg);
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.back-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* Topic Content */
.topic-content {
    max-width: 1200px;
    margin: 3rem auto;
    padding: 0 2rem;
}

.content-section {
    background: white;
    border-radius: 12px;
    padding: 2.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px var(--shadow-light);
}

.content-section h2 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin-bottom: 1rem;
    border-bottom: 3px solid var(--accent-color);
    padding-bottom: 0.5rem;
}

.content-section h3 {
    color: var(--secondary-color);
    font-size: 1.4rem;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.content-section p {
    margin-bottom: 1rem;
    line-height: 1.8;
    color: #444;
}

.content-section ul, .content-section ol {
    margin: 1rem 0 1rem 2rem;
    line-height: 1.8;
}

.content-section li {
    margin-bottom: 0.5rem;
}

/* Code Blocks */
pre {
    background: var(--code-bg);
    color: var(--code-text);
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
    border-left: 4px solid var(--accent-color);
}

code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
}

.inline-code {
    background: #E8EAF6;
    color: #1565C0;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9em;
}

/* Info Boxes */
.info-box {
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
    border-left: 4px solid;
}

.info-box.note {
    background: #E3F2FD;
    border-color: #2196F3;
}

.info-box.warning {
    background: #FFF3E0;
    border-color: #FF9800;
}

.info-box.tip {
    background: #E8F5E9;
    border-color: #4CAF50;
}

.info-box.important {
    background: #FCE4EC;
    border-color: #E91E63;
}

.info-box-title {
    font-weight: 700;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

/* Related Topics */
.related-topics {
    background: #F5F7FA;
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 2rem;
}

.related-topics h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.related-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.related-link {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    background: var(--secondary-color);
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.related-link:hover {
    background: var(--accent-color);
    transform: translateY(-2px);
}

/* Collapsible Sections */
.collapsible {
    background: #F5F7FA;
    cursor: pointer;
    padding: 1rem 1.5rem;
    border: none;
    text-align: left;
    width: 100%;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
    border-radius: 8px;
    margin-top: 1rem;
    transition: background 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.collapsible:hover {
    background: #E8EAF6;
}

.collapsible::after {
    content: '▼';
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.collapsible.active::after {
    transform: rotate(180deg);
}

.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding: 0 1.5rem;
}

.collapsible-content.active {
    padding: 1.5rem;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

th {
    background: var(--primary-color);
    color: white;
    padding: 1rem;
    text-align: left;
}

td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid #E0E0E0;
}

tr:nth-child(even) {
    background: #F5F5F5;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-title {
        font-size: 2.5rem;
    }

    .subtitle {
        font-size: 1.1rem;
    }

    .search-container {
        flex-direction: column;
    }

    .category-grid {
        grid-template-columns: 1fr;
    }

    .topic-header h1 {
        font-size: 2rem;
    }

    .content-section {
        padding: 1.5rem;
    }

    .related-links {
        flex-direction: column;
    }

    pre {
        padding: 1rem;
        font-size: 0.8rem;
    }
}

/* Print Styles */
@media print {
    .hero-section,
    .search-container,
    .site-footer,
    .back-btn,
    .related-topics {
        display: none;
    }

    .content-section {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    body {
        background: white;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection Color */
::selection {
    background: var(--accent-color);
    color: white;
}

::-moz-selection {
    background: var(--accent-color);
    color: white;
}
