* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #f9fafb;
}

/* Header */
header {
    background-color: #fbdb5b;
    border-bottom: 1px solid #e5c84f;
    padding: 12px 0;
}

.header-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    text-decoration: none;
}

.logo .just {
    color: #1f2937;
}

.logo .paste {
    color: #d03b44;
}

.logo .it {
    color: #1f2937;
}

.header-buttons {
    display: flex;
    gap: 8px;
}

/* Buttons */
.btn {
    padding: 10px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background-color: #d03b44;
    color: white;
}

.btn-primary:hover {
    background-color: #b02f38;
}

.btn-outline {
    background-color: transparent;
    color: #d03b44;
    border: 1px solid #d03b44;
}

.btn-outline:hover {
    background-color: #d03b44;
    color: white;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Main Content */
main {
    flex: 1;
    padding: 40px 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

.editor-card {
    background: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: #3b82f6;
}

/* Toolbar */
.toolbar {
    display: flex;
    gap: 2px;
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
    flex-wrap: wrap;
}

.toolbar-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.toolbar-btn:hover {
    background-color: #e5e7eb;
}

.toolbar-separator {
    width: 1px;
    background-color: #d1d5db;
    margin: 0 6px;
}

/* Text Editor */
.text-editor {
    width: 100%;
    min-height: 400px;
    padding: 12px;
    border: 2px solid #3b82f6;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
}

.text-editor:focus {
    outline: none;
    border-color: #2563eb;
}

/* Footer */
footer {
    background-color: #f3f4f6;
    border-top: 1px solid #e5e7eb;
    padding: 16px 20px;
    margin-top: auto;
}

.footer-container {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #6b7280;
    flex-wrap: wrap;
    gap: 12px;
}

.footer-links {
    display: flex;
    gap: 20px;
    list-style: none;
}

.footer-links a {
    color: #6b7280;
    text-decoration: none;
}

.footer-links a:hover {
    color: #1f2937;
}

/* Paste View */
.paste-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.paste-title {
    font-size: 28px;
    font-weight: bold;
    color: #1f2937;
}

.paste-meta {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 24px;
}

.paste-content {
    white-space: pre-wrap;
    line-height: 2;
    color: #374151;
    word-wrap: break-word;      /* pecah kata panjang */
}

.btn-copy {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Alert Messages */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* 404 Page */
.error-page {
    text-align: center;
    padding: 60px 20px;
}

.error-page h1 {
    font-size: 64px;
    font-weight: bold;
    color: #1f2937;
    margin-bottom: 16px;
}

.error-page p {
    font-size: 18px;
    color: #6b7280;
    margin-bottom: 24px;
}

/* Rich Text Editor Styles */
.rich-text-editor {
    border: 2px solid #3b82f6;
    border-radius: 6px;
    overflow: hidden;
}

.editor-toolbar {
    display: flex;
    gap: 2px;
    padding: 8px;
    background: #f8f9fa;
    border-bottom: 1px solid #e5e7eb;
    flex-wrap: wrap;
}

.editor-content {
    min-height: 400px;
    padding: 12px;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.6;
    outline: none;
    background: white;
}

.editor-content:focus {
    outline: none;
}

.editor-content ul, .editor-content ol {
    padding-left: 24px;
    margin: 8px 0;
}

.editor-content pre {
    background: #f3f4f6;
    padding: 12px;
    border-radius: 4px;
    border-left: 4px solid #3b82f6;
    font-family: 'Courier New', monospace;
    overflow-x: auto;
}

/* Paste Actions */
.paste-actions {
    display: flex;
    gap: 8px;
}

.paste-id {
    color: #6b7280;
    font-size: 12px;
    margin-left: 16px;
}

/* Link styles in content */
.paste-content a {
    color: #3b82f6;
    text-decoration: underline;
}

.paste-content a:hover {
    color: #2563eb;
}

/* Code block styling */
.paste-content pre {
    background: #1f2937;
    color: #e5e7eb;
    padding: 16px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 12px 0;
}

.paste-content code {
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

/* Tambahkan di style.css */
.pastes-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.paste-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.paste-item:hover {
    background-color: #f9fafb;
}

.paste-title-link {
    color: #374151;
    text-decoration: none;
    font-weight: 500;
    flex: 1;
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.paste-title-link:hover {
    color: #d03b44;
}

.paste-date {
    color: #6b7280;
    font-size: 12px;
}

/* TinyMCE Custom Styles */
.tox-tinymce {
    border-radius: 6px !important;
    border: 2px solid #3b82f6 !important;
}

.tox .tox-toolbar {
    display: flex !important;
    flex-wrap: nowrap !important; /* paksa 1 baris, sliding akan aktif */
    overflow-x: auto !important;  /* bisa geser horizontal jika overflow */
    -webkit-overflow-scrolling: touch; /* smooth scroll di iOS */
}
/* Tambahkan padding kanan agar tombol terakhir tidak mentok */
.tox .tox-toolbar__overflow {
    padding-right: 8px;
}
.tox .tox-tbtn {
    color: #374151 !important;
}

.tox .tox-tbtn:hover {
    background: #e5e7eb !important;
}

.tox .tox-tbtn--enabled {
    background: #dbeafe !important;
    color: #1e40af !important;
}

/* Paste Content Styles for HTML */
.paste-content {
    line-height: 2;
    color: #374151;
}

.paste-content p {
    margin-bottom: 1em;
}

.paste-content ul, .paste-content ol {
    margin-bottom: 1em;
    padding-left: 2em;
}

.paste-content li {
    margin-bottom: 0.5em;
}

.paste-content h1, 
.paste-content h2, 
.paste-content h3, 
.paste-content h4, 
.paste-content h5, 
.paste-content h6 {
    margin: 1.5em 0 0.5em 0;
    color: #1f2937;
    font-weight: bold;
}

.paste-content h1 { font-size: 1.8em; }
.paste-content h2 { font-size: 1.5em; }
.paste-content h3 { font-size: 1.3em; }
.paste-content h4 { font-size: 1.1em; }
.paste-content h5 { font-size: 1em; }
.paste-content h6 { font-size: 0.9em; }

.paste-content a {
    color: #3b82f6;
    text-decoration: underline;
}

.paste-content a:hover {
    color: #2563eb;
}

.paste-content code {
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.paste-content pre {
    background: #1f2937;
    color: #e5e7eb;
    padding: 16px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 12px 0;
    font-family: 'Courier New', monospace;
    line-height: 1.4;
}

.paste-content blockquote {
    border-left: 4px solid #d1d5db;
    padding-left: 1em;
    margin: 1em 0;
    color: #6b7280;
    font-style: italic;
}

.paste-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
}

.paste-content table, 
.paste-content th, 
.paste-content td {
    border: 1px solid #d1d5db;
}

.paste-content th, 
.paste-content td {
    padding: 8px 12px;
    text-align: left;
}

.paste-content th {
    background: #f3f4f6;
    font-weight: bold;
}

.paste-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

/* Paste Actions */
.paste-actions {
    display: flex;
    gap: 8px;
}

.paste-id {
    color: #6b7280;
    font-size: 12px;
    margin-left: 16px;
}

/* Responsive CSS */

/* Untuk layar ≤ 768px */
@media (max-width: 768px) {
    /* Paste Header & Actions */
    .paste-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .paste-actions {
        width: 100%;
        justify-content: flex-start;
    }

    /* Editor toolbar */
    .editor-toolbar {
        justify-content: center;
    }

    /* TinyMCE toolbar */
    .tox .tox-toolbar {
        flex-wrap: wrap !important;
    }
}

/* Untuk layar ≤ 640px */
@media (max-width: 640px) {
    .header-container {
        flex-direction: column;
        gap: 12px;
    }

    .footer-container {
        flex-direction: column;
        text-align: center;
    }

    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* Toolbar compact di mobile */
@media (max-width: 480px) {
    .tox-toolbar {
        overflow-x: auto; /* biar bisa scroll horizontal jika tombol panjang */
    }
    
    .tox-toolbar__overflow {
        display: inline-flex; /* tombol "..." muncul */
    }

    /* Optional: kurangi jarak antar tombol agar lebih rapih */
    .tox-toolbar__group button.tox-tbtn {
        width: 32px !important;
        height: 32px !important;
        padding: 0 !important;
        margin-right: 2px;
    }
    .editor-card {
    background: white;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
}