/* Markdown Viewer Styles */
.markdown-viewer-section {
    margin-bottom: 3rem;
}

.viewer-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

.viewer-panel {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 600px;
    transition: box-shadow 0.3s ease;
}

.viewer-panel:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-bottom: 1px solid #e9ecef;
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    font-size: 1rem;
    color: #212529;
}

.panel-icon {
    color: #495057;
    flex-shrink: 0;
}

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

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    background: transparent;
    color: #495057;
}

.action-btn svg {
    flex-shrink: 0;
}

.action-btn.primary {
    background: #0d6efd;
    color: #ffffff;
    border-color: #0d6efd;
}

.action-btn.primary:hover {
    background: #0b5ed7;
    border-color: #0a58ca;
    transform: translateY(-1px);
}

.action-btn.secondary {
    background: #6c757d;
    color: #ffffff;
    border-color: #6c757d;
}

.action-btn.secondary:hover {
    background: #5c636a;
    border-color: #565e64;
    transform: translateY(-1px);
}

.action-btn.success {
    background: #198754;
    color: #ffffff;
    border-color: #198754;
}

.action-btn.success:hover {
    background: #157347;
    border-color: #146c43;
    transform: translateY(-1px);
}

.action-btn.info {
    background: #0dcaf0;
    color: #000000;
    border-color: #0dcaf0;
}

.action-btn.info:hover {
    background: #0aa2c0;
    border-color: #0997b3;
    transform: translateY(-1px);
}

.action-btn.warning {
    background: #ffc107;
    color: #000000;
    border-color: #ffc107;
}

.action-btn.warning:hover {
    background: #ffca2c;
    border-color: #ffc720;
    transform: translateY(-1px);
}

.panel-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
    overflow: hidden;
}

/* Toolbar */
.toolbar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e9ecef;
}

.toolbar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #495057;
    font-size: 0.875rem;
}

.toolbar-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    transform: translateY(-1px);
}

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

.toolbar-btn svg {
    flex-shrink: 0;
}

.toolbar-btn code {
    font-size: 0.75rem;
    background: transparent;
    padding: 0;
}

/* Markdown Input */
.markdown-input {
    flex: 1;
    width: 100%;
    min-height: 400px;
    padding: 1rem;
    
    font-size: 14px;
    line-height: 1.6;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: #ffffff;
    color: #212529;
    resize: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 1rem;
}

.markdown-input:focus {
    outline: none;
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

.markdown-input::placeholder {
    color: #adb5bd;
}

/* Options Group */
.options-group {
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.options-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: #495057;
}

.options-header svg {
    flex-shrink: 0;
}

.options-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.option-item:hover {
    background: rgba(255, 255, 255, 0.5);
}

.option-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #0d6efd;
}

.option-label {
    font-size: 0.875rem;
    color: #495057;
    user-select: none;
}

/* Stats Bar */
.stats-bar {
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 0.875rem;
    color: #6c757d;
    border: 1px solid #e9ecef;
}

.stats-bar strong {
    color: #495057;
    margin-right: 0.5rem;
}

/* Preview Area */
.preview-area {
    flex: 1;
    min-height: 400px;
    padding: 1.5rem;
    overflow-y: auto;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.preview-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 400px;
    color: #adb5bd;
    text-align: center;
}

.preview-empty svg {
    margin-bottom: 1rem;
}

.preview-empty p {
    font-size: 0.875rem;
    margin: 0;
}

/* GitHub Markdown Styles */
.github-markdown {
    font-size: 16px;
    line-height: 1.6;
    word-wrap: break-word;
    color: #24292f;
}

.github-markdown h1 {
    padding-bottom: 0.3em;
    font-size: 2em;
    font-weight: 600;
    border-bottom: 1px solid #d0d7de;
    margin-top: 24px;
    margin-bottom: 16px;
}

.github-markdown h2 {
    padding-bottom: 0.3em;
    font-size: 1.5em;
    font-weight: 600;
    border-bottom: 1px solid #d0d7de;
    margin-top: 24px;
    margin-bottom: 16px;
}

.github-markdown h3 {
    font-size: 1.25em;
    font-weight: 600;
    margin-top: 24px;
    margin-bottom: 16px;
}

.github-markdown h4 {
    font-size: 1em;
    font-weight: 600;
    margin-top: 16px;
    margin-bottom: 8px;
}

.github-markdown h5 {
    font-size: 0.875em;
    font-weight: 600;
    margin-top: 16px;
    margin-bottom: 8px;
}

.github-markdown h6 {
    font-size: 0.85em;
    font-weight: 600;
    color: #656d76;
    margin-top: 16px;
    margin-bottom: 8px;
}

.github-markdown p {
    margin-top: 0;
    margin-bottom: 10px;
}

.github-markdown pre {
    background-color: #f6f8fa;
    border-radius: 6px;
    font-size: 85%;
    line-height: 1.45;
    overflow: auto;
    padding: 16px;
    margin-bottom: 16px;
}

.github-markdown code {
    background-color: rgba(175, 184, 193, 0.2);
    border-radius: 3px;
    font-size: 85%;
    margin: 0;
    padding: 0.2em 0.4em;
}

.github-markdown pre > code {
    background-color: transparent;
    border: 0;
    display: inline;
    line-height: inherit;
    margin: 0;
    overflow: visible;
    padding: 0;
    word-wrap: normal;
    font-size: 100%;
}

.github-markdown blockquote {
    border-left: 0.25em solid #d0d7de;
    color: #656d76;
    padding: 0 1em;
    margin: 0 0 16px 0;
}

.github-markdown table {
    border-collapse: collapse;
    border-spacing: 0;
    width: 100%;
    margin: 16px 0;
    display: block;
    overflow-x: auto;
}

.github-markdown table th,
.github-markdown table td {
    border: 1px solid #d0d7de;
    padding: 6px 13px;
}

.github-markdown table th {
    background-color: #f6f8fa;
    font-weight: 600;
}

.github-markdown table tr:nth-child(2n) {
    background-color: #f6f8fa;
}

.github-markdown ul,
.github-markdown ol {
    padding-left: 30px;
    margin-bottom: 16px;
}

.github-markdown li {
    margin-bottom: 0.25em;
}

.github-markdown hr {
    background-color: #d0d7de;
    border: 0;
    height: 0.25em;
    margin: 24px 0;
    border-radius: 2px;
}

.github-markdown img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 16px 0;
}

.github-markdown a {
    color: #0969da;
    text-decoration: none;
}

.github-markdown a:hover {
    text-decoration: underline;
}

/* Fullscreen Modal */
#fullscreenModal .modal-body {
    padding: 2rem;
    background: #ffffff;
}

#fullscreenModal .github-markdown {
    max-width: 900px;
    margin: 0 auto;
}

/* Mobile Responsive */
@media (max-width: 991px) {
    .viewer-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .viewer-panel {
        min-height: 500px;
    }
    
    .markdown-input {
        min-height: 300px;
    }
    
    .preview-area {
        min-height: 300px;
    }
    
    .panel-actions {
        flex-wrap: wrap;
    }
    
    .action-btn .btn-text {
        display: none;
    }
    
    .action-btn {
        padding: 0.5rem;
        min-width: 36px;
    }
}

@media (max-width: 575px) {
    .toolbar {
        gap: 0.375rem;
    }
    
    .toolbar-btn {
        width: 32px;
        height: 32px;
        font-size: 0.75rem;
    }
    
    .panel-header {
        padding: 0.875rem 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .panel-body {
        padding: 1rem;
    }
    
    .github-markdown {
        font-size: 14px;
    }
    
    .github-markdown h1 {
        font-size: 1.75em;
    }
    
    .github-markdown h2 {
        font-size: 1.5em;
    }
    
    .github-markdown h3 {
        font-size: 1.25em;
    }
}

/* Smooth scrolling */
.preview-area {
    scroll-behavior: smooth;
}

/* Loading state */
.preview-area.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Animation for content updates */
.github-markdown {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

