/* CSS Custom Properties for theming */
:root {
    /* Light theme colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #f6f8fa;
    --text-primary: #24292f;
    --text-secondary: #656d76;
    --text-tertiary: #8b949e;
    --border-primary: #d0d7de;
    --border-secondary: #e1e4e8;
    --accent-primary: #0969da;
    --accent-secondary: #0550ae;
    --accent-tertiary: #218bff;
    --gradient-start: #0066cc;
    --gradient-end: #0080ff;
    --shadow-light: rgba(31, 35, 40, 0.04);
    --shadow-medium: rgba(31, 35, 40, 0.15);
    --shadow-heavy: rgba(31, 35, 40, 0.25);
    --nav-bg: rgba(255, 255, 255, 0.95);
    --footer-bg: #24292f;
}

/* Dark theme colors */
[data-theme="dark"] {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --text-primary: #f0f6fc;
    --text-secondary: #7d8590;
    --text-tertiary: #656d76;
    --border-primary: #30363d;
    --border-secondary: #21262d;
    --accent-primary: #58a6ff;
    --accent-secondary: #1f6feb;
    --accent-tertiary: #79c0ff;
    --gradient-start: #1f6feb;
    --gradient-end: #58a6ff;
    --shadow-light: rgba(1, 4, 9, 0.15);
    --shadow-medium: rgba(1, 4, 9, 0.3);
    --shadow-heavy: rgba(1, 4, 9, 0.45);
    --nav-bg: rgba(13, 17, 23, 0.95);
    --footer-bg: #010409;
}

/* Auto dark mode based on system preference */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg-primary: #0d1117;
        --bg-secondary: #161b22;
        --bg-tertiary: #21262d;
        --text-primary: #f0f6fc;
        --text-secondary: #7d8590;
        --text-tertiary: #656d76;
        --border-primary: #30363d;
        --border-secondary: #21262d;
        --accent-primary: #58a6ff;
        --accent-secondary: #1f6feb;
        --accent-tertiary: #79c0ff;
        --gradient-start: #1f6feb;
        --gradient-end: #58a6ff;
        --shadow-light: rgba(1, 4, 9, 0.15);
        --shadow-medium: rgba(1, 4, 9, 0.3);
        --shadow-heavy: rgba(1, 4, 9, 0.45);
        --nav-bg: rgba(13, 17, 23, 0.95);
        --footer-bg: #010409;
    }
}

/* Reset and base styles */
* {
    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-color: var(--bg-secondary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

/* Header */
header {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: white;
    padding: 3rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.1) 50%, transparent 100%);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { transform: translateX(-100%); }
    50% { transform: translateX(100%); }
}

header h1 {
    font-size: 3.5rem;
    margin-bottom: 0.75rem;
    font-weight: 800;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    opacity: 0.95;
    position: relative;
    z-index: 1;
    font-weight: 400;
    color: white;
}

.badges {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.badges img {
    height: 22px;
    border-radius: 4px;
    transition: transform 0.2s ease;
}

.badges img:hover {
    transform: scale(1.05);
}

/* Navigation */
nav {
    background-color: var(--nav-bg);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px var(--shadow-light);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-primary);
}

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

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem 0;
}

nav a {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    display: inline-block;
}

nav a:hover {
    background-color: var(--accent-primary);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--shadow-medium);
}

/* Dark mode toggle */
.theme-toggle {
    background: none;
    border: 2px solid var(--border-primary);
    border-radius: 50px;
    padding: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    transition: all 0.3s ease;
    color: var(--text-primary);
    font-size: 1.2rem;
}

.theme-toggle:hover {
    border-color: var(--accent-primary);
    background-color: var(--accent-primary);
    color: white;
    transform: rotate(180deg);
}

/* Main content */
main {
    padding: 4rem 0;
}

section {
    margin-bottom: 5rem;
}

h2 {
    font-size: 2.75rem;
    margin-bottom: 2rem;
    color: var(--accent-primary);
    text-align: center;
    font-weight: 700;
    position: relative;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
    border-radius: 2px;
}

h3 {
    font-size: 1.6rem;
    margin-bottom: 1.25rem;
    color: var(--text-primary);
    font-weight: 600;
}

p {
    margin-bottom: 1.25rem;
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

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

.feature-card {
    background: var(--bg-primary);
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px var(--shadow-light);
    transition: all 0.4s ease;
    border: 1px solid var(--border-primary);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.feature-card:hover::before {
    transform: scaleX(1);
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px var(--shadow-medium);
    border-color: var(--accent-primary);
}

.feature-card h3 {
    color: var(--accent-primary);
    margin-bottom: 1.25rem;
    font-size: 1.4rem;
}

.feature-card p {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Installation methods */
.install-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 2.5rem;
    margin-top: 3rem;
}

.install-card {
    background: var(--bg-primary);
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px var(--shadow-light);
    border: 1px solid var(--border-primary);
    transition: all 0.3s ease;
}

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

.install-card.featured {
    background: linear-gradient(135deg, #e3f2fd, #f3e5f5);
    border: 2px solid #0066cc;
    box-shadow: 0 8px 16px rgba(0,102,204,0.2);
}

.install-card h3 {
    color: var(--accent-primary);
    margin-bottom: 1.25rem;
    font-size: 1.4rem;
}

.install-card.featured h3 {
    color: #0066cc;
    font-weight: 700;
}

.install-card ul {
    margin: 1.25rem 0;
    padding-left: 2.5rem;
}

.install-card li {
    margin-bottom: 1rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

/* Usage steps */
.usage-steps {
    display: grid;
    gap: 2.5rem;
    margin-top: 3rem;
}

.step {
    background: var(--bg-primary);
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px var(--shadow-light);
    border-left: 6px solid var(--accent-primary);
    border: 1px solid var(--border-primary);
    transition: all 0.3s ease;
    position: relative;
}

.step:hover {
    transform: translateX(8px);
    box-shadow: 0 8px 30px var(--shadow-medium);
}

.step h3 {
    color: var(--accent-primary);
    margin-bottom: 1.25rem;
    font-size: 1.4rem;
}

/* Code blocks */
pre {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    border-radius: 12px;
    padding: 1.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    position: relative;
    box-shadow: 0 2px 10px var(--shadow-light);
}

pre::before {
    content: '';
    position: absolute;
    top: 12px;
    left: 12px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ff5f56;
    box-shadow: 20px 0 #ffbd2e, 40px 0 #27ca3f;
}

code {
    font-family: 'Fira Code', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    border: 1px solid var(--border-secondary);
    font-weight: 500;
}

pre code {
    background: none;
    border: none;
    padding: 0;
    color: var(--text-primary);
}

/* Buttons */
.button {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-tertiary));
    color: white;
    text-decoration: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--shadow-medium);
    position: relative;
    overflow: hidden;
}

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

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

.button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px var(--shadow-heavy);
}

/* Documentation links */
.doc-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
    margin-top: 3rem;
}

.doc-link {
    background: var(--bg-primary);
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px var(--shadow-light);
    text-decoration: none;
    color: inherit;
    transition: all 0.4s ease;
    display: block;
    border: 1px solid var(--border-primary);
    position: relative;
    overflow: hidden;
}

.doc-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.doc-link:hover::before {
    transform: scaleX(1);
}

.doc-link:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px var(--shadow-medium);
    border-color: var(--accent-primary);
}

.doc-link h3 {
    color: var(--accent-primary);
    margin-bottom: 0.75rem;
    font-size: 1.4rem;
}

.doc-link p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Footer */
footer {
    background-color: var(--footer-bg);
    color: white;
    text-align: center;
    padding: 3rem 0;
    margin-top: 6rem;
    border-top: 1px solid var(--border-primary);
}

footer a {
    color: var(--accent-tertiary);
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: white;
    text-decoration: underline;
}

/* Responsive design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1.1rem;
    }
    
    nav .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    nav ul {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
    
    .feature-grid,
    .install-methods,
    .doc-links {
        grid-template-columns: 1fr;
    }
    
    .container {
        padding: 0 15px;
    }

    .feature-card,
    .install-card,
    .doc-link,
    .step {
        padding: 1.5rem;
    }

    h2 {
        font-size: 2.25rem;
    }
}

/* Table styles for user guide */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: var(--bg-primary);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px var(--shadow-light);
    border: 1px solid var(--border-primary);
}

th, td {
    padding: 1.25rem;
    text-align: left;
    border-bottom: 1px solid var(--border-secondary);
}

th {
    background-color: var(--bg-tertiary);
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1.1rem;
}

td {
    color: var(--text-secondary);
}

tr:hover {
    background-color: var(--bg-secondary);
}

tr:last-child td {
    border-bottom: none;
}

/* Lists styling */
ul, ol {
    margin: 1.25rem 0;
    padding-left: 2rem;
}

ol {
    padding-left: 2.5rem; /* Extra padding for numbered lists */
}

li {
    margin-bottom: 0.75rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

/* Command reference styling */
.command-section {
    background: var(--bg-primary);
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px var(--shadow-light);
    margin-bottom: 2.5rem;
    border: 1px solid var(--border-primary);
    transition: all 0.3s ease;
}

.command-section:hover {
    box-shadow: 0 8px 30px var(--shadow-medium);
}

.command-section h3 {
    color: var(--accent-primary);
    border-bottom: 3px solid var(--accent-primary);
    padding-bottom: 0.75rem;
    margin-bottom: 1.75rem;
    font-size: 1.4rem;
}

.command-section ul, .command-section ol {
    margin: 1.25rem 0;
    padding-left: 2.5rem;
}

.command-section ol {
    padding-left: 3rem; /* Extra padding for numbered lists in command sections */
}

.command-section li {
    margin-bottom: 1rem;
    line-height: 1.7;
}

.command-example {
    background-color: var(--bg-tertiary);
    border-left: 6px solid var(--accent-primary);
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 12px 12px 0;
    box-shadow: 0 2px 10px var(--shadow-light);
}

.command-example h4 {
    color: var(--accent-primary);
    margin-bottom: 0.75rem;
    font-size: 1.2rem;
}

.command-example ul, .command-example ol {
    margin: 1.25rem 0;
    padding-left: 2.5rem;
}

.command-example ol {
    padding-left: 3rem; /* Extra padding for numbered lists in command examples */
}

.command-example li {
    margin-bottom: 1rem;
    line-height: 1.7;
}

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

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

/* Focus styles for accessibility */
*:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}