/* Tag Documentation Pages Styles */

.tag-doc-page {
    padding: 3rem 1.5rem;
}

.tag-doc-container {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

/* Header */
.tag-doc-header {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1.5rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: color 0.2s ease, transform 0.2s ease;
    width: fit-content;
}

.back-link:hover {
    color: var(--accent-hover);
    transform: translateX(-2px);
}

.back-link svg {
    width: 1rem;
    height: 1rem;
}

.tag-doc-title {
    font-family: 'Outfit', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text);
}

/* Section */
.tag-doc-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.section-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

.tag-description {
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.75;
}

/* Code Snippet Container */
.code-container {
    position: relative;
    background: #0f172a;
    border-radius: 8px;
    border: 1px solid var(--border);
    overflow: hidden;
    padding: 1.5rem;
}

.copy-code-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    padding: 0.35rem 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #f8fafc;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-code-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.code-container pre {
    margin: 0;
    overflow-x: auto;
}

.code-container code {
    font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.9rem;
    color: #cbd5e1;
    white-space: pre;
    line-height: 1.5;
}

/* Interactive Preview Container */
.preview-container {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.preview-browser-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.25rem;
    background: var(--surface-soft);
    border-bottom: 1px solid var(--border);
}

.browser-dots {
    display: flex;
    gap: 0.35rem;
}

.browser-dots span {
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 50%;
    display: inline-block;
}

.browser-dots span:nth-child(1) { background: #ef4444; }
.browser-dots span:nth-child(2) { background: #eab308; }
.browser-dots span:nth-child(3) { background: #22c55e; }

.browser-address {
    flex-grow: 1;
    text-align: center;
    font-size: 0.75rem;
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.2rem 0.5rem;
    max-width: 280px;
    margin: 0 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: monospace;
}

.preview-body {
    padding: 2.25rem;
    min-height: 140px;
    background: var(--surface);
    color: var(--text);
    overflow: auto;
}

/* Custom adjustments for demo snippets styling */
.preview-body h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.preview-body input, 
.preview-body button, 
.preview-body select {
    font-family: inherit;
    font-size: 0.95rem;
    padding: 0.45rem 0.85rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    outline: none;
    transition: all 0.2s ease;
}

.preview-body input:focus, 
.preview-body select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-soft);
}

.preview-body button {
    cursor: pointer;
    background: var(--accent);
    color: #ffffff;
    border: none;
    font-weight: 500;
}

.preview-body button:hover {
    background: var(--accent-hover);
}

.preview-body dialog {
    padding: 2rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow);
    max-width: 400px;
    margin: auto;
}

.preview-body dialog::backdrop {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.preview-body form label {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--muted);
}

/* Footer Section */
.tag-doc-footer {
    border-top: 1px solid var(--border);
    padding-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 1.5rem;
}

.related-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.75rem;
}

.related-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.related-tag-chip {
    padding: 0.4rem 0.85rem;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.related-tag-chip:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
}

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

.nav-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    color: var(--text);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    background: var(--surface);
    transition: all 0.2s ease;
}

.nav-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .nav-buttons {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }
    
    .nav-btn {
        justify-content: center;
        width: 100%;
    }
    
    .tag-doc-page {
        padding: 2rem 1rem;
    }
}

.playground-iframe {
    width: 100%;
    height: 300px;
    border: none;
    background: transparent;
    display: block;
}

