/* TipTap Editor Custom Styling */
.tiptap-editor {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Toolbar */
.tiptap-editor .tiptap-toolbar {
    background: linear-gradient(to bottom, #f8fafc, #f1f5f9);
    border-bottom: 2px solid #e2e8f0;
    padding: 10px 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.tiptap-editor .tiptap-toolbar .toolbar-group {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 0 4px;
    border-right: 1px solid #e2e8f0;
}

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

.tiptap-editor .tiptap-toolbar button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s ease;
}

.tiptap-editor .tiptap-toolbar button:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.tiptap-editor .tiptap-toolbar button.active {
    background: #dc2626;
    color: white;
    box-shadow: 0 1px 2px rgba(220, 38, 38, 0.3);
}

.tiptap-editor .tiptap-toolbar button svg {
    width: 16px;
    height: 16px;
}

.tiptap-editor .tiptap-toolbar select {
    height: 32px;
    padding: 0 8px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    font-size: 13px;
    color: #475569;
    cursor: pointer;
}

/* Content Area */
.tiptap-editor .tiptap-prosemirror-wrapper {
    min-height: 700px !important;
    max-height: none !important;
}

.tiptap-editor .tiptap-content {
    min-height: 700px;
    padding: 24px 32px;
    font-size: 16px;
    line-height: 1.8;
    color: #1e293b;
}

.tiptap-editor .ProseMirror {
    min-height: 700px;
    padding: 24px 32px;
    font-size: 16px;
    line-height: 1.8;
}

.tiptap-editor .tiptap-content:focus {
    outline: none;
}

.tiptap-editor .tiptap-content > *:first-child {
    margin-top: 0;
}

/* Typography */
.tiptap-editor .tiptap-content h1 {
    font-size: 2em;
    font-weight: 800;
    color: #0f172a;
    margin: 1em 0 0.5em;
    line-height: 1.2;
}

.tiptap-editor .tiptap-content h2 {
    font-size: 1.5em;
    font-weight: 700;
    color: #0f172a;
    margin: 0.8em 0 0.4em;
    line-height: 1.3;
    padding-bottom: 0.3em;
    border-bottom: 2px solid #f1f5f9;
}

.tiptap-editor .tiptap-content h3 {
    font-size: 1.25em;
    font-weight: 600;
    color: #1e293b;
    margin: 0.8em 0 0.4em;
}

.tiptap-editor .tiptap-content p {
    margin: 0.75em 0;
}

.tiptap-editor .tiptap-content blockquote {
    border-left: 4px solid #dc2626;
    padding: 12px 20px;
    margin: 1.5em 0;
    background: #fef2f2;
    border-radius: 0 8px 8px 0;
    color: #64748b;
    font-style: italic;
}

.tiptap-editor .tiptap-content code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: 'JetBrains Mono', monospace;
    color: #dc2626;
}

.tiptap-editor .tiptap-content pre {
    background: #1e293b;
    color: #e2e2e6;
    padding: 20px;
    border-radius: 10px;
    overflow-x: auto;
    margin: 1.5em 0;
}

.tiptap-editor .tiptap-content pre code {
    background: none;
    padding: 0;
    color: inherit;
    font-size: 14px;
}

.tiptap-editor .tiptap-content ul,
.tiptap-editor .tiptap-content ol {
    padding-left: 2em;
    margin: 0.75em 0;
}

.tiptap-editor .tiptap-content li {
    margin: 0.25em 0;
}

.tiptap-editor .tiptap-content ul li::marker {
    color: #dc2626;
}

.tiptap-editor .tiptap-content ol li::marker {
    color: #dc2626;
    font-weight: 600;
}

.tiptap-editor .tiptap-content hr {
    border: none;
    height: 2px;
    background: linear-gradient(to right, #e2e8f0, #cbd5e1, #e2e8f0);
    margin: 2em 0;
}

.tiptap-editor .tiptap-content a {
    color: #dc2626;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.tiptap-editor .tiptap-content a:hover {
    color: #b91c1c;
}

.tiptap-editor .tiptap-content img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 1.5em 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.tiptap-editor .tiptap-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 1.5em 0;
    border-radius: 8px;
    overflow: hidden;
}

.tiptap-editor .tiptap-content table th {
    background: #f8fafc;
    font-weight: 600;
    text-align: left;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
}

.tiptap-editor .tiptap-content table td {
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
}

.tiptap-editor .tiptap-content table tr:hover {
    background: #f8fafc;
}

/* Lead paragraph */
.tiptap-editor .tiptap-content .lead {
    font-size: 1.25em;
    color: #64748b;
    line-height: 1.6;
}

/* Small text */
.tiptap-editor .tiptap-content small {
    font-size: 0.875em;
    color: #94a3b8;
}

/* Checked list */
.tiptap-editor .tiptap-content ul[data-type="taskList"] {
    list-style: none;
    padding-left: 0;
}

.tiptap-editor .tiptap-content ul[data-type="taskList"] li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.tiptap-editor .tiptap-content ul[data-type="taskList"] li label {
    margin-top: 4px;
}

/* Placeholder */
.tiptap-editor .tiptap-content p.is-editor-empty:first-child::before {
    content: 'Tulis konten artikel di sini...';
    float: left;
    color: #94a3b8;
    pointer-events: none;
    height: 0;
}

/* Selection */
.tiptap-editor .tiptap-content ::selection {
    background: rgba(220, 38, 38, 0.2);
}

/* Responsive */
@media (max-width: 768px) {
    .tiptap-editor .tiptap-content {
        padding: 16px;
        min-height: 300px;
    }
    
    .tiptap-editor .tiptap-toolbar {
        padding: 8px;
        gap: 4px;
    }
    
    .tiptap-editor .tiptap-toolbar button {
        width: 28px;
        height: 28px;
    }
}
