/* Markdown Viewer Specific Styles */

body {
    margin: 0;
    padding: 0;
    overflow: hidden;
}

#md-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    background-color: #1e1e1e;
    color: #e0e0e0;
    font-family: 'Inter', sans-serif;
}

#md-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.25rem 2rem;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#md-header h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #cccccc;
}

.header-controls {
    margin-left: auto;
    display: flex;
    gap: 0.75rem;
}

#md-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    flex: 1;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
}

.panel {
    display: flex;
    flex-direction: column;
    background-color: #252526;
    overflow: hidden;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.panel-info {
    font-size: 0.75rem;
    color: #888;
    font-weight: 400;
    text-transform: none;
}

.textarea-container {
    position: relative;
    flex: 1;
    display: flex;
    overflow: hidden;
}

.textarea-line-numbers {
    padding: 1rem 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    color: #666;
    text-align: right;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    user-select: none;
    overflow-y: hidden;
    min-width: 3rem;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

#mdInput {
    flex: 1;
    padding: 1rem;
    background: transparent;
    border: none;
    color: #e0e0e0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    resize: none;
    outline: none;
    overflow-y: auto;
}

#mdInput::placeholder {
    color: #555;
}

.preview-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.02);
}

.empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #666;
    font-size: 1rem;
    font-style: italic;
}

/* Markdown Preview Styling */
#mdPreview h1,
#mdPreview h2,
#mdPreview h3,
#mdPreview h4,
#mdPreview h5,
#mdPreview h6 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    line-height: 1.3;
    color: #fff;
}

#mdPreview h1 {
    font-size: 2rem;
    border-bottom: 2px solid rgba(102, 126, 234, 0.5);
    padding-bottom: 0.5rem;
}

#mdPreview h2 {
    font-size: 1.5rem;
    border-bottom: 1px solid rgba(102, 126, 234, 0.3);
    padding-bottom: 0.4rem;
}

#mdPreview h3 {
    font-size: 1.25rem;
}

#mdPreview h4 {
    font-size: 1.1rem;
}

#mdPreview h5 {
    font-size: 1rem;
}

#mdPreview h6 {
    font-size: 0.9rem;
    color: #aaa;
}

#mdPreview p {
    margin: 0.75rem 0;
    line-height: 1.7;
}

#mdPreview a {
    color: #667eea;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

#mdPreview a:hover {
    border-bottom-color: #667eea;
}

#mdPreview code {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    color: #f8f8f2;
}

#mdPreview pre {
    background: rgba(0, 0, 0, 0.4);
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    margin: 1rem 0;
    border-left: 3px solid #667eea;
}

#mdPreview pre code {
    background: transparent;
    padding: 0;
    border-radius: 0;
}

#mdPreview blockquote {
    margin: 1rem 0;
    padding: 0.5rem 1rem;
    border-left: 4px solid #667eea;
    background: rgba(102, 126, 234, 0.1);
    color: #ddd;
    font-style: italic;
}

#mdPreview ul,
#mdPreview ol {
    margin: 0.75rem 0;
    padding-left: 2rem;
    line-height: 1.7;
}

#mdPreview li {
    margin: 0.25rem 0;
}

#mdPreview table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    background: rgba(255, 255, 255, 0.02);
}

#mdPreview th,
#mdPreview td {
    padding: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: left;
}

#mdPreview th {
    background: rgba(102, 126, 234, 0.2);
    font-weight: 600;
    color: #fff;
}

#mdPreview tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

#mdPreview img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 1rem 0;
}

#mdPreview hr {
    border: none;
    border-top: 2px solid rgba(255, 255, 255, 0.1);
    margin: 2rem 0;
}

/* Scrollbar Styling */
#mdInput::-webkit-scrollbar,
.preview-content::-webkit-scrollbar {
    width: 8px;
}

#mdInput::-webkit-scrollbar-track,
.preview-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

#mdInput::-webkit-scrollbar-thumb,
.preview-content::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.5);
    border-radius: 4px;
}

#mdInput::-webkit-scrollbar-thumb:hover,
.preview-content::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.7);
}

/* Responsive Design */
@media (max-width: 768px) {
    #md-panels {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr 1fr;
    }

    #md-header {
        flex-wrap: wrap;
        gap: 1rem;
    }

    #md-header h1 {
        font-size: 1.25rem;
    }

    .header-controls {
        width: 100%;
        margin-left: 0;
    }
}