/* Collection Management Interface Styles */

/* Main Container */
.collection-manage-container {
    min-height: 100vh;
    background: #f8fafc;
}

/* Cohesive Collections workflow — library, preparation, and shared steps */
.collections-flow-page {
    --collection-ink: #233a30;
    --collection-muted: #64746b;
    --collection-green: #315f4b;
    --collection-green-deep: #244b3a;
    --collection-gold: #b58a45;
    --collection-paper: #fbfaf6;
    --collection-sage: #edf4ee;
    --collection-line: #d9e3dc;
    color: var(--collection-ink);
}

.collection-flow-kicker,
.compose-section-number {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--collection-green);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

/* Collection library */
.collections-library-page .collections-section {
    position: relative;
    margin-top: 0;
    padding: clamp(1.25rem, 3vw, 2rem);
    overflow: hidden;
    border: 1px solid var(--collection-line);
    border-radius: 24px;
    background:
        radial-gradient(circle at 96% 4%, rgba(181, 138, 69, 0.11), transparent 25%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(247, 246, 239, 0.96));
    box-shadow: 0 16px 45px rgba(39, 63, 51, 0.07);
}

.collections-library-page .collections-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 310px), 1fr));
    gap: 1rem;
    margin-bottom: 0;
}

.collections-library-page .collection-card {
    min-height: 280px;
    border: 1px solid var(--collection-line);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 10px 28px rgba(39, 63, 51, 0.07);
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.collections-library-page .collection-card::after {
    content: "";
    position: absolute;
    right: -42px;
    bottom: -54px;
    width: 125px;
    height: 125px;
    border: 1px solid rgba(49, 95, 75, 0.1);
    border-radius: 50%;
    pointer-events: none;
}

.collections-library-page .collection-card:hover,
.collections-library-page .collection-card:focus-within {
    border-color: rgba(49, 95, 75, 0.32);
    box-shadow: 0 18px 42px rgba(39, 63, 51, 0.13);
    transform: translateY(-4px);
}

.collections-library-page .collection-top-row {
    min-height: 88px;
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid rgba(49, 95, 75, 0.1);
    border-radius: 20px 20px 0 0;
    background:
        radial-gradient(circle at 95% 0%, rgba(181, 138, 69, 0.18), transparent 43%),
        linear-gradient(135deg, #f4f1e7, #eef4ef);
}

.collections-library-page .collection-title {
    color: var(--collection-ink);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.38rem;
    font-weight: 500;
}

.collections-library-page .collection-bottom-row {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 1.2rem 1.25rem 1.35rem;
}

.collections-library-page .collection-description {
    color: var(--collection-muted);
    line-height: 1.6;
}

.collections-library-page .collection-meta {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.collections-library-page .collection-meta span {
    padding: 0.35rem 0.55rem;
    border-radius: 999px;
    background: var(--collection-sage);
    color: #52645a;
}

.collections-library-page .collection-speakers-label {
    margin-top: auto;
    color: var(--collection-muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.collections-library-page .collection-speakers {
    justify-content: flex-start;
    margin-bottom: 0;
}

.collections-library-page .speaker-avatar {
    width: 44px;
    height: 44px;
    margin-right: -0.35rem;
    border-color: #fff;
    box-shadow: 0 4px 12px rgba(39, 63, 51, 0.15);
}

.collections-library-page .collection-actions .btn,
.collections-flow-page .icon-btn {
    border-color: rgba(49, 95, 75, 0.16);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.74);
    color: var(--collection-green);
}

.collections-library-page .loading-spinner,
.collections-library-page .empty-collections {
    grid-column: 1 / -1;
    min-height: 300px;
    padding: 4rem 2rem;
    border: 1px dashed rgba(49, 95, 75, 0.25);
    border-radius: 18px;
    background: rgba(237, 244, 238, 0.55);
}

/* Shared modal treatment */
.collections-flow-page ~ .modal .modal-content,
.collections-library-page ~ .modal .modal-content,
.edit-collection-page ~ .modal .modal-content {
    overflow: hidden;
    border: 1px solid var(--collection-line, #d9e3dc);
    border-radius: 20px;
    box-shadow: 0 24px 75px rgba(28, 51, 41, 0.2);
}

.collections-flow-page ~ .modal .modal-header,
.collections-library-page ~ .modal .modal-header,
.edit-collection-page ~ .modal .modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom-color: #dfe7e1;
    background: linear-gradient(135deg, #f5f2e8, #edf4ee);
    color: #233a30;
}

.collections-flow-page ~ .modal .modal-body,
.collections-library-page ~ .modal .modal-body,
.edit-collection-page ~ .modal .modal-body {
    padding: 1.5rem;
}

.collections-flow-page ~ .modal .form-control,
.collections-library-page ~ .modal .form-control,
.edit-collection-page ~ .modal .form-control {
    min-height: 46px;
    border-color: #d7e1da;
    border-radius: 11px;
    background: #fbfcfa;
}

/* Progress rail shared by Prepare and Compose */
.collection-workflow-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: min(1180px, calc(100% - 2rem));
    margin: 0 auto 1.25rem;
    padding: 0.55rem;
    border: 1px solid var(--collection-line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 9px 28px rgba(39, 63, 51, 0.06);
}

.collection-workflow-step {
    position: relative;
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 0.7rem;
    padding: 0.75rem 0.85rem;
    border: 0;
    border-radius: 13px;
    background: transparent;
    color: #77857d;
    text-align: left;
    text-decoration: none;
}

button.collection-workflow-step {
    cursor: pointer;
}

.collection-workflow-step::after {
    content: "";
    position: absolute;
    top: 50%;
    right: -0.45rem;
    width: 0.9rem;
    height: 1px;
    background: #d9e3dc;
}

.collection-workflow-step:last-child::after {
    display: none;
}

.collection-workflow-step-number {
    display: grid;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    place-items: center;
    border: 1px solid #ccd8d0;
    border-radius: 50%;
    background: #f7f9f7;
    color: #65756c;
    font-size: 0.78rem;
    font-weight: 800;
}

.collection-workflow-step > span:last-child {
    display: grid;
    min-width: 0;
}

.collection-workflow-step b {
    color: inherit;
    font-size: 0.88rem;
}

.collection-workflow-step small {
    overflow: hidden;
    font-size: 0.72rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.collection-workflow-step.is-complete {
    color: var(--collection-green);
}

.collection-workflow-step.is-complete .collection-workflow-step-number {
    border-color: var(--collection-green);
    background: var(--collection-green);
    color: #fff;
}

.collection-workflow-step.is-active {
    background: linear-gradient(135deg, #edf4ee, #f6f2e8);
    color: var(--collection-ink);
}

.collection-workflow-step.is-active .collection-workflow-step-number {
    border-color: var(--collection-gold);
    background: var(--collection-gold);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(181, 138, 69, 0.12);
}

/* Prepare collection */
.collection-edit-workflow {
    width: min(1180px, calc(100% - 2rem));
    max-width: none;
    margin: 0 auto !important;
    padding: 2rem 0 4rem;
}

.collection-edit-workflow > .row {
    margin: 0;
}

.collection-edit-workflow > .row > [class*="col-"] {
    padding: 0;
}

.collection-edit-workflow .journal-page-toolbar--edit-collection {
    position: relative;
    width: 100%;
    min-height: 255px;
    margin: 0 0 1.25rem;
    padding: clamp(1.6rem, 4vw, 3rem);
    overflow: hidden;
    border: 1px solid rgba(49, 95, 75, 0.15);
    border-radius: 28px;
    background:
        radial-gradient(circle at 88% 10%, rgba(181, 138, 69, 0.2), transparent 31%),
        linear-gradient(135deg, #f5f2e8, #edf4ee);
    box-shadow: 0 20px 55px rgba(39, 63, 51, 0.09);
}

.collection-edit-workflow .journal-page-toolbar--edit-collection::after {
    content: "";
    position: absolute;
    right: -100px;
    bottom: -200px;
    width: 390px;
    height: 390px;
    border: 1px solid rgba(49, 95, 75, 0.12);
    border-radius: 50%;
}

.collection-edit-workflow .journal-page-toolbar__row {
    position: relative;
    z-index: 1;
    align-items: center;
}

.collection-edit-workflow .journal-page-toolbar--edit-collection .title-inline h1,
.collection-edit-workflow .journal-page-toolbar--edit-collection #sessionNameLabel,
.collection-edit-workflow .journal-page-toolbar--edit-collection .title-inline .title-input {
    color: var(--collection-ink);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.25rem, 5vw, 3.7rem);
    font-weight: 500;
    line-height: 1.05;
    letter-spacing: -0.035em;
}

.collection-edit-workflow .journal-page-toolbar__titles--edit > .collection-flow-kicker {
    display: flex;
    width: max-content;
    margin-bottom: 0.55rem;
}

.collection-edit-workflow .journal-page-toolbar__title i {
    color: var(--collection-green);
}

.collection-edit-workflow .journal-page-toolbar__helper-note {
    max-width: 700px;
    padding: 0.7rem 0.85rem;
    border: 1px solid rgba(49, 95, 75, 0.13);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.55);
    color: #53675d;
}

.collection-edit-workflow .collection-meta-info {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.collection-edit-workflow .collection-meta-info > span {
    padding: 0.4rem 0.65rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    color: #53675d;
    font-size: 0.78rem;
}

.collection-edit-workflow .edit-collection-main-content {
    max-width: none;
    padding: 0;
}

.collection-edit-workflow .workspace-content {
    padding: clamp(1.15rem, 3vw, 2rem);
    border: 1px solid var(--collection-line);
    border-radius: 24px;
    background: linear-gradient(150deg, rgba(255, 255, 255, 0.98), rgba(247, 246, 239, 0.92));
    box-shadow: 0 16px 45px rgba(39, 63, 51, 0.07);
}

.collection-entry-section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.35rem;
}

.collection-entry-section-heading h2 {
    margin: 0.3rem 0 0;
    color: var(--collection-ink);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.65rem, 3vw, 2.15rem);
    font-weight: 500;
}

.collection-entry-section-heading > p {
    max-width: 460px;
    margin: 0;
    color: var(--collection-muted);
    line-height: 1.55;
    text-align: right;
}

.collection-edit-workflow .journal-entries {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.collection-edit-workflow .journal-entry {
    min-width: 0;
    margin: 0;
    padding: 1.25rem;
    border: 1px solid var(--collection-line);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(39, 63, 51, 0.06);
    transition: transform 170ms ease, box-shadow 170ms ease, border-color 170ms ease;
}

.collection-edit-workflow .journal-entry:hover {
    border-color: rgba(49, 95, 75, 0.34);
    box-shadow: 0 15px 34px rgba(39, 63, 51, 0.12);
    transform: translateY(-2px);
}

.collection-edit-workflow .empty-collection {
    grid-column: 1 / -1;
    border: 1px dashed rgba(49, 95, 75, 0.25);
    border-radius: 18px;
    background: var(--collection-sage);
}

@media (max-width: 900px) {
    .collection-workflow-steps {
        grid-template-columns: repeat(4, minmax(72px, 1fr));
        overflow-x: auto;
    }

    .collection-workflow-step {
        justify-content: center;
        padding: 0.65rem 0.4rem;
        text-align: center;
    }

    .collection-workflow-step > span:last-child {
        display: none;
    }

    .collection-workflow-step::after {
        right: -0.45rem;
    }

    .collection-edit-workflow .journal-page-toolbar__row,
    .collection-entry-section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .collection-entry-section-heading > p {
        max-width: none;
        text-align: left;
    }

    .collection-edit-workflow .journal-entries {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .collections-library-page .collections-section {
        padding: 1rem;
        border-radius: 18px;
    }

    .collections-library-page .collection-card {
        min-height: 0;
        padding: 0;
    }

    .collection-edit-workflow {
        width: min(100% - 1rem, 1180px);
        padding-top: 0.5rem;
    }

    .collection-edit-workflow .journal-page-toolbar--edit-collection {
        border-radius: 20px;
    }

    .collection-edit-workflow .journal-page-toolbar__actions {
        width: 100%;
    }

    .collection-edit-workflow .journal-page-toolbar__actions .journal-toolbar-btn {
        flex: 1 1 100%;
    }

    .collection-workflow-steps {
        width: calc(100% - 1rem);
        border-radius: 15px;
    }

    .collection-entry-section-heading h2 {
        font-size: 1.55rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .collections-library-page .collection-card,
    .collection-edit-workflow .journal-entry {
        transition: none;
    }
}

/* Header */
.collection-header {
    background: linear-gradient(135deg, #8b9d83 0%, #7a8b72 100%);
    color: white;
    padding: 1rem 0;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.collection-header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.collection-title-section {
    flex: 1;
}

.collection-header h1 {
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.collection-header h1 i {
    color: rgba(255, 255, 255, 0.9);
}

.collection-session-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-size: 0.9rem;
}

.session-name-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.session-name-input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: 150px;
}

.session-name-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.15);
}

.session-name-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.btn-edit-name {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.375rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-edit-name:hover {
    background: rgba(255, 255, 255, 0.2);
}

.session-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
}

.session-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.collection-selection-info {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    margin: 0;
}

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

.collection-header-actions .btn {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.collection-header-actions .btn-primary {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0.3) 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.6) !important;
    color: white !important;
    font-weight: 600 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
}

.collection-header-actions .btn-primary:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.4) 100%) !important;
    border-color: rgba(255, 255, 255, 0.8) !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
}

.collection-header-actions .btn-secondary {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.4) 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    color: white !important;
    font-weight: 600 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
}

.collection-header-actions .btn-secondary:hover {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.5) 100%) !important;
    border-color: rgba(255, 255, 255, 0.7) !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
}

/* Main Content Layout */
.collection-main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 800px 400px !important;
    gap: 2rem;
    min-height: 600px;
}

/* Collection Workspace */
.collection-workspace {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.workspace-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.workspace-title h3 {
    margin: 0;
    color: #2d3748;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.entry-count {
    color: #64748b;
    font-size: 0.9rem;
    margin-left: 0.5rem;
}

.workspace-actions {
    display: flex;
    gap: 0.5rem;
}

.workspace-actions .btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    border-radius: 0.375rem;
}

.workspace-content {
    padding: 1.5rem;
    max-height: 600px;
    overflow-y: auto;
}

/* Entry Cards */
.collection-entries-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.entry-card {
    background: #f8fafc;
    border: 2px solid transparent;
    border-radius: 0.75rem;
    padding: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    cursor: move;
    transition: all 0.2s ease;
    position: relative;
}

.entry-card:hover {
    background: #f1f5f9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.entry-card.selected {
    border-color: #8b9d83;
    background: rgba(139, 157, 131, 0.05);
}

.entry-card.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
    z-index: 1000;
}

.entry-drag-handle {
    color: #9ca3af;
    cursor: grab;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.entry-drag-handle:hover {
    color: #6b7280;
    background: #f3f4f6;
}

.entry-drag-handle:active {
    cursor: grabbing;
}

.entry-checkbox {
    margin-top: 0.25rem;
}

.entry-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #8b9d83;
}

.entry-content {
    flex: 1;
}

.entry-header {
    margin-bottom: 0.75rem;
}

.entry-title {
    margin: 0 0 0.5rem 0;
    color: #2d3748;
    font-size: 1.1rem;
    font-weight: 600;
}

.entry-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    color: #64748b;
    font-size: 0.85rem;
}

.entry-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.entry-meta i {
    color: #8b9d83;
    font-size: 0.8rem;
}

.entry-snippet {
    color: #4a5568;
    line-height: 1.5;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.entry-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.flag-badge {
    background: rgba(139, 157, 131, 0.1);
    color: #2d3748;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid rgba(139, 157, 131, 0.3);
}

.flag-badge.flag-redact_personal_info {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border-color: rgba(239, 68, 68, 0.3);
}

.flag-badge.flag-redact_names {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
    border-color: rgba(245, 158, 11, 0.3);
}

.entry-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.btn-action {
    background: transparent;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    padding: 0.5rem;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.btn-action:hover {
    background: #f9fafb;
    border-color: #8b9d83;
    color: #8b9d83;
}

.btn-action.btn-danger:hover {
    background: #fee;
    border-color: #f56565;
    color: #f56565;
}

/* Empty State */
.empty-collection {
    text-align: center;
    padding: 4rem 2rem;
    color: #64748b;
}

.empty-collection .empty-icon {
    font-size: 4rem;
    color: #d1d5db;
    margin-bottom: 1.5rem;
}

.empty-collection h3 {
    color: #2d3748;
    margin-bottom: 1rem;
}

.empty-collection p {
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.empty-collection .btn {
    background: #8b9d83;
    border-color: #8b9d83;
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    font-weight: 500;
}

.empty-collection .btn:hover {
    background: #7a8b72;
    border-color: #7a8b72;
    transform: translateY(-1px);
}

/* Prep Tools Panel */
.prep-tools-panel {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    height: fit-content;
    position: sticky;
    top: 2rem;
}

.prep-tools-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.prep-tools-header h3 {
    margin: 0 0 0.5rem 0;
    color: #2d3748;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.prep-subtitle {
    margin: 0;
    color: #64748b;
    font-size: 0.95rem;
}

.prep-tools-content {
    padding: 1.5rem;
}

.prep-section {
    margin-bottom: 2rem;
}

.prep-section:last-child {
    margin-bottom: 0;
}

.prep-section h4 {
    margin: 0 0 1rem 0;
    color: #374151;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Optimization Toggles */
.optimization-toggles {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.toggle-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    cursor: pointer;
    padding: 0.75rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.toggle-item:hover {
    background: #f8fafc;
}

.toggle-item input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    width: 44px;
    height: 24px;
    background: #d1d5db;
    border-radius: 12px;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-item input[type="checkbox"]:checked + .toggle-slider {
    background: #8b9d83;
}

.toggle-item input[type="checkbox"]:checked + .toggle-slider::after {
    transform: translateX(20px);
}

.toggle-content {
    flex: 1;
}

.toggle-label {
    display: block;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.25rem;
}

.toggle-description {
    display: block;
    font-size: 0.85rem;
    color: #6b7280;
    line-height: 1.4;
}

/* Token Analysis */
.token-analysis {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.token-meters {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.token-meter {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
}

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

.meter-label {
    font-weight: 500;
    color: #374151;
}

.meter-value {
    font-weight: 700;
    color: #2d3748;
    font-size: 1.1rem;
}

.meter-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.meter-progress {
    height: 100%;
    background: linear-gradient(90deg, #8b9d83 0%, #f59e0b 100%);
    transition: width 0.3s ease;
    border-radius: 4px;
}

.meter-limit {
    font-size: 0.8rem;
    color: #6b7280;
    text-align: right;
}

.cost-estimates {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.cost-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
}

.cost-label {
    font-weight: 500;
    color: #374151;
}

.cost-value {
    font-weight: 700;
    color: #059669;
    font-size: 1.1rem;
}

.cost-warning {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    color: #92400e;
    padding: 0.75rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.cost-warning i {
    color: #f59e0b;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.quick-actions .btn {
    width: 100%;
    padding: 0.75rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Processing Options */
.processing-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.option-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.option-group label {
    font-weight: 500;
    color: #374151;
    font-size: 0.9rem;
}

.option-group .form-control {
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.option-group .form-control:focus {
    outline: none;
    border-color: #8b9d83;
    box-shadow: 0 0 0 3px rgba(139, 157, 131, 0.1);
}

.slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e2e8f0;
    outline: none;
    -webkit-appearance: none;
    margin: 0.5rem 0;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #8b9d83;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #8b9d83;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.slider-value {
    font-weight: 500;
    color: #374151;
    text-align: center;
    font-size: 0.9rem;
}

/* Process Button */
.btn-process {
    width: 100%;
    padding: 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.btn-process:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.process-info {
    text-align: center;
    margin-top: 0.75rem;
    color: #6b7280;
    font-size: 0.85rem;
}

/* Preview Modal */
.preview-modal-content {
    max-width: 1000px;
    width: 90vw;
    max-height: 80vh;
}

.preview-tabs {
    display: flex;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 1.5rem;
}

.tab-btn {
    background: none;
    border: none;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    color: #6b7280;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    color: #374151;
    background: #f8fafc;
}

.tab-btn.active {
    color: #8b9d83;
    border-bottom-color: #8b9d83;
}

.preview-content {
    max-height: 400px;
    overflow-y: auto;
}

.preview-section h4 {
    margin: 0 0 1rem 0;
    color: #2d3748;
    font-size: 1.1rem;
}

.preview-text {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
    line-height: 1.6;
    color: #374151;
}

.preview-entry {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.preview-entry:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.preview-entry h5 {
    margin: 0 0 0.5rem 0;
    color: #2d3748;
    font-size: 1rem;
}

.comparison-view {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.comparison-side {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
}

.comparison-side h5 {
    margin: 0 0 0.75rem 0;
    color: #2d3748;
    font-size: 0.95rem;
    font-weight: 600;
}

.comparison-text {
    line-height: 1.5;
    color: #374151;
    font-size: 0.9rem;
}

/* Mobile Responsive */
@media (max-width: 1200px) {
    .collection-main-content {
        grid-template-columns: 600px 300px !important;
        gap: 1.5rem;
    }
}

@media (max-width: 992px) {
    .collection-main-content {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .prep-tools-panel {
        position: static;
    }
    
    .collection-header-content {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .collection-header-actions {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }
    
    .collection-header-actions .btn {
        flex: 1;
        min-width: 120px;
        max-width: 150px;
    }
}

@media (max-width: 768px) {
    .collection-header {
        padding: 0.75rem 0;
    }
    
    .collection-header h1 {
        font-size: 1.5rem;
    }
    
    .collection-main-content {
        padding: 0 1rem;
    }
    
    .collection-session-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .session-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .workspace-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .workspace-actions {
        justify-content: center;
    }
    
    .entry-card {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .entry-actions {
        flex-direction: row;
        justify-content: center;
    }
    
    .comparison-view {
        grid-template-columns: 1fr;
    }
    
    .preview-modal-content {
        width: 95vw;
        max-height: 90vh;
    }
}

/* Animation Classes */
@keyframes slideInFromLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.entry-card {
    animation: slideInFromLeft 0.3s ease;
}

.prep-section {
    animation: fadeIn 0.3s ease;
}

/* Drag and Drop Visual Feedback */
.entry-card.drag-over {
    border-color: #8b9d83;
    background: rgba(139, 157, 131, 0.05);
}

.entry-card.drag-over::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 0;
    right: 0;
    height: 4px;
    background: #8b9d83;
    border-radius: 2px;
}

/* Collection Selector Modal Styles */
.collection-selection {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
}

.collection-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 1rem 0;
}

.collection-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
}

.collection-item:hover {
    border-color: #8b9d83;
    background: #f8f9fa;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.collection-info {
    flex: 1;
}

.collection-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    margin: 0 0 0.5rem 0;
}

.collection-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: #64748b;
}

.collection-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.collection-meta i {
    color: #8b9d83;
}

.collection-actions {
    display: flex;
    gap: 0.5rem;
}

.collection-actions .btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

.empty-state, .error-state {
    text-align: center;
    padding: 2rem;
    color: #64748b;
}

.empty-state i, .error-state i {
    font-size: 3rem;
    color: #cbd5e0;
    margin-bottom: 1rem;
}

.empty-state h4, .error-state h4 {
    color: #2d3748;
    margin-bottom: 0.5rem;
}

.loading-spinner {
    text-align: center;
    padding: 2rem;
    color: #8b9d83;
}

.loading-spinner i {
    font-size: 1.5rem;
    margin-right: 0.5rem;
}

/* Status Indicators */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    margin-top: 1rem;
}

.status-green {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.status-green i {
    color: #16a34a;
}

.status-yellow {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.status-yellow i {
    color: #d97706;
}

.status-orange {
    background: #fed7aa;
    color: #9a3412;
    border: 1px solid #fdba74;
}

.status-orange i {
    color: #ea580c;
}

.status-red {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.status-red i {
    color: #dc2626;
}

/* Auto-processing notice */
.auto-processing-notice {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 0.5rem;
    color: #0c4a6e;
    font-size: 0.875rem;
    margin-top: 1rem;
}

.auto-processing-notice i {
    color: #0284c7;
}

/* Collections Grid Display */
.collections-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.collections-header h3 {
    color: #2d3748;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.collections-header h3 i {
    color: #8b9d83;
}

.collections-header p {
    color: #64748b;
    margin: 0;
    font-size: 1rem;
}

.collections-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.collection-card {
    background: white;
    border-radius: 0.5rem;
    padding: 1rem 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.collection-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border-color: #8b9d83;
    background: #f8f9fa;
}

.collection-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.collection-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #8b9d83 0%, #7a8b72 100%);
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.collection-card-body {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.collection-name {
    color: #2d3748;
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    min-width: 120px;
}

.collection-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    color: #64748b;
    font-size: 0.875rem;
}

.collection-meta span {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.collection-meta i {
    color: #8b9d83;
    width: 12px;
    font-size: 0.75rem;
}

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

.collection-actions .btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 0.375rem;
}

.collection-card-footer {
    display: none;
}

.create-collection-section {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.create-collection-section .btn {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
}

/* Empty and Error States */
.empty-collection,
.error-collection {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.empty-icon,
.error-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
}

.empty-icon {
    color: #8b9d83;
}

.error-icon {
    color: #ef4444;
}

.empty-collection h3,
.error-collection h3 {
    color: #2d3748;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.empty-collection p,
.error-collection p {
    color: #64748b;
    font-size: 1rem;
    margin-bottom: 2rem;
    line-height: 1.5;
}

.empty-collection .btn,
.error-collection .btn {
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 500;
}

/* Responsive adjustments for collections grid */
@media (max-width: 768px) {
    .collections-header {
        padding: 1.5rem;
    }
    
    .collection-card {
        padding: 0.75rem 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .collection-card-header {
        width: 100%;
        justify-content: flex-start;
    }
    
    .collection-card-body {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        width: 100%;
    }
    
    .collection-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .collection-actions {
        align-self: flex-end;
    }
    
    .create-collection-section {
        padding: 1.5rem;
    }
}
