* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Nunito, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", Segoe UI Symbol, "Noto Color Emoji";
    background: #f5f5f5;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.visually-hidden {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.header {
    background: white;
    border-bottom: 1px solid #e0e0e0;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo span {
    width: 25px;
    height: 25px;
    background: #059669;
    color: rgb(240, 231, 231);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-weight: 600;
}

.doc-name-input {
    border: none;
    font-size: 14px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    outline: none;
    min-width: 200px;
}

.doc-name-input:hover {
    background: #f5f5f5;
}

.doc-name-input:focus {
    background: #f0f0f0;
}

.header-actions {
    display: flex;
    gap: 10px;
}

button {
    padding: 8px 16px;
    border: 1px solid #e0e0e0;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
}

button img {
            width: 16px;
            height: 14px;
            object-fit: contain;
        }

button:hover {
    background: #f5f5f5;
}

.btn-download {
    margin: 11px;
    padding: 7px;
    background: #059669;
    color: #f5f5f5;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-download:hover {
    background: #077051;
}

.btn-download:disabled {
    background: #cccccc;
    cursor: not-allowed;
}

.main-wrapper {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.sidebar {
    width: 200px;
    background: #1f2839;
    color: white;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #1a1a1a;
}

.sidebar-header {
    padding: 16px;
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-item {
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
    font-size: 14px;
    border-left: 3px solid transparent;
}

.sidebar-item:hover {
    background: #3d3d3d;
}

/* Default: hidden scrollbar */
.sidebar-content {
    flex: 1;
    overflow-y: auto;

    scrollbar-width: none;          /* Firefox */
    -ms-overflow-style: none;       /* Edge / IE */
}

/* Chrome / Safari */
.sidebar-content::-webkit-scrollbar {
    width: 0;
}

/* On hover: show scrollbar */
.sidebar:hover .sidebar-content {
    scrollbar-width: thin;          /* Firefox */
}

.sidebar:hover .sidebar-content::-webkit-scrollbar {
    width: 3px;
    border-radius: 999px; 
}

.sidebar:hover .sidebar-content::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.35);
    border-radius: 3px;
    border-radius: 999px; 
}

.sidebar:hover .sidebar-content::-webkit-scrollbar-track {
    background: transparent;
}


.sidebar-item.active {
    background: #4f5f77;
    border-left-color: #4CAF50;
}

.sidebar-item .icon {
    font-size: 16px;
}

.new-doc-btn {
    margin: 16px;
    padding: 10px;
    background: #059669;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.new-doc-btn:hover {
    background: #077051;
}

.sidebar-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: sticky;

}

.main-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.editor-pane, .preview-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.editor-pane {
    border-right: 1px solid #e0e0e0;
}

.pane-header {
    background: #fafafa;
    padding: 10px 20px;
    border-bottom: 1px solid #e0e0e0;
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

.doc-name-label {
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.pane-header input {
    border: none;
    background: transparent;
    font-size: 13px;
    color: #333;
    font-weight: 500;
    padding: 2px 4px;
    outline: none;
    width: 100%;
}

.pane-header input:hover {
    background: #f0f0f0;
    border-radius: 3px;
}

.pane-header input:focus {
    background: white;
    border: 1px solid #4CAF50;
    border-radius: 3px;
}

textarea {
    flex: 1;
    border: none;
    padding: 20px;
    font-family: Nunito, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", Segoe UI Symbol, "Noto Color Emoji";
    font-size: 14px;
    line-height: 1.6;
    resize: none;
    outline: none;
}

.preview-content {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
    background: white;
}

.preview-content h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 16px;
    color: #1a1a1a;
}

.preview-content h2 {
    font-size: 24px;
    font-weight: 600;
    margin-top: 32px;
    margin-bottom: 16px;
    color: #1a1a1a;
}

.preview-content h3 {
    font-size: 20px;
    font-weight: 600;
    margin-top: 24px;
    margin-bottom: 12px;
    color: #1a1a1a;
}

.preview-content p {
    margin-bottom: 16px;
    line-height: 1.6;
    color: #333;
}

.preview-content ul, .preview-content ol {
    margin-bottom: 16px;
    padding-left: 24px;
}

.preview-content li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.preview-content code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: Nunito, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", Segoe UI Symbol, "Noto Color Emoji";
    font-size: 13px;
}

.preview-content pre {
    background: #f5f5f5;
    padding: 16px;
    border-radius: 4px;
    overflow-x: auto;
    margin-bottom: 16px;
}

.preview-content pre code {
    background: none;
    padding: 0;
}

.preview-content blockquote {
    border-left: 4px solid #e0e0e0;
    padding-left: 16px;
    margin: 16px 0;
    color: #666;
}

.preview-content strong {
    font-weight: 600;
}

.preview-content a {
    color: #059669;
    text-decoration: none;
}

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

.preview-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
}

.preview-content th,
.preview-content td {
    border: 1px solid #e0e0e0;
    padding: 8px 12px;
    text-align: left;
}

.preview-content th {
    background: #f5f5f5;
    font-weight: 600;
}

.loading {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 20px 40px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
}

.loading.show {
    display: block;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #4CAF50;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error {
    color: #f44336;
    padding: 12px;
    background: #ffebee;
    border-radius: 4px;
    margin: 10px 20px;
    display: none;
}

.error.show {
    display: block;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #999;
    text-align: center;
}

.empty-state .icon {
    font-size: 48px;
    margin-bottom: 16px;
}