/* Documentation-specific styles */

/* Dark Theme Support for Documentation */
[data-theme="dark"] .docs-main {
    background: var(--bg-color);
}

[data-theme="dark"] .docs-sidebar {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .docs-content {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .code-block {
    background: var(--code-bg);
    border-color: var(--border-color);
}

[data-theme="dark"] .code-header {
    background: var(--bg-hover);
    border-color: var(--border-color);
}

/* Documentation Layout */
.docs-main {
    min-height: calc(100vh - 80px);
    padding-top: 80px;
    background: var(--bg-color);
}

.docs-container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    padding: 2rem;
}

/* Sidebar */
.docs-sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.docs-nav h3 {
    color: var(--text-color);
    margin-bottom: 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

.docs-nav li {
    margin-bottom: 0.5rem;
}

.docs-nav a {
    display: block;
    padding: 0.5rem 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    font-size: 0.875rem;
    font-weight: 500;
}

.docs-nav a:hover {
    background: var(--bg-hover);
    color: var(--text-color);
}

.docs-nav a.active {
    background: var(--primary-color);
    color: white;
}

/* Content Area */
.docs-content {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.docs-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.docs-header h1 {
    color: var(--text-color);
    margin-bottom: 0.5rem;
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1.2;
}

.docs-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin: 0;
}

/* Sections */
.docs-section {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.docs-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.docs-section h2 {
    color: var(--text-color);
    margin-bottom: 1rem;
    font-size: 1.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    line-height: 1.3;
}

.docs-section h3 {
    color: var(--text-color);
    margin: 1.5rem 0 1rem 0;
    font-size: 1.3rem;
}

.docs-section h4 {
    color: var(--text-color);
    margin: 1rem 0 0.5rem 0;
    font-size: 1.1rem;
}

/* macOS Terminal Style Code Blocks */
.code-block, .terminal-block {
    background: var(--terminal-bg);
    border: 1px solid var(--terminal-border);
    border-radius: 12px;
    margin: 1.5rem 0;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    font-family: 'SF Mono', 'Monaco', 'Menlo', 'Consolas', monospace;
}

.code-header, .terminal-header {
    background: var(--terminal-border);
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--terminal-border);
    position: relative;
}

.code-header::before, .terminal-header::before {
    content: '';
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ff5f57;
    box-shadow: 20px 0 0 #ffbd2e, 40px 0 0 #28ca42;
}

.code-title, .terminal-title {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    margin-left: 60px;
}

.copy-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.copy-btn:hover {
    background: var(--accent-color);
    transform: translateY(-1px);
}

.code-block pre, .terminal-block pre {
    margin: 0;
    padding: 1.5rem;
    overflow-x: auto;
    background: transparent;
    color: var(--terminal-text);
    line-height: 1.6;
}

.code-block code, .terminal-block code {
    color: var(--terminal-text);
    font-family: 'SF Mono', 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    font-weight: 400;
}

/* Terminal prompt styling */
.terminal-prompt {
    color: var(--terminal-prompt);
    font-weight: 600;
}

.terminal-command {
    color: var(--terminal-text);
}

.terminal-comment {
    color: var(--terminal-comment);
    font-style: italic;
}

.terminal-string {
    color: var(--terminal-string);
}

.terminal-keyword {
    color: var(--terminal-keyword);
    font-weight: 600;
}

/* Bash/Shell specific styling */
.language-bash .token.function,
.language-shell .token.function {
    color: var(--terminal-keyword);
}

.language-bash .token.string,
.language-shell .token.string {
    color: var(--terminal-string);
}

.language-bash .token.comment,
.language-shell .token.comment {
    color: var(--terminal-comment);
}

.language-bash .token.operator,
.language-shell .token.operator {
    color: var(--terminal-prompt);
}

/* Inline code */
p code, li code {
    background: var(--terminal-bg);
    color: var(--terminal-keyword);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.875em;
    font-weight: 500;
    font-family: 'SF Mono', 'Monaco', 'Menlo', 'Consolas', monospace;
    border: 1px solid var(--terminal-border);
}

[data-theme="dark"] p code,
[data-theme="dark"] li code {
    background: var(--terminal-bg);
    color: var(--terminal-prompt);
    border-color: var(--terminal-border);
}

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 12px;
    margin: 1rem 0;
    border-left: 4px solid;
    backdrop-filter: blur(10px);
}

.alert-info {
    background: rgba(0, 122, 255, 0.1);
    border-color: var(--info-color);
    color: var(--info-color);
}

.alert-warning {
    background: rgba(255, 159, 10, 0.1);
    border-color: var(--warning-color);
    color: var(--warning-color);
}

.alert-success {
    background: rgba(48, 209, 88, 0.1);
    border-color: var(--success-color);
    color: var(--success-color);
}

.alert-error {
    background: rgba(255, 69, 58, 0.1);
    border-color: var(--error-color);
    color: var(--error-color);
}

/* Dark theme alert adjustments */
[data-theme="dark"] .alert-info {
    background: rgba(0, 122, 255, 0.15);
    color: #5ac8fa;
}

[data-theme="dark"] .alert-warning {
    background: rgba(255, 159, 10, 0.15);
    color: #ff9f0a;
}

[data-theme="dark"] .alert-success {
    background: rgba(48, 209, 88, 0.15);
    color: #30d158;
}

[data-theme="dark"] .alert-error {
    background: rgba(255, 69, 58, 0.15);
    color: #ff453a;
}

.alert strong {
    display: block;
    margin-bottom: 0.5rem;
}

/* Requirements Grid */
.requirements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.requirement-card {
    background: var(--bg-color);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

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

.requirement-card h3 {
    color: var(--primary-color);
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.requirement-card p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
}

.requirement-card strong {
    color: var(--text-color);
}

/* OS Support */
.os-support {
    display: grid;
    gap: 1rem;
    margin: 1rem 0;
}

.os-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.os-icon {
    font-size: 2rem;
}

.os-item strong {
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
    display: block;
}

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

/* Installation Steps */
.installation-steps {
    margin: 2rem 0;
}

.step {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

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

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

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

/* Tabs */
.tabs {
    margin: 1rem 0;
}

.tab-buttons {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    background: none;
    border: none;
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-radius: 6px 6px 0 0;
    transition: all 0.2s ease;
    color: var(--text-secondary);
}

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

.tab-btn:hover:not(.active) {
    background: var(--hover-bg);
    color: var(--text-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Troubleshooting */
.troubleshooting-item {
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: var(--bg-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.troubleshooting-item h3,
.troubleshooting-item h4 {
    color: var(--primary-color);
    margin-top: 0;
}

/* Configuration */
.config-tabs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.config-tab {
    background: var(--bg-color);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.config-tab h4 {
    color: var(--primary-color);
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Workflow Steps */
.workflow-steps {
    margin: 2rem 0;
}

.workflow-step {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.workflow-step:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-hover);
}

/* Feature Details */
.feature-detail {
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: var(--bg-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.feature-detail h4 {
    color: var(--primary-color);
    margin: 0 0 1rem 0;
}

/* API Reference */
.api-class {
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: var(--bg-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.api-class h4 {
    color: var(--primary-color);
    margin: 0 0 0.5rem 0;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

/* Credential Items */
.credential-item {
    margin: 1rem 0;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: 6px;
    border-left: 4px solid var(--primary-color);
}

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

/* Help Options */
.help-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.help-option {
    background: var(--bg-color);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    text-align: center;
}

.help-option h4 {
    color: var(--primary-color);
    margin: 0 0 1rem 0;
}

/* Next Steps */
.next-steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.next-step-card {
    background: var(--bg-color);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    text-align: center;
    transition: all 0.3s ease;
}

.next-step-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

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

.next-step-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* Changelog */
.changelog-item {
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--bg-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

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

.changelog-date {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0 0 1rem 0;
}

.changelog-item h4 {
    color: var(--text-color);
    margin: 1rem 0 0.5rem 0;
    font-size: 1rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .docs-container {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem;
    }
    
    .docs-sidebar {
        position: static;
        order: 2;
    }
    
    .docs-content {
        order: 1;
    }
}

@media (max-width: 768px) {
    .docs-header h1 {
        font-size: 2rem;
    }
    
    .docs-section h2 {
        font-size: 1.5rem;
    }
    
    .requirements-grid,
    .config-tabs,
    .next-steps-grid,
    .help-options {
        grid-template-columns: 1fr;
    }
    
    .step,
    .workflow-step {
        flex-direction: column;
        text-align: center;
    }
    
    .step-number {
        align-self: center;
    }
    
    .tab-buttons {
        flex-wrap: wrap;
    }
    
    .code-header {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
    .alert-info {
        background: rgba(33, 150, 243, 0.1);
        color: #90caf9;
    }
    
    .alert-warning {
        background: rgba(255, 152, 0, 0.1);
        color: #ffb74d;
    }
    
    .alert-success {
        background: rgba(76, 175, 80, 0.1);
        color: #a5d6a7;
    }
}

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

/* Highlight target sections */
.docs-section:target {
    background: rgba(var(--primary-rgb), 0.05);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1rem 0;
    transition: all 0.3s ease;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Terminal Action Section Styles */
.terminal-action-section {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin: 2rem 0;
    border: 1px solid var(--border-color);
    text-align: center;
}

.action-header h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.action-header p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.terminal-action-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.btn-terminal-action {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: var(--radius-lg);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(var(--primary-rgb), 0.3);
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    font-family: inherit;
    min-width: 280px;
    justify-content: center;
}

.btn-terminal-action:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(var(--primary-rgb), 0.4);
    background: linear-gradient(135deg, var(--accent-color), var(--primary-color));
}

.btn-terminal-action:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(var(--primary-rgb), 0.3);
}

.action-info {
    color: var(--text-secondary);
    font-size: 0.875rem;
    max-width: 400px;
    text-align: center;
}

.action-info small {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    flex-wrap: wrap;
}

/* Responsive design for terminal action */
@media (max-width: 768px) {
    .terminal-action-section {
        padding: 1.5rem;
        margin: 1.5rem 0;
    }
    
    .btn-terminal-action {
        min-width: 100%;
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
    
    .action-header h3 {
        font-size: 1.25rem;
    }
    
    .action-info small {
        text-align: center;
        line-height: 1.4;
    }
}

/* Additional animations for button states */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.btn-terminal-action [data-feather] {
    transition: transform 0.3s ease;
}

.btn-terminal-action:hover [data-feather] {
    transform: scale(1.1);
}