/* GPULang Documentation Styles */

/* Custom scrollbar styling - Site-wide */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, #c084fc, #f472b6);
    border-radius: 4px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, #a855f7, #ec4899);
}

/* Firefox scrollbar styling */
html {
    scrollbar-width: thin;
    scrollbar-color: #c084fc rgba(255, 255, 255, 0.05);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: 
    
        repeating-linear-gradient(
            135deg,
            #141431 0px,
            #111a2c 300px,
            #121b39 600px,
            #111a2c 900px,
            #141431 1200px
        );
    color: #ffffff;
    line-height: 1.6;
    overflow-x: hidden;
}

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

/* Header */
header {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(15, 15, 35, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    background: linear-gradient(45deg, #c084fc, #f472b6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: #ffffff;
    text-decoration: none;
    transition: color 0.3s ease;
    font-weight: 500;
}

.nav-links a:hover {
    color: #c084fc;
}

.cta-button {
    background: linear-gradient(45deg, #c084fc, #f472b6);
    color: #0f0f23;
    padding: calc(0.8rem) calc(1.5rem);
    border: none;
    border-radius: 50px;
    font-weight: bold;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.download-button {
    background: transparent;
    color: #ffffff;
    padding: calc(0.8rem - 2px) calc(1.5rem - 2px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    font-weight: bold;
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(192, 132, 252, 0.3);
}

.download-button:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #c084fc;
    transform: translateY(-2px);
}

.header-buttons {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Ensure consistent button sizing in header */
.header-buttons .cta-button .download-button {
    padding: calc(0.8rem + 2px) calc(1.5rem + 2px);
}

/* Typography */
.page-title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: bold;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, #ffffff, #c084fc, #f472b6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-subtitle {
    font-size: 1.3rem;
    color: #b0b0b0;
    max-width: 600px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-size: 3rem;
    margin-bottom: 3rem;
    background: linear-gradient(45deg, #ffffff, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Cards and Components */
.feature-card, .doc-card, .intrinsic-card {
    background: rgba(0, 0, 0, 0.3);
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    /*backdrop-filter: blur(10px);*/
    overflow: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.intrinsic-card {
    /* Ensure intrinsic cards handle overflow properly */
    min-width: 0; /* Allow flex items to shrink */
    max-width: 100%;
    padding: 1rem; /* Reduced from default 2rem */
}

.feature-card:hover, .doc-card:hover, .intrinsic-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 50px rgba(192, 132, 252, 0.2);
    border-color: rgba(192, 132, 252, 0.3);
}

.doc-card {
    text-decoration: none;
    color: inherit;
    display: block;
    padding: 2.5rem;
}

.doc-card:hover {
    transform: translateY(-10px);
    text-decoration: none;
    color: inherit;
}

/* Best Practices Box */
.best-practice {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 2rem 0 0.5rem 0;
}

.best-practice-title {
    color: #22c55e;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.best-practice-content {
    color: #b0b0b0;
    line-height: 1.6;
}

.feature-icon, .doc-icon {
    font-size: 3rem;
    color: #c084fc;
    margin-bottom: 1rem;
}

.doc-icon {
    margin-bottom: 1.5rem;
    display: block;
}

.feature-card h3, .doc-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #ffffff;
}

.doc-card h3 {
    font-size: 1.8rem;
}

.feature-card p, .doc-card p {
    color: #b0b0b0;
    line-height: 1.6;
}

.doc-card p {
    margin-bottom: 1.5rem;
}

/* Code Styling */
.code-container {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 2rem;
}

.code-header {
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.code-dots {
    display: flex;
    gap: 0.5rem;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot.red { background: #ff5f57; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #28ca42; }

pre {
    margin: 0;
    padding: 2rem;
    overflow-x: auto;
    background: transparent !important;
}

code {
    font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', Consolas, monospace;
    font-size: 0.9rem;
}

/* Intrinsic card specific code styling */
.intrinsic-card pre {
    overflow-x: auto;
    max-width: 100%;
    white-space: pre-wrap;
    word-wrap: break-word;
    padding: 1rem; /* Reduced from default 2rem */
    margin: 0.5rem 0; /* Reduced margin */
}

.intrinsic-card code {
    font-size: 0.85rem;
    line-height: 1.4;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Custom syntax highlighting colors for GPULang */
.token.keyword {
    color: #c678dd;
    font-weight: bold;
}

.token.builtin,
.token.type {
    color: #e06c75;
}

.token.function,
.token.builtin-function {
    color: #61afef;
}

.token.class-name,
.token.builtin-variable {
    color: #e5c07b;
}

.token.constant,
.token.builtin-constant {
    color: #d19a66;
}

.token.string {
    color: #98c379;
}

.token.comment {
    color: #a855f7;
    font-style: italic;
    opacity: 0.8;
}

.token.number {
    color: #d19a66;
}

.token.operator {
    color: #56b6c2;
}

.token.punctuation {
    color: #abb2bf;
}

.token.annotation,
.token.important {
    color: #f472b6;
    font-weight: bold;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(45deg, #c084fc, #f472b6);
    color: #0f0f23;
    padding: 1rem 2rem;
    border: none;
    border-radius: 50px;
    font-weight: bold;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1.1rem;
}

.btn-secondary {
    background: transparent;
    color: #ffffff;
    padding: 1rem 2rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    font-weight: bold;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1.1rem;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(192, 132, 252, 0.4);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #c084fc;
}

/* Utilities */
.loading {
    text-align: center;
    padding: 4rem 0;
    color: #b0b0b0;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(192, 132, 252, 0.3);
    border-top: 3px solid #c084fc;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error {
    text-align: center;
    padding: 4rem 0;
    color: #ff5f57;
}

.no-results {
    text-align: center;
    padding: 4rem 0;
    color: #b0b0b0;
}

/* Responsive */
@media (max-width: 900px) {
    .nav-links {
        display: none;
    }
}

@media (max-width: 768px) {
    .header-buttons {
        gap: 0.5rem;
    }
    
    .download-button span,
    .cta-button span {
        display: none;
    }
    
    .download-button, .cta-button {
        padding: 0.6rem;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .download-button {
        margin-right: 0.5rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-primary, .btn-secondary {
        width: 200px;
        text-align: center;
    }
}

/* Table wrapper for horizontal scrolling - shared across all pages */
.table-wrapper {
    overflow-x: auto;
    margin: 2rem 0;
    border-radius: 12px;
}

/* Syntax tables - shared across documentation pages */
.syntax-table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    overflow: hidden;
    font-size: 0.9rem;
}

.syntax-table th,
.syntax-table td {
    padding: 0.8rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    vertical-align: top;
}

.syntax-table th {
    background: rgba(192, 132, 252, 0.2);
    color: #c084fc;
    font-weight: 600;
    font-size: 0.9rem;
}

.syntax-table td {
    color: #b0b0b0;
    font-size: 0.85rem;
}

.syntax-table td code {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    color: #ffffff;
    font-size: 0.8rem;
}

/* Responsive table styling */
@media (max-width: 768px) {
    .syntax-table {
        font-size: 0.8rem;
    }
    
    .syntax-table th,
    .syntax-table td {
        padding: 0.6rem;
    }
    
    .syntax-table th {
        font-size: 0.8rem;
    }
    
    .syntax-table td {
        font-size: 0.75rem;
    }
    
    .syntax-table td code {
        font-size: 0.7rem;
        padding: 0.15rem 0.3rem;
    }
}

@media (max-width: 480px) {
    .syntax-table {
        font-size: 0.75rem;
    }
    
    .syntax-table th,
    .syntax-table td {
        padding: 0.5rem;
    }
}

/* Content Navigation - shared across documentation pages */
.content-nav {
    position: fixed;
    right: 20px;
    top: 30%;
    transform: translateY(-50%);
    background: rgba(15, 15, 35, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem;
    max-width: 200px;
    backdrop-filter: blur(10px);
    z-index: 100;
}

.content-nav h4 {
    color: #c084fc;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.content-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.content-nav li {
    margin-bottom: 0.3rem;
}

.content-nav a {
    color: #b0b0b0;
    text-decoration: none;
    font-size: 0.8rem;
    transition: color 0.3s ease;
}

.content-nav a:hover {
    color: #c084fc;
}

/* Hide content navigation on smaller screens */
@media (max-width: 1200px) {
    .content-nav {
        display: none;
    }
}

/* Content Links */
a:not(.logo):not(.nav-links a):not(.cta-button):not(.download-button):not(.btn-primary):not(.btn-secondary):not(.quick-link):not(.toc-link):not(.content-nav a):not(.download-button-primary):not(.download-button-secondary) {
    color: #c084fc;
    text-decoration: none;
    position: relative;
    transition: all 0.3s ease;
    font-weight: 500;
}

a:not(.logo):not(.nav-links a):not(.cta-button):not(.download-button):not(.btn-primary):not(.btn-secondary):not(.quick-link):not(.toc-link):not(.content-nav a):not(.download-button-primary):not(.download-button-secondary):hover {
    color: #f472b6;
    text-shadow: 0 0 8px rgba(244, 114, 182, 0.3);
}

a:not(.logo):not(.nav-links a):not(.cta-button):not(.download-button):not(.btn-primary):not(.btn-secondary):not(.quick-link):not(.toc-link):not(.content-nav a):not(.download-button-primary):not(.download-button-secondary)::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(45deg, #c084fc, #f472b6);
    transition: width 0.3s ease;
}

a:not(.logo):not(.nav-links a):not(.cta-button):not(.download-button):not(.btn-primary):not(.btn-secondary):not(.quick-link):not(.toc-link):not(.content-nav a):not(.download-button-primary):not(.download-button-secondary):hover::after {
    width: 100%;
}

/* External link icon */
a[target="_blank"]:not(.logo):not(.nav-links a):not(.cta-button):not(.download-button):not(.btn-primary):not(.btn-secondary):not(.quick-link):not(.toc-link):not(.content-nav a):not(.download-button-primary):not(.download-button-secondary)::before {
    content: '\f35d';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.8em;
    margin-right: 0.3em;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

a[target="_blank"]:not(.logo):not(.nav-links a):not(.cta-button):not(.download-button):not(.btn-primary):not(.btn-secondary):not(.quick-link):not(.toc-link):not(.content-nav a):not(.download-button-primary):not(.download-button-secondary):hover::before {
    opacity: 1;
}

/* Status Badge */
.status-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;

}

.status-wip {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

/* Very small screens */
@media (max-width: 480px) {
    .download-button,
    .cta-button {
        padding: 0.5rem;
        min-width: 40px;
    }
}
