/* Public Pages Styles - Dark Theme */

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

:root {
    --bg-primary: #1e1e1e;
    --bg-secondary: #252526;
    --bg-tertiary: #2d2d30;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --accent-primary: #6366f1;
    --accent-secondary: #3b82f6;
    --border-primary: #334155;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
}

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

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

/* Header */
.public-header {
    text-align: center;
    margin-bottom: 48px;
    padding-bottom: 32px;
    border-bottom: 2px solid var(--border-primary);
}

.public-header h1 {
    font-size: 2.5em;
    font-weight: 700;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #6366F1 0%, #3B82F6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1.1em;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.version-badge {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 20px;
    color: var(--accent-primary);
    font-size: 0.9em;
    font-weight: 600;
}

/* Status Indicator */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    margin-top: 16px;
}

.status-indicator.healthy {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--success);
}

.status-indicator.degraded {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--warning);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

/* Info Cards */
.info-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.info-card.full-width {
    grid-column: 1 / -1;
}

.info-card h2 {
    font-size: 1.3em;
    margin-bottom: 16px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-card p {
    color: var(--text-secondary);
    margin-bottom: 12px;
}

/* Code Blocks */
.code-block {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    padding: 16px;
    margin: 12px 0;
}

.code-block code {
    flex: 1;
    font-family: 'Courier New', monospace;
    font-size: 0.95em;
    color: var(--accent-primary);
    word-break: break-all;
}

.copy-btn, .copy-btn-small {
    padding: 8px 16px;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 600;
    transition: all 0.2s;
    white-space: nowrap;
}

.copy-btn-small {
    padding: 4px 12px;
    font-size: 0.8em;
}

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

/* Code Examples */
.code-example {
    margin: 16px 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    overflow: hidden;
}

.code-header {
    padding: 10px 16px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 0.85em;
    font-weight: 600;
    border-bottom: 1px solid var(--border-primary);
}

.code-example pre {
    padding: 16px;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    line-height: 1.5;
    color: var(--text-primary);
}

/* Info Text */
.info-text {
    font-size: 0.9em;
    color: var(--text-muted);
    margin-top: 8px;
}

/* Feature List */
.feature-list {
    list-style: none;
    padding: 0;
}

.feature-list li {
    padding: 10px 0;
    padding-left: 24px;
    position: relative;
    color: var(--text-secondary);
}

.feature-list li::before {
    content: '•';
    position: absolute;
    left: 8px;
    color: var(--accent-primary);
    font-weight: bold;
}

.feature-list code {
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.9em;
    color: var(--accent-primary);
}

/* Endpoints */
.endpoint {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    flex-wrap: wrap;
}

.method {
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 700;
    text-transform: uppercase;
}

.method.get {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.method.post {
    background: rgba(59, 130, 246, 0.2);
    color: var(--accent-secondary);
}

.method.put {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.method.delete {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error);
}

.endpoint code {
    flex: 1;
    min-width: 200px;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
}

.badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 600;
}

.badge.public {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.badge.auth {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error);
}

/* Status List */
.status-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.service-name {
    color: var(--text-primary);
    font-weight: 500;
}

.service-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
    font-weight: 600;
}

.service-status.healthy {
    color: var(--success);
}

.service-status.degraded {
    color: var(--warning);
}

.service-status.offline {
    color: var(--error);
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-label {
    font-size: 0.85em;
    color: var(--text-muted);
    font-weight: 500;
}

.info-value {
    font-size: 1.1em;
    color: var(--text-primary);
    font-weight: 600;
}

.info-value.success {
    color: var(--success);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.stat-card {
    padding: 20px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    text-align: center;
}

.stat-card.highlight {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.3);
}

.stat-value {
    font-size: 2em;
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: 8px;
}

.stat-label {
    font-size: 0.9em;
    color: var(--text-secondary);
}

/* Steps Container */
.steps-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.step {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.step-number {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: var(--accent-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2em;
}

.step-content h3 {
    margin-bottom: 8px;
    color: var(--text-primary);
}

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

.step-content code {
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: 4px;
    color: var(--accent-primary);
}

/* Config Table */
.config-table {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--border-primary);
    border-radius: 8px;
    overflow: hidden;
    margin-top: 16px;
}

.config-row {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 16px;
    background: var(--bg-tertiary);
    padding: 12px 16px;
    align-items: center;
}

.config-key {
    font-weight: 600;
    color: var(--text-secondary);
}

.config-value {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.config-value code {
    color: var(--accent-primary);
}

/* Troubleshooting */
.troubleshooting {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.issue {
    padding: 12px;
    background: var(--bg-tertiary);
    border-left: 3px solid var(--accent-primary);
    border-radius: 4px;
}

.issue strong {
    display: block;
    margin-bottom: 6px;
    color: var(--text-primary);
}

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

/* Warning Text */
.warning-text {
    color: var(--warning);
    padding: 12px;
    background: rgba(245, 158, 11, 0.1);
    border-radius: 6px;
    border-left: 3px solid var(--warning);
}

/* Refresh Notice */
.refresh-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px;
    background: rgba(99, 102, 241, 0.05);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.9em;
}

/* Link Grid */
.links-section {
    margin-top: 8px;
}

.link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.link-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s;
}

.link-card:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.link-icon {
    font-size: 2em;
}

/* Footer */
.public-footer {
    margin-top: 64px;
    padding-top: 24px;
    border-top: 1px solid var(--border-primary);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9em;
}

/* Responsive */
@media (max-width: 768px) {
    .public-header h1 {
        font-size: 2em;
    }
    
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .config-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .endpoint {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .link-grid {
        grid-template-columns: 1fr;
    }
}

