/* QET Markdown Editor - Styles */

/* CSS Variables */
:root {
    --primary-navy: #1e3a5f;
    --accent-teal: #2a9d8f;
    --bg-light: #ffffff;
    --bg-gray: #f8f9fa;
    --bg-dark: #2c3e50;
    --text-primary: #2c3e50;
    --text-secondary: #6c757d;
    --text-light: #ffffff;
    --border-color: #dee2e6;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

/* Header */
.app-header {
    background: linear-gradient(135deg, var(--primary-navy) 0%, #2a5a7f 100%);
    color: var(--text-light);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    position: relative;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.app-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.app-title h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.app-subtitle {
    font-size: 0.875rem;
    color: var(--accent-teal);
    font-weight: 500;
}

.header-right {
    display: flex;
    gap: 1rem;
}

/* Buttons */
.btn {
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent-teal);
    color: var(--text-light);
}

.btn-primary:hover {
    background: #248277;
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-light);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* App Container */
.app-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 80px);
    background: var(--bg-light);
}

/* Toolbar */
.toolbar {
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.toolbar-section {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.toolbar-divider {
    width: 1px;
    height: 24px;
    background: var(--border-color);
}

.toolbar-btn {
    padding: 0.5rem 0.875rem;
    border: 1px solid var(--border-color);
    background: var(--bg-light);
    color: var(--text-primary);
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.toolbar-btn:hover {
    background: var(--bg-gray);
    border-color: var(--accent-teal);
    color: var(--accent-teal);
}

.toolbar-btn:active {
    transform: scale(0.98);
}

.toolbar-btn i {
    font-size: 1rem;
}

.export-btn {
    background: var(--accent-teal);
    color: var(--text-light);
    border-color: var(--accent-teal);
}

.export-btn:hover {
    background: #248277;
    border-color: #248277;
    color: var(--text-light);
}

/* Editor Container */
.editor-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.editor-pane,
.preview-pane {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

.editor-pane {
    background: var(--bg-light);
    border-right: 1px solid var(--border-color);
}

.preview-pane {
    background: var(--bg-gray);
}

/* Markdown Editor */
#markdownEditor {
    width: 100%;
    height: 100%;
    border: none;
    outline: none;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 1rem;
    line-height: 1.8;
    resize: none;
    background: transparent;
    color: var(--text-primary);
}

#markdownEditor::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

/* Markdown Preview */
.markdown-content {
    max-width: 800px;
    margin: 0 auto;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
    color: var(--primary-navy);
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
    line-height: 1.3;
}

.markdown-content h1 {
    font-size: 2.25rem;
    border-bottom: 2px solid var(--accent-teal);
    padding-bottom: 0.5rem;
}

.markdown-content h2 {
    font-size: 1.875rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.375rem;
}

.markdown-content h3 {
    font-size: 1.5rem;
}

.markdown-content h4 {
    font-size: 1.25rem;
}

.markdown-content p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

.markdown-content a {
    color: var(--accent-teal);
    text-decoration: none;
    font-weight: 500;
}

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

.markdown-content ul,
.markdown-content ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.markdown-content li {
    margin-bottom: 0.5rem;
}

.markdown-content code {
    background: var(--bg-gray);
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 0.875em;
    color: #e83e8c;
}

.markdown-content pre {
    background: #2d2d2d;
    padding: 1.25rem;
    border-radius: 6px;
    overflow-x: auto;
    margin-bottom: 1rem;
}

.markdown-content pre code {
    background: transparent;
    padding: 0;
    color: #f8f8f2;
    font-size: 0.9375rem;
}

.markdown-content blockquote {
    border-left: 4px solid var(--accent-teal);
    padding-left: 1.25rem;
    margin: 1.5rem 0;
    color: var(--text-secondary);
    font-style: italic;
}

.markdown-content hr {
    border: none;
    border-top: 2px solid var(--border-color);
    margin: 2rem 0;
}

.markdown-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.markdown-content table th,
.markdown-content table td {
    border: 1px solid var(--border-color);
    padding: 0.75rem;
    text-align: left;
}

.markdown-content table th {
    background: var(--primary-navy);
    color: var(--text-light);
    font-weight: 600;
}

.markdown-content table tr:nth-child(even) {
    background: var(--bg-gray);
}

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

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--bg-light);
    border-radius: 12px;
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, var(--primary-navy) 0%, #2a5a7f 100%);
    color: var(--text-light);
    border-radius: 12px 12px 0 0;
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-light);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.15);
}

.modal-body {
    padding: 2rem;
}

.about-logo {
    text-align: center;
    margin-bottom: 1.5rem;
}

.about-logo img {
    width: 120px;
    height: 120px;
}

.modal-body h3 {
    color: var(--primary-navy);
    font-size: 1.25rem;
    margin-bottom: 1rem;
    text-align: center;
}

.modal-body p {
    margin-bottom: 1.5rem;
    line-height: 1.8;
    text-align: center;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin: 2rem 0;
}

.feature-item {
    text-align: center;
    padding: 1.5rem;
    background: var(--bg-gray);
    border-radius: 8px;
    transition: transform 0.2s ease;
}

.feature-item:hover {
    transform: translateY(-4px);
}

.feature-item i {
    font-size: 2.5rem;
    color: var(--accent-teal);
    margin-bottom: 1rem;
}

.feature-item h4 {
    color: var(--primary-navy);
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.feature-item p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0;
}

.about-footer {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.about-footer p {
    margin-bottom: 0.5rem;
}

.about-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

/* Loading Overlay */
.loading-overlay {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--accent-teal);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    color: var(--text-light);
    font-size: 1.125rem;
    font-weight: 600;
    margin-top: 1.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .app-header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .header-left,
    .header-right {
        width: 100%;
        justify-content: center;
    }
    
    .toolbar {
        padding: 0.5rem;
        gap: 0.5rem;
    }
    
    .toolbar-btn {
        padding: 0.5rem;
        font-size: 0.8125rem;
    }
    
    .toolbar-btn span {
        display: none;
    }
    
    .editor-container {
        flex-direction: column;
    }
    
    .editor-pane,
    .preview-pane {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
    }
    
    .about-buttons {
        flex-direction: column;
    }
}

/* Print Styles */
@media print {
    .app-header,
    .toolbar,
    .editor-pane {
        display: none;
    }
    
    .preview-pane {
        padding: 0;
    }
    
    .markdown-content {
        max-width: 100%;
    }
}

