:root {
    --primary: #0078d4;
    --primary-dark: #005a9e;
    --primary-light: #4da6ff;
    --bg-dark: #1e1e1e;
    --bg-medium: #2d2d2d;
    --bg-light: #3a3a3a;
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --border: #404040;
    --success: #4caf50;
    --warning: #ff9800;
    --info: #2196f3;
    --code-bg: #2d2d2d;
    --link-default: #4da6ff;
    --link-visited: #b19cd9;
    --link-hover: #80bfff;
    --link-active: #66d9ff;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Link Styles - Improved for dark mode */
a {
    color: var(--link-default);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:visited {
    color: var(--link-visited);
}

a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

a:active {
    color: var(--link-active);
}

/* Content area links - more prominent */
.card a:not(.btn),
.doc-section a {
    color: var(--link-default);
    font-weight: 500;
    border-bottom: 1px solid transparent;
    padding-bottom: 2px;
}

.card a:not(.btn):hover,
.doc-section a:hover {
    border-bottom-color: var(--link-hover);
    text-decoration: none;
}

.card a:not(.btn):visited,
.doc-section a:visited {
    color: var(--link-visited);
}

/* External link indicator */
a[target="_blank"]::after {
    content: " ↗";
    font-size: 0.85em;
    opacity: 0.7;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

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

header h1 {
    color: white;
    font-size: 2.5em;
    margin-bottom: 0.5rem;
}

header p {
    color: rgba(255,255,255,0.9);
    font-size: 1.2em;
}

nav {
    background: var(--bg-medium);
    padding: 1rem 0;
    border-bottom: 3px solid var(--primary);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation links - special styling */
nav a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
    padding: 0.5rem 1rem;
    border-radius: 4px;
}

nav a:visited {
    color: var(--text-primary);
}

nav a:hover {
    color: white;
    background: var(--primary);
    text-decoration: none;
}

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

.card {
    background: var(--bg-medium);
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    border-left: 4px solid var(--primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.card h2 {
    color: var(--primary);
    margin-bottom: 1rem;
}

.card h3 {
    color: var(--text-primary);
    margin: 1.5rem 0 1rem;
}

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

.grid-item {
    background: var(--bg-medium);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: all 0.3s;
}

.grid-item:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0,120,212,0.2);
}

.grid-item h3 {
    color: var(--primary);
    margin: 0 0 0.5rem 0;
}

/* Grid item links */
.grid-item a {
    color: var(--link-default);
    text-decoration: none;
    font-weight: 500;
}

.grid-item a:visited {
    color: var(--link-visited);
}

.grid-item a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

code {
    background: var(--code-bg);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Consolas', 'Monaco', monospace;
    color: #a8e6cf;
    font-size: 0.9em;
}

pre {
    background: var(--code-bg);
    padding: 1.5rem;
    border-radius: 5px;
    overflow-x: auto;
    margin: 1rem 0;
    border-left: 3px solid var(--primary);
}

pre code {
    background: none;
    padding: 0;
    font-size: 0.95em;
}

/* Button links - special styling */
.btn {
    display: inline-block;
    background: var(--primary);
    color: white !important;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    border-radius: 5px;
    margin: 0.5rem 0.5rem 0.5rem 0;
    transition: all 0.3s;
    font-weight: 500;
    border: 2px solid var(--primary);
}

.btn:visited {
    color: white !important;
}

.btn:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,120,212,0.3);
}

.btn:active {
    transform: translateY(0);
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-size: 0.85em;
    font-weight: 500;
    margin-right: 0.5rem;
}

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

ul, ol {
    margin: 1rem 0 1rem 2rem;
}

li {
    margin: 0.5rem 0;
}

/* Command documentation specific styles */
.command-header {
    border-left: 4px solid #667eea;
}

.command-header h1 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 2em;
}

.command-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

/* Command nav links */
.command-nav a {
    background: var(--bg-light);
    color: var(--text-primary) !important;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9em;
    transition: all 0.3s;
    border: 1px solid var(--border);
}

.command-nav a:visited {
    color: var(--text-primary) !important;
}

.command-nav a:hover {
    background: var(--primary);
    color: white !important;
    border-color: var(--primary);
    text-decoration: none;
}

.command-content {
    border-left: 4px solid var(--info);
}

.doc-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--bg-light);
    border-radius: 8px;
}

.doc-section h2 {
    color: var(--primary);
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
}

.doc-section.synopsis {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-left: 4px solid #667eea;
}

.doc-section.description {
    border-left: 4px solid var(--info);
}

.doc-section.examples {
    border-left: 4px solid var(--success);
}

.doc-section.parameters {
    border-left: 4px solid var(--warning);
}

.doc-section.notes {
    border-left: 4px solid var(--info);
}

.param-block {
    background: var(--code-bg);
    padding: 1rem;
    border-radius: 4px;
    margin: 1rem 0;
    border-left: 3px solid var(--warning);
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.85em;
}

.param-block code {
    background: none;
    padding: 0;
    color: var(--text-secondary);
}

.command-card {
    border-left: 3px solid var(--primary);
}

.command-card:hover {
    border-left-color: #667eea;
}

.command-content h3 {
    color: var(--primary);
    margin: 1.5rem 0 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.command-content h4 {
    color: var(--text-primary);
    margin: 1rem 0 0.5rem;
}

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

.doc-section ul li {
    padding-left: 1.5rem;
    position: relative;
    margin: 0.5rem 0;
}

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

.doc-section.examples pre {
    background: #1a1a1a;
    border-left-color: var(--success);
}

/* Smooth scrolling for anchor links */
html {
    scroll-behavior: smooth;
}

/* Highlight target section when navigated to */
.doc-section:target {
    animation: highlight 2s ease-in-out;
}

@keyframes highlight {
    0% {
        background: rgba(102, 126, 234, 0.3);
        box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.3);
    }
    100% {
        background: var(--bg-light);
        box-shadow: none;
    }
}

footer {
    text-align: center;
    padding: 3rem 0;
    margin-top: 4rem;
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
}

footer a {
    color: var(--link-default);
}

footer a:visited {
    color: var(--link-visited);
}

footer a:hover {
    color: var(--link-hover);
}

/* Focus styles for accessibility */
a:focus,
button:focus {
    outline: 2px solid var(--primary-light);
    outline-offset: 2px;
}

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

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

@media (max-width: 768px) {
    header h1 { font-size: 2em; }
    header p { font-size: 1em; }
    nav ul { flex-direction: column; gap: 0.5rem; }
    .grid { grid-template-columns: 1fr; }
    .command-nav { flex-direction: column; }
}
