:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --primary-hover: #1d4ed8;
    --primary-shadow: rgb(37 99 235 / 25%);
    --primary-color: var(--primary);
    --primary-color-light: var(--primary-light);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --surface: #ffffff;
    --surface-muted: #f4f6fb;
    --surface-elevated: #ffffff;
    --background: #f8fafc;
    --surface-color: var(--surface);
    --light-bg: var(--background);
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --border-dark: #cbd5e1;
    --border-color: var(--border);
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --text-inverse: #ffffff;
    --text-primary: var(--text-main);
    --text-secondary: var(--text-muted);
    --shadow-soft: 0 20px 45px rgba(15, 23, 42, 0.08);
    --shadow-sm: 0 1px 2px rgb(15 23 42 / 0.08);
    --shadow-md: 0 4px 12px rgb(15 23 42 / 0.08);
    --shadow-lg: 0 12px 24px rgb(15 23 42 / 0.12);
    --shadow-xl: 0 20px 25px rgb(15 23 42 / 0.1);
    --radius-sm: 0.375rem;
    --radius-md: 0.75rem;
    --radius-lg: 1.5rem;
    --radius-xl: 2rem;
    --radius-full: 9999px;
    --gradient-primary: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.viewer-page {
    padding: 2rem 0;
}

.viewer-intro {
    margin-bottom: 2rem;
}

.viewer-title {
    font-size: clamp(2.25rem, 4vw, 3rem);
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    line-height: 1.1;
}

.viewer-subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    margin: 0 0 1rem;
    max-width: 740px;
}

.viewer-main {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: clamp(1.5rem, 3vw, 2.5rem);
    border: 1px solid rgba(148, 163, 184, 0.25);
    margin-bottom: 2rem;
}

.editor-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    min-height: 600px;
    height: auto;
}

.editor-panel {
    display: flex;
    flex-direction: column;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--surface-color);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: var(--light-bg);
    border-bottom: 1px solid var(--border-color);
}

.panel-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.panel-actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;padding: 0.25rem;
}

.action-btn:hover {
    background: var(--border-light);
    color: var(--text-primary);
}

.action-btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.editor-wrapper {
    flex: 1;
    position: relative;
    min-height: 500px;
    width: 100% !important;
}

#editor {
    width: 100%;
    height: 100%;
    min-height: 500px;
}

.preview-panel {
    display: flex;
    flex-direction: column;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--surface-color);
}

.preview-frame {
    flex: 1;
    width: 100%;
    min-height: 500px;
    border: none;
    background: white;
}

.tooltip {
    position: relative;
    display: inline-flex;
}

.tooltip .tooltip-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 9999px;
    background: rgba(15, 23, 42, 0.08);
    color: var(--text-primary);
    font-weight: 700;
    cursor: help;
    border: none;
    font-size: 0.875rem;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 220px;
    background-color: var(--text-primary);
    color: white;
    text-align: left;
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    position: absolute;
    z-index: 10;
    bottom: 135%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.2s ease;
    font-size: 0.875rem;
    line-height: 1.4;
}

.tooltip:hover .tooltiptext,
.tooltip:focus-within .tooltiptext {
    visibility: visible;
    opacity: 1;
}

.copy-button {
    flex: 1 1 auto;
    min-width: 140px;
    background: #f1f5f9;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #405063 !important;
    border: 1px solid #dde3e7;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    gap: 0.5rem;
}

.copy-button:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
    transform: translateY(-1px);
}

.copy-button.copied {
    background: #10b981;
    border-color: #10b981;
    color: #ffffff !important;
}

.export-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.export-button:hover {
    background: var(--border-light);
    color: var(--text-primary);
    border-color: var(--border-dark);
}

.result-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}


.editor-panel .share-container {
    margin: 0;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
}

.result-actions-secondary {
    margin-top: 1rem;
}

.share-container {
    background: rgba(241, 245, 249, 0.8);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    border: 1px solid var(--border-color);
}

.share-title {
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.share-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.65rem 0.75rem;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    color: #ffffff;
    text-decoration: none;
    transition: all 0.2s ease;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 20px rgba(15, 23, 42, 0.2);
    color: #ffffff;
}

.share-x {
    background: #000000;
}

.share-facebook {
    background: #1877f2;
}

.share-linkedin {
    background: #0a66c2;
}

.share-reddit {
    background: #ff4500;
}

.share-telegram {
    background: #0088cc;
}

.share-whatsapp {
    background: #25d366;
}

.preview-panel.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    border-radius: 0;
    margin: 0;
}

.preview-panel.fullscreen .preview-frame {
    min-height: calc(100vh - 60px);
    height: calc(100vh - 60px);
}

.editor-container.fullscreen-preview {
    grid-template-columns: 0 1fr;
}

.editor-container.fullscreen-preview .editor-panel {
    display: none;
}

.share-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.share-modal-content {
    background-color: #ffffff;
    margin: 15% auto;
    padding: 3rem 4rem;
    border-radius: 8px;
    width: 90%;
    max-width: 750px;
    position: relative;
}

.share-modal-close {
    position: absolute;
    right: 3rem;
    top: 3rem;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    color: #9ca3af;
}

.share-modal-close:hover {
    color: #374151;
}

.share-url-container {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.share-url-input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
}

.btn-copy-url {
    padding: 0.75rem 1rem;
    background: #3b82f6;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
}

.btn-copy-url:hover {
    background: #2563eb;
}

.social-share-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.social-share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    color: #ffffff;
    transition: all 0.2s ease;
}

.social-share-btn svg {
    flex-shrink: 0;
}

.social-share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

.facebook-btn {
    background: #1877f2;
}

.facebook-btn:hover {
    background: #1565c0;
}

.twitter-btn {
    background: #1da1f2;
}

.twitter-btn:hover {
    background: #0d8bd9;
}

.linkedin-btn {
    background: #0a66c2;
}

.linkedin-btn:hover {
    background: #084d94;
}

.whatsapp-btn {
    background: #25d366;
}

.whatsapp-btn:hover {
    background: #1ebe57;
}

.reddit-btn {
    background: #ff4500;
}

.reddit-btn:hover {
    background: #e03d00;
}

.telegram-btn {
    background: #0088cc;
}

.telegram-btn:hover {
    background: #0077b5;
}

.ace-xcode .ace_content {
    background-color: #f6f7f9;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.success-animation {
    animation: successPulse 0.6s ease-in-out;
}

@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.seo-section {
    padding: 2rem 0;
}

.feature-item {
    padding: 2.75rem;
    background: #ffffff;
    border-radius: 1rem;
    border: 1px solid #e2e8f0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.feature-item h4 {
    color: var(--primary-color);
    font-weight: 700;
}

.breadcrumbs {
    margin-bottom: 20px;
    padding: 0;
}

.breadcrumbs-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 14px;
}

.breadcrumbs-item a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
}

.breadcrumbs-item a:hover {
    color: var(--primary-color);
}

.breadcrumbs-separator {
    opacity: 0.5;
    margin: 0 0.5rem;
}

@media (max-width: 991px) {
    .editor-container {
        grid-template-columns: 1fr;
        min-height: auto;
    }
    
    .editor-wrapper,
    #editor {
        min-height: 400px;
    }
    
    .preview-frame {
        min-height: 400px;
    }
}

@media (max-width: 768px) {
    .viewer-page {
        padding: 2.5rem 0 3rem;
    }

    .viewer-main {
        border-radius: 1.25rem;
        padding: 1.5rem;
    }
    
    .panel-header {
        padding: 0.875rem 1rem;
    }
    
    .editor-wrapper,
    #editor {
        min-height: 350px;
    }
    
    .preview-frame {
        min-height: 350px;
    }
}

@media (max-width: 576px) {
    .social-share-buttons {
        grid-template-columns: 1fr;
    }
    
    .share-modal-content {
        padding: 2rem 1.5rem;
    }
    
    .share-modal-close {
        right: 1.5rem;
        top: 1.5rem;
    }
}

.infographic-html-structure {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: var(--radius-md);
    border: 1px solid rgba(148, 163, 184, 0.25);
}

.infographic-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    text-align: center;
}

.html-structure-diagrams {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    justify-items: center;
}

.html-structure-diagram {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.html-structure-svg {
    width: 100%;
    max-width: 200px;
    height: auto;
}

.structure-label {
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.structure-label span {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: 0.25rem;
}

.infographic-html-timeline {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: var(--radius-md);
    border: 1px solid rgba(148, 163, 184, 0.25);
}

.timeline-container {
    position: relative;
    padding: 2rem 0;
}

.timeline-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #2563eb 0%, #0ea5e9 100%);
    transform: translateX(-50%);
}

.timeline-items {
    display: grid;
    gap: 2rem;
    position: relative;
    z-index: 1;
}

.timeline-item {
    display: grid;
    grid-template-columns: 1fr 80px 1fr;
    align-items: center;
    gap: 1rem;
}

.timeline-content {
    background: var(--surface-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.timeline-content.left {
    text-align: right;
}

.timeline-year {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.95rem;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    position: relative;
    z-index: 2;
}

.timeline-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.timeline-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.infographic-html-elements {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: var(--radius-md);
    border: 1px solid rgba(148, 163, 184, 0.25);
}

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

.element-box {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, rgba(14, 165, 233, 0.08) 100%);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    border: 2px solid rgba(37, 99, 235, 0.2);
    text-align: center;
}

.element-tag {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-family: 'Courier New', monospace;
}

.element-name {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
}

@media (max-width: 768px) {
    .html-structure-diagrams {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .timeline-item {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .timeline-year {
        margin: 0 auto;
    }
    
    .timeline-content.left {
        text-align: left;
    }
    
    .timeline-line {
        left: 40px;
    }
    
    .elements-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

