/* ============================================================
   Cabin – Workspace / Editor CSS
   ============================================================ */

/* ─────────────────────────────────────────────
   Layout
────────────────────────────────────────── */
.workspace-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: var(--space-6);
    min-height: calc(100vh - 60px);
    padding: var(--space-6);
    max-width: 1200px;
    margin: 0 auto;
}

/* ─────────────────────────────────────────────
   Editor Panel
────────────────────────────────────────── */
.workspace-editor {
    display: flex;
    flex-direction: column;
    background: var(--color-white);
    border-radius: var(--radius-2xl);
    border: 1.5px solid var(--color-border-subtle);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.workspace-editor__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-6);
    border-bottom: 1px solid var(--color-border-subtle);
    background: var(--color-bg-alt);
}

.workspace-title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
}

.workspace-meta {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.char-counter {
    font-size: var(--font-size-xs);
    font-family: var(--font-mono);
    color: var(--color-text-muted);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    padding: 3px 8px;
    border-radius: var(--radius-sm);
}

.char-counter.near-limit {
    color: var(--color-warning);
    border-color: var(--color-warning);
}

.char-counter.at-limit {
    color: var(--color-danger);
    border-color: var(--color-danger);
}

.note-textarea {
    flex: 1;
    width: 100%;
    padding: var(--space-6);
    border: none;
    outline: none;
    resize: none;
    font-family: var(--font-family);
    font-size: var(--font-size-md);
    line-height: var(--line-height-relaxed);
    color: var(--color-text-primary);
    background: var(--color-white);
    min-height: 400px;
}

.note-textarea::placeholder {
    color: var(--color-text-muted);
}

/* Image Strip */
.image-strip {
    border-top: 1px solid var(--color-border-subtle);
    padding: var(--space-4) var(--space-6);
    background: var(--color-bg-alt);
}

.image-strip__inner {
    display: flex;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.image-strip-thumb {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 2px solid var(--color-border);
}

.image-strip-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-strip-thumb__remove {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.image-strip-thumb__remove:hover {
    background: var(--color-danger);
}

/* ─────────────────────────────────────────────
   Settings Panel
────────────────────────────────────────── */
.workspace-settings {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    position: sticky;
    top: var(--space-6);
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    scrollbar-width: thin;
}

.settings-card {
    background: var(--color-white);
    border-radius: var(--radius-2xl);
    border: 1.5px solid var(--color-border-subtle);
    padding: var(--space-6);
    box-shadow: var(--shadow-sm);
}

.settings-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--color-border-subtle);
}

.settings-card__header h2 {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
}

.settings-field {
    margin-bottom: var(--space-5);
}

.settings-label {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-2);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.settings-label--optional {
    font-weight: var(--font-weight-regular);
    text-transform: none;
    letter-spacing: 0;
    color: var(--color-text-muted);
    opacity: 0.7;
}

.settings-select {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-family: var(--font-family);
    color: var(--color-text-primary);
    background: var(--color-white);
    outline: none;
    cursor: pointer;
    transition: var(--transition-fast);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.settings-select:focus {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-glow);
}

.settings-input {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    color: var(--color-text-primary);
    background: var(--color-white);
    outline: none;
    transition: var(--transition-fast);
}

.settings-input:focus {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-glow);
}

.settings-input::placeholder {
    color: var(--color-text-muted);
}

.settings-hint {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    margin-top: var(--space-2);
    line-height: var(--line-height-relaxed);
}

/* ─────────────────────────────────────────────
   Dropzone
────────────────────────────────────────── */
.dropzone {
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-6) var(--space-4);
    text-align: center;
    cursor: pointer;
    transition: var(--transition-fast);
    background: var(--color-bg-alt);
}

.dropzone:hover,
.dropzone.drag-over {
    border-color: var(--color-primary);
    background: var(--color-blue-bg);
}

.dropzone__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    color: var(--color-text-muted);
}

.dropzone__content svg {
    color: var(--color-text-muted);
    margin-bottom: var(--space-1);
}

.dropzone__content p {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-secondary);
}

.dropzone__content span {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

/* Upload progress */
.upload-progress {
    height: 4px;
    background: var(--color-border);
    border-radius: var(--radius-full);
    margin-top: var(--space-2);
    overflow: hidden;
}

.upload-progress__bar {
    height: 100%;
    background: var(--gradient-brand);
    border-radius: var(--radius-full);
    width: 0%;
    transition: width 0.3s ease;
}

/* Upload list */
.upload-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-top: var(--space-3);
}

.upload-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    background: var(--color-bg-alt);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border-subtle);
}

.upload-item__thumb {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
}

.upload-item__info {
    flex: 1;
    min-width: 0;
}

.upload-item__name {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.upload-item__size {
    font-size: 10px;
    color: var(--color-text-muted);
}

.upload-item__status {
    font-size: 10px;
    font-weight: var(--font-weight-semibold);
    padding: 2px 6px;
    border-radius: var(--radius-full);
}

.upload-item__status--ok {
    background: var(--color-green-bg);
    color: #16a34a;
}

.upload-item__status--error {
    background: var(--color-red-bg);
    color: var(--color-danger);
}

/* Draft indicator */
.draft-indicator {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    padding: var(--space-2) var(--space-4);
}

/* Note meta display in success modal */
.note-meta-display {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.note-meta-display .badge {
    font-size: var(--font-size-xs);
}

/* ─────────────────────────────────────────────
   Workspace Responsive
────────────────────────────────────────── */
@media (max-width: 900px) {
    .workspace-layout {
        grid-template-columns: 1fr;
        padding: var(--space-4);
    }

    .workspace-settings {
        position: static;
        max-height: none;
    }

    .note-textarea {
        min-height: 250px;
    }
}
