:root {
    --primary-color: #1DA1F2;
    --background-color: #15202B;
    --text-color: #FFFFFF;
    --secondary-background: #192734;
    --border-color: #38444D;
    --error-color: #E0245E;
    --success-color: #17BF63;
    --sidebar-width: 400px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.drafts-sidebar {
    width: 390px;
    background-color: var(--secondary-background);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.drafts-header {
    padding: 2rem;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.drafts-header h1 {
    font-size: 1.75rem;
    line-height: 1.2;
    margin-bottom: 0.25rem;
    color: var(--text-color);
}

.drafts-header .subtitle {
    color: #8899A6;
    font-size: 0.875rem;
    line-height: 1.4;
    opacity: 0.8;
}

.drafts-list-header {
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.drafts-list-header h2 {
    font-size: 1.1rem;
    color: var(--text-color);
    font-weight: 600;
}

.drafts-header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

#importDraft {
    display: flex;
    align-items: center;
    justify-content: center;
}

#importDraft svg {
    width: 20px;
    height: 20px;
    fill: white;
}

.drafts-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.draft-item {
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.draft-item:hover {
    border-color: var(--primary-color);
}

.draft-item.active {
    border-color: var(--primary-color);
    background-color: rgba(29, 161, 242, 0.1);
}

.post-thread-btn {
    min-width: 32px;
    min-height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.draft-item:hover .post-thread-btn {
    display: flex;
    opacity: 0.7;
}

.post-thread-btn:hover,
.delete-thread-btn:hover {
    opacity: 1;
    background-color: rgba(23, 191, 99, 0.1);
}

.post-thread-btn svg {
    width: 18px;
    height: 18px;
    fill: var(--success-color) !important;
}

.export-thread-btn svg {
    width: 18px;
    height: 18px;
    fill: var(--primary-color) !important;
}

.export-thread-btn:hover {
    opacity: 1;
    background-color: rgba(29, 161, 242, 0.1);
}

.delete-thread-btn {
    min-width: 32px;
    min-height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.delete-thread-btn svg {
    width: 18px;
    height: 18px;
    fill: var(--error-color) !important;
}

.draft-content {
    flex: 1;
    min-width: 0;
}

.draft-item-title {
    font-weight: 500;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.draft-item-date {
    font-size: 0.875rem;
    color: #8899A6;
}

.main-content {
    flex: 1;
    overflow-y: auto;
    height: 100vh;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

.controls {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn.primary {
    background-color: var(--primary-color);
    color: white;
    font-size: 1.2rem;
    line-height: 1;
    min-width: 42px;
    min-height: 42px;
    padding: 0.5rem 1rem;
}

.btn.secondary {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

.btn.danger {
    background-color: transparent;
    border: 1px solid var(--error-color);
    color: var(--error-color);
}

.btn:hover {
    opacity: 0.9;
}

.btn.danger:hover {
    background-color: var(--error-color);
    color: white;
}

.character-count {
    font-size: 0.875rem;
    color: #8899A6;
}

.character-count.over {
    color: var(--error-color);
}

.image-preview {
    margin-top: 1rem;
    max-width: 100%;
    border-radius: 8px;
    position: relative;
}

.image-preview img {
    max-width: 100%;
    border-radius: 8px;
}

.remove-image-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    padding: 6px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.remove-image-btn svg {
    width: 20px;
    height: 20px;
    fill: white;
}

.image-preview:hover .remove-image-btn {
    opacity: 1;
}

.remove-image-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

footer {
    text-align: center;
    color: #8899A6;
    font-size: 0.875rem;
}

@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }

    .drafts-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .drafts-list {
        max-height: 200px;
    }

    .container {
        padding: 1rem;
    }
}

.thread-container {
    background-color: var(--secondary-background);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.quote-url-input {
    width: 100%;
    background-color: var(--secondary-background);
    border-radius: 16px;
    padding: 1rem;
    margin-bottom: 1rem;
    color: var(--text-color);
    font-size: 1rem;
    border: 1px solid var(--border-color);
    outline: none;
    min-height: 3rem;
}

.quote-url-input:empty:before {
    content: attr(placeholder);
    color: #8899A6;
}

.quote-url-input:focus {
    border-color: var(--primary-color);
}

.thread-posts {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.post {
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    position: relative;
}

.post-content {
    min-height: 100px;
    padding: 1rem;
    border-radius: 8px;
    background: var(--background-color);
    margin-bottom: 0.5rem;
    white-space: pre-wrap;
    word-break: break-word;
    unicode-bidi: plaintext;
    text-align: start;
}

.post-content .url {
    color: var(--primary-color);
    text-decoration: none;
    cursor: pointer;
}

.post-content:empty:before {
    content: attr(placeholder);
    color: #8899A6;
}

.post-content:focus {
    outline: none;
}

.post-content .over-limit {
    color: var(--error-color);
}

.post-content::selection {
    background-color: var(--primary-color);
    color: white;
}

.post-content::-moz-selection {
    background-color: var(--primary-color);
    color: white;
}

.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
}

.post-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.icon-btn {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    min-width: 32px;
    min-height: 32px;
}

.icon-btn:hover {
    opacity: 1;
    background-color: rgba(255, 255, 255, 0.1);
}

.icon-btn svg {
    width: 18px;
    height: 18px;
    fill: var(--text-color);
}

.icon-btn.delete-post-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: rgba(0, 0, 0, 0.6);
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 1;
}

.post:hover .icon-btn.delete-post-btn {
    opacity: 1;
}

.icon-btn.delete-post-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.icon-btn.delete-post-btn svg {
    fill: var(--error-color);
}

.copy-icon-btn {
    display: flex;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: #8899A6;
    font-size: 1rem;
}

.image-input {
    display: none;
}

.draft-actions {
    display: none;
    gap: 0.5rem;
    align-items: center;
}

.draft-item:hover .draft-actions {
    display: flex;
}

.lock-thread-btn {
    min-width: 32px;
    min-height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.lock-thread-btn svg {
    width: 18px;
    height: 18px;
    fill: var(--text-color);
}

.lock-thread-btn.locked svg {
    fill: var(--primary-color) !important;
}

.lock-thread-btn:hover {
    opacity: 1;
    background-color: rgba(29, 161, 242, 0.1);
}

.post-content[data-locked="true"] {
    cursor: not-allowed;
    user-select: none;
}

.post[data-locked="true"] .icon-btn:not(.delete-post-btn),
.post[data-locked="true"] .image-upload-btn {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.emoji-btn svg {
    width: 20px;
    height: 20px;
    fill: var(--primary-color);
}

.emoji-btn:hover svg {
    fill: var(--primary-color-hover);
}

.emoji-mart {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 1rem;
}

.image-container {
    position: relative;
    aspect-ratio: 16/9;
    border-radius: 8px;
    overflow: hidden;
    background-color: var(--secondary-background);
    border: 1px solid var(--border-color);
}

.image-preview {
    width: 100%;
    height: 100%;
    position: relative;
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.remove-image-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    padding: 6px;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 1;
}

.image-preview:hover .remove-image-btn {
    opacity: 1;
}

.remove-image-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.remove-image-btn svg {
    width: 20px;
    height: 20px;
    fill: white;
}

.image-upload-btn[disabled],
.image-input[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (max-width: 480px) {
    .image-grid {
        grid-template-columns: 1fr;
    }
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--background-color);
    border-radius: 16px;
    padding: 1.5rem;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    border: 1px solid var(--border-color);
}

.modal-header {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-content {
    flex: 1;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: var(--secondary-background);
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

.modal-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 999;
}

.execution-step {
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 1rem;
    background-color: var(--secondary-background);
}

.execution-step:last-child {
    margin-bottom: 0;
}

.step-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.step-number {
    font-weight: 600;
    color: var(--primary-color);
}

.step-status {
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    background-color: var(--background-color);
}

.step-status.pending {
    color: #8899A6;
}

.step-status.in-progress {
    color: var(--primary-color);
}

.step-status.completed {
    color: var(--success-color);
}

.step-status.error {
    color: var(--error-color);
}

.step-content {
    font-size: 0.875rem;
    line-height: 1.5;
    color: #8899A6;
}

.post-thread-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.post-thread-stepper {
    background: var(--secondary-background);
    padding: 2rem;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 50%;
    left: 10%;
    transform: translateY(-50%);
}

.stepper-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-shrink: 0;
}

.stepper-header h2 {
    margin: 0;
}

.steps-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.steps-container::-webkit-scrollbar {
    width: 8px;
}

.steps-container::-webkit-scrollbar-track {
    background: var(--background-color);
    border-radius: 4px;
}

.steps-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.steps-container::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

.cancel-btn {
    margin-top: auto;
    flex-shrink: 0;
}

.icon-btn.delete-post-btn.disabled,
.icon-btn.delete-thread-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.icon-btn.delete-post-btn.disabled svg,
.icon-btn.delete-thread-btn.disabled svg {
    fill: var(--text-color);
}

.post[data-locked="true"] .delete-post-btn {
    opacity: 0;
    cursor: not-allowed;
    pointer-events: none;
} 