/* modals.css — Modal overlays, headers, bodies, footers, post preview, and upload styles */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9998
}

.modal-overlay.show {
    display: flex
}

.modal {
    background: var(--bg2);
    border-radius: 16px;
    width: 560px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12)
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border)
}

.modal-title {
    font-size: 16px;
    font-weight: 700
}

.modal-close {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    background: var(--bg3);
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text3);
    transition: all .12s
}

.modal-close:hover {
    background: var(--bg4);
    color: var(--text)
}

.modal-body {
    padding: 20px 24px
}

.modal-footer {
    padding: 14px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 8px
}

.channel-select {
    display: flex;
    gap: 6px
}

.cs-item {
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all .12s;
    font-family: inherit;
    background: var(--bg2);
    color: var(--text2)
}

.cs-item:hover,
.cs-item.selected {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-bg)
}

.cs-item .cs-check { display: none; margin-left: 4px; font-size: 11px }
.cs-item.selected .cs-check { display: inline }

.char-count { font-size: 11px; color: var(--text3); text-align: right; margin-top: 4px }
.char-count.over { color: var(--red); font-weight: 600 }

.upload-drop-area {
    border: 2px dashed var(--border2); border-radius: 10px; background: var(--bg3);
    padding: 24px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; margin-top: 8px
}
.upload-drop-area:hover { border-color: var(--accent); background: var(--accent-bg) }
.upload-drop-area .upload-icon { font-size: 28px; color: var(--text3); margin-bottom: 6px }
.upload-drop-area .upload-text { font-size: 12px; color: var(--text3); font-weight: 500 }

.ai-gen-spinner {
    display: inline-block; width: 14px; height: 14px; border: 2px solid var(--border2);
    border-top-color: var(--accent); border-radius: 50%; animation: spin .6s linear infinite;
    vertical-align: middle; margin-right: 6px
}
@keyframes spin { to { transform: rotate(360deg) } }

.optimal-toggle-row { display: flex; align-items: center; gap: 10px; margin-top: 10px }
.optimal-toggle-label { font-size: 12px; color: var(--text2); font-weight: 500 }

.post-preview-panel {
    margin-top: 12px; background: var(--bg3); border: 1px solid var(--border);
    border-radius: 10px; padding: 14px; display: none
}
.post-preview-panel.show { display: block }
.post-preview-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 12px; font-weight: 600; color: var(--text2) }
.post-preview-header .ch { flex-shrink: 0 }
.post-preview-body { font-size: 13px; color: var(--text); line-height: 1.5; white-space: pre-wrap; word-break: break-word }
