/* Global Styles */
:root {
    --primary-color: #f46800;
    --secondary-color: #2c3e50;
    --accent-color: #3498db;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --light-bg: #f8f9fa;
    --dark-bg: #1a1a1a;
    --text-primary: #333;
    --text-secondary: #666;
    --border-color: #e0e0e0;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 5px 20px rgba(0, 0, 0, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: #fff;
}

/* Header and Navigation */
.header {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #34495e 100%);
    color: white;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* allow absolutely-positioned dropdowns to overflow without creating clipping */
    overflow: visible;
    position: relative; /* for fade overlay */
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: bold;
    white-space: nowrap; /* prevent logo wrapping */
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 1rem; /* slightly smaller gap for compactness */
    align-items: center;
    flex-wrap: nowrap; /* prevent wrapping */
    overflow-x: auto; /* allow horizontal scroll when necessary */
    overflow-y: hidden; /* ensure no vertical scrollbar */
    -webkit-overflow-scrolling: touch;
    /* hide scrollbars in Firefox/IE */
    -ms-overflow-style: none; /* IE/Edge */
    scrollbar-width: none; /* Firefox */
    flex: 1 1 auto;
    justify-content: flex-end; /* push links to the right */
}

.nav-links::-webkit-scrollbar { height: 6px; width: 0px; }
.nav-links::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 4px; }

.nav-links li { flex: 0 0 auto; }

.nav-links a {
    color: white;
    text-decoration: none;
    transition: color 0.3s;
    font-weight: 500;
    white-space: nowrap; /* prevent breaks inside link text */
    font-size: 0.92rem; /* slightly smaller for compact layout */
    padding: 0.25rem 0.35rem;
}

/* subtle gradient fade on the right edge of the nav when there is overflow */
.nav::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 60px;
    pointer-events: none;
    background: linear-gradient(90deg, rgba(52,73,94,0) 0%, rgba(52,73,94,0.95) 100%);
}

@media (max-width: 1100px) {
    .nav { padding: 0 1rem; }
    .logo { font-size: 1.25rem; }
    .nav-links { gap: 0.7rem; }
    .nav-links a { font-size: 0.88rem; }
}

@media (max-width: 768px) {
    .nav { flex-direction: column; gap: 0.5rem; }
    .nav-links { width: 100%; justify-content: center; }
    .nav::after { display: none; }
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 6rem 2rem;
    text-align: center;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.tagline {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    opacity: 0.95;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 0.8rem 2rem;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #d55a00;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(244, 104, 0, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid white;
}

.btn-secondary:hover {
    background: white;
    color: var(--secondary-color);
    transform: translateY(-2px);
}

/* Sections */
.section {
    padding: 5rem 2rem;
}

.section-alt {
    background: var(--light-bg);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

.lead {
    text-align: center;
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

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

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
    text-align: center;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.feature-card i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.feature-card h3 {
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

/* Architecture Diagram */
.architecture-diagram {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin: 2rem 0;
}

.arch-layer {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--light-bg);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.arch-layer h3 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.arch-components {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.arch-component {
    background: white;
    padding: 0.8rem 1.5rem;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    font-weight: 500;
    color: var(--text-primary);
}

.arch-details {
    margin-top: 2rem;
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.arch-details h3 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.arch-details ul {
    list-style: none;
    padding-left: 0;
}

.arch-details li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.arch-details li::before {
    content: "▸";
    position: absolute;
    left: 0;
    color: var(--primary-color);
}

.arch-details strong {
    color: var(--secondary-color);
}

/* Results Table */
.results-table-container {
    overflow-x: auto;
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.results-table {
    width: 100%;
    border-collapse: collapse;
}

.results-table thead {
    background: var(--secondary-color);
    color: white;
}

.results-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
}

.results-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.results-table tbody tr:hover {
    background: var(--light-bg);
}

.results-table .highlight {
    background: rgba(244, 104, 0, 0.1);
}

.badge {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-block;
}

.badge-gold {
    background: #ffd700;
    color: #333;
}

.badge-silver {
    background: #c0c0c0;
    color: #333;
}

.badge-bronze {
    background: #cd7f32;
    color: white;
}

.badge-good {
    background: var(--success-color);
    color: white;
}

/* Results Insights */
.results-insights {
    margin-top: 2rem;
}

.insight-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.insight-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    box-shadow: var(--shadow);
}

.insight-card h4 {
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

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

.skill-category {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
    transition: transform 0.3s;
}

.skill-category:hover {
    transform: translateY(-5px);
}

.skill-category h3 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.skill-category i {
    color: var(--primary-color);
}

.skill-category ul {
    list-style: none;
    padding-left: 0;
}

.skill-category li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: var(--text-secondary);
}

.skill-category li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--success-color);
    font-weight: bold;
}

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

.tool-category {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.tool-category h3 {
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
    text-align: center;
}

.tools-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tool-item {
    padding: 1rem;
    background: var(--light-bg);
    border-radius: 5px;
    text-align: center;
}

.tool-item img {
    margin-bottom: 0.5rem;
}

.tool-item p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

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

.practice-card {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.practice-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.practice-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.practice-card h3 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.practice-card p {
    color: var(--text-secondary);
}

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

.resource-category {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.resource-category h3 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.resource-list {
    list-style: none;
    padding-left: 0;
}

.resource-list li {
    margin-bottom: 0.8rem;
}

.resource-list a {
    color: var(--accent-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.3s;
}

.resource-list a:hover {
    color: var(--primary-color);
}

.resource-list i {
    font-size: 1.2rem;
}

/* Getting Started */
.getting-started {
    margin-top: 2rem;
}

.step {
    display: flex;
    gap: 2rem;
    margin-bottom: 3rem;
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.step-number {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
}

.step-content {
    flex: 1;
}

.step-content h3 {
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.step-content p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.step-content pre {
    background: var(--dark-bg);
    color: #f8f8f2;
    padding: 1rem;
    border-radius: 5px;
    overflow-x: auto;
}

.step-content code {
    font-family: 'Courier New', monospace;
}

/* Footer */
.footer {
    background: var(--secondary-color);
    color: white;
    padding: 3rem 2rem 1rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.footer-section ul {
    list-style: none;
    padding-left: 0;
}

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

.footer-section a {
    color: white;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .tagline {
        font-size: 1.1rem;
    }
    
    .nav {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }
    
    .features-grid,
    .skills-grid,
    .tools-grid,
    .practices-grid,
    .resources-grid {
        grid-template-columns: 1fr;
    }
    
    .step {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .section {
        padding: 3rem 1rem;
    }
}

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

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section {
    animation: fadeIn 0.6s ease-in-out;
}

/* Documentation Content Styles */
.doc-content {
    padding: 4rem 2rem;
    background: white;
}

.doc-content h1 {
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

.doc-content h2 {
    font-size: 2rem;
    color: var(--secondary-color);
    margin-top: 2rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

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

.doc-content h4 {
    font-size: 1.25rem;
    color: var(--secondary-color);
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.doc-content p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

.doc-content ul, .doc-content ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.doc-content li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.doc-content code {
    background: var(--light-bg);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #d73a49;
}

.doc-content pre {
    background: var(--dark-bg);
    color: #f8f8f2;
    padding: 1rem;
    border-radius: 5px;
    overflow-x: auto;
    margin-bottom: 1rem;
}

.doc-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.doc-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
    margin: 1rem 0;
    color: var(--text-secondary);
    font-style: italic;
}

.doc-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    background: white;
    box-shadow: var(--shadow);
}

.doc-content table th {
    background: var(--secondary-color);
    color: white;
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
}

.doc-content table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.doc-content table tr:hover {
    background: var(--light-bg);
}

.doc-content a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.3s;
}

.doc-content a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.doc-content hr {
    border: none;
    border-top: 2px solid var(--border-color);
    margin: 2rem 0;
}

.doc-content img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    box-shadow: var(--shadow);
    margin: 1rem 0;
}

/* Table of Contents */
.doc-content nav[role="navigation"] {
    background: var(--light-bg);
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 2rem;
}

.doc-content nav[role="navigation"] ul {
    list-style: none;
    padding-left: 1rem;
}

.doc-content nav[role="navigation"] li {
    margin-bottom: 0.25rem;
}

/* More dropdown styling */
.nav-more {
    position: relative;
    flex: 0 0 auto;
}

.more-btn {
    background: transparent;
    border: none;
    color: white;
    font-weight: 600;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    white-space: nowrap;
}

.more-btn:focus {
    outline: 2px solid rgba(244, 104, 0, 0.3);
    outline-offset: 2px;
}

.nav-more .dropdown-menu {
    display: none; /* shown via inline style toggle from script */
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 180px;
    background: white;
    color: var(--text-primary);
    border-radius: 6px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    list-style: none;
    padding: 0.4rem 0;
    z-index: 1200;
}

.nav-more .dropdown-menu li {
    padding: 0;
    margin: 0;
}

.nav-more .dropdown-menu li a {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
}

.nav-more .dropdown-menu li a:hover {
    background: var(--light-bg);
    color: var(--primary-color);
}

/* ensure dropdown items don't inherit nav link color */
.nav-more .dropdown-menu li a .fab { color: inherit; }
