
.char-counter {
    background: #40444b;
    padding: 8px 12px;
    border-radius: 4px;
    font-weight: 500;
    font-size: 0.85rem;
    color: #b9bbbe;
    border: 1px solid #202225;
    height: 32px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
}

.char-counter.warning {
    background: #faa61a;
    color: #ffffff;
    border-color: #faa61a;
}

.char-counter.danger {
    background: #f04747;
    color: #ffffff;
    border-color: #f04747;
}

.nitro-toggle-small {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #40444b;
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid #202225;
    transition: background-color 0.2s ease;
    height: 32px;
    box-sizing: border-box;
}

.nitro-toggle-small:hover {
    background: #484c52;
}

.toggle-switch-small {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.toggle-switch-small input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider-small {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #4f545c;
    transition: 0.4s;
    border-radius: 20px;
}

.slider-small:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: #ffffff;
    transition: 0.4s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

input:checked + .slider-small {
    background: #5865f2;
}

input:checked + .slider-small:before {
    transform: translateX(20px);
}

.toggle-label-small {
    font-weight: 500;
    font-size: 0.85rem;
    color: #b9bbbe;
}

#markdownInput {
    width: 100%;
    height: 400px;
    padding: 15px;
    border: none;
    border-radius: 6px;
    background: #40444b;
    color: #dcddde;
    font-size: 0.95rem;
    line-height: 1.5;
    resize: vertical;
    font-family: 'Whitney', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    border: 1px solid #202225;
    transition: border-color 0.2s ease;
    overflow-y: auto;
}

#markdownInput:focus {
    outline: none;
    border-color: #5865f2;
    box-shadow: 0 0 0 2px rgba(88, 101, 242, 0.3);
}

#markdownInput::placeholder {
    color: #72767d;
}

/* Markdown Toolbar */
.markdown-toolbar {
    display: flex;
    flex-wrap: nowrap;
    gap: 2px;
    padding: 8px;
    background: #40444b;
    border: 1px solid #202225;
    border-radius: 6px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    overflow-x: auto;
    justify-content: flex-start;
}

.toolbar-group {
    display: flex;
    gap: 2px;
    align-items: center;
    padding: 0 2px;
    border-right: 1px solid #202225;
    flex-shrink: 0;
}

.toolbar-group:last-child {
    border-right: none;
}

.toolbar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #2f3136;
    border: 1px solid #202225;
    border-radius: 4px;
    color: #b9bbbe;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0;
    padding: 0;
    flex-shrink: 0;
}

.toolbar-btn:hover {
    background: #484c52;
    color: #ffffff;
    border-color: #4f545c;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.toolbar-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.toolbar-btn.active {
    background: #5865f2;
    color: #ffffff;
    border-color: #4752c4;
}

.toolbar-btn svg {
    flex-shrink: 0;
    pointer-events: none;
    width: 14px;
    height: 14px;
}

.heading-text {
    font-weight: 700;
    font-size: 11px;
    color: inherit;
    pointer-events: none;
    font-family: 'Inter', 'Whitney', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* Toolbar responsive design */
@media (max-width: 768px) {
    .markdown-toolbar {
        padding: 6px;
        gap: 1px;
        flex-wrap: wrap;
    }
    
    .toolbar-group {
        gap: 1px;
        padding: 0 1px;
    }
    
    .toolbar-btn {
        width: 26px;
        height: 26px;
    }
    
    .toolbar-btn svg {
        width: 12px;
        height: 12px;
    }
}

@media (max-width: 480px) {
    .markdown-toolbar {
        flex-direction: column;
        align-items: stretch;
        flex-wrap: nowrap;
    }
    
    .toolbar-group {
        justify-content: center;
        border-right: none;
        border-bottom: 1px solid #202225;
        padding: 4px 0;
        gap: 2px;
    }
    
    .toolbar-group:last-child {
        border-bottom: none;
    }
    
    .toolbar-btn {
        width: 32px;
        height: 32px;
    }
    
    .toolbar-btn svg {
        width: 14px;
        height: 14px;
    }
}

/* Custom scrollbar for input field */
#markdownInput::-webkit-scrollbar {
    width: 8px;
}

#markdownInput::-webkit-scrollbar-track {
    background: #2f3136;
    border-radius: 4px;
}

#markdownInput::-webkit-scrollbar-thumb {
    background: #4f545c;
    border-radius: 4px;
    border: 1px solid #2f3136;
}

#markdownInput::-webkit-scrollbar-thumb:hover {
    background: #5d6269;
}

#markdownInput::-webkit-scrollbar-thumb:active {
    background: #6a6f77;
}

/* Firefox scrollbar */
#markdownInput {
    scrollbar-width: thin;
    scrollbar-color: #4f545c #2f3136;
}

.preview-content {
    min-height: 464px;
    padding: 15px;
    background: #36393f;
    border-radius: 6px;
    border: 1px solid #202225;
    font-family: 'Whitney', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    line-height: 1.5;
    overflow-y: auto;
    overflow-x: hidden;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    max-width: 100%;
    box-sizing: border-box;
}

/* Custom scrollbar for preview content */
.preview-content::-webkit-scrollbar {
    width: 8px;
}

.preview-content::-webkit-scrollbar-track {
    background: #2f3136;
    border-radius: 4px;
}

.preview-content::-webkit-scrollbar-thumb {
    background: #4f545c;
    border-radius: 4px;
    border: 1px solid #2f3136;
}

.preview-content::-webkit-scrollbar-thumb:hover {
    background: #5d6269;
}

.preview-content::-webkit-scrollbar-thumb:active {
    background: #6a6f77;
}

/* Firefox scrollbar for preview */
.preview-content {
    scrollbar-width: thin;
    scrollbar-color: #4f545c #2f3136;
}

.preview-content .placeholder {
    color: #72767d;
    font-style: italic;
    text-align: center;
    margin-top: 150px;
}

.preview-info {
    color: #b9bbbe;
    font-size: 0.85rem;
}

/* Discord-like markdown styling */
.preview-content strong {
    font-weight: 700;
    word-wrap: break-word;
    word-break: break-word;
}

.preview-content em {
    font-style: italic;
    word-wrap: break-word;
    word-break: break-word;
}

.preview-content u {
    text-decoration: underline;
    word-wrap: break-word;
    word-break: break-word;
}

.preview-content s {
    text-decoration: line-through;
    word-wrap: break-word;
    word-break: break-word;
}

.preview-content h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    margin: 8px 0 1px 0;
    word-wrap: break-word;
    word-break: break-word;
}

.preview-content h2 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #ffffff;
    margin: 6px 0 1px 0;
    word-wrap: break-word;
    word-break: break-word;
}

.preview-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
    margin: 5px 0 1px 0;
    word-wrap: break-word;
    word-break: break-word;
}

.preview-content code {
    background: #2f3136;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    color: #e3e3e3;
    border: 1px solid #202225;
    word-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
}

.preview-content pre {
    background: #2f3136;
    padding: 15px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 10px 0;
    border: 1px solid #202225;
    word-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
}

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

.preview-content blockquote {
    border-left: 4px solid #5865f2;
    padding-left: 15px;
    margin: 10px 0;
    color: #dcddde;
    font-style: italic;
    background: #2f3136;
    padding: 10px 15px;
    border-radius: 0 6px 6px 0;
    word-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
}

.preview-content .spoiler {
    background: #202225;
    color: #202225;
    padding: 2px 4px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid #202225;
    word-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
}

.preview-content .spoiler:hover {
    background: #2f3136;
    color: #dcddde;
}

.preview-content a {
    color: #00b0f4;
    text-decoration: none;
    transition: color 0.3s ease;
    word-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
}

.preview-content a:hover {
    color: #0099cc;
    text-decoration: underline;
}

.preview-content ul, .preview-content ol {
    margin: 10px 0;
    padding-left: 20px;
    word-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
}

.preview-content li {
    margin: 5px 0;
    color: #dcddde;
    word-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
}

.preview-content ul {
    list-style-type: disc;
}

.preview-content ol {
    list-style-type: decimal;
}

/* Responsive design */
@media (max-width: 768px) {
    .editor-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .container {
        padding: 15px;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    .help-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .help-item {
        flex-direction: column;
        text-align: center;
        gap: 8px;
        padding: 12px;
        min-height: auto;
    }
    
    .help-item span {
        text-align: center;
        font-size: 0.9rem;
        min-width: auto;
        max-width: none;
        width: 100%;
        order: 1;
    }
    
    .help-item code {
        min-width: auto;
        max-width: none;
        width: 100%;
        padding: 8px 12px;
        font-size: 0.9rem;
        order: 2;
    }
    
    .help-category h4 {
        text-align: center;
    }
    
    .header-controls {
        flex-direction: column;
        gap: 8px;
        align-items: flex-end;
    }
    
    .copy-button {
        align-self: flex-end;
        font-size: 0.8rem;
        padding: 6px 10px;
        height: 28px;
    }
    
    .clear-button {
        align-self: flex-end;
        font-size: 0.8rem;
        padding: 6px 10px;
        height: 28px;
    }
    
    .char-counter {
        align-self: flex-end;
        font-size: 0.8rem;
        padding: 6px 10px;
        height: 28px;
    }
    
    .nitro-toggle-small {
        align-self: flex-end;
        padding: 6px 10px;
        height: 28px;
    }
}
