/* ============================================
   Pflege-Cockpit – Stylesheet
   Version 1.0.0
   ============================================ */

:root {
    --pc-primary: #E91E8C;
    --pc-primary-dark: #C01575;
    --pc-primary-light: #fce4f3;
    --pc-dark: #1a1a2e;
    --pc-mid: #2d2d44;
    --pc-surface: #ffffff;
    --pc-border: #e8e8f0;
    --pc-text: #2c2c3e;
    --pc-text-light: #6b6b80;
    --pc-success: #22c55e;
    --pc-warning: #f59e0b;
    --pc-radius: 16px;
    --pc-shadow: 0 4px 24px rgba(233,30,140,0.08), 0 1px 4px rgba(0,0,0,0.06);
    --pc-font: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ---- Wrapper ---- */
.pc-wrapper {
    font-family: var(--pc-font);
    max-width: 780px;
    margin: 2rem auto;
    background: var(--pc-surface);
    border-radius: var(--pc-radius);
    box-shadow: var(--pc-shadow);
    border: 1px solid var(--pc-border);
    overflow: hidden;
    color: var(--pc-text);
    line-height: 1.6;
}

/* ---- Header ---- */
.pc-header {
    background: linear-gradient(135deg, var(--pc-dark) 0%, var(--pc-mid) 100%);
    color: white;
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.pc-header-icon {
    width: 52px;
    height: 52px;
    background: var(--pc-primary);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: white;
}

.pc-header-text {
    flex: 1;
}

.pc-header-text h2 {
    margin: 0 0 0.2rem;
    font-size: 1.3rem;
    font-weight: 700;
    color: white !important;
    border: none !important;
    padding: 0 !important;
}

.pc-header-text p {
    margin: 0;
    font-size: 0.82rem;
    color: rgba(255,255,255,0.65);
}

.pc-header-badge {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255,255,255,0.1);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.9);
    white-space: nowrap;
}

.pc-badge-dot {
    width: 7px;
    height: 7px;
    background: var(--pc-success);
    border-radius: 50%;
    animation: pc-pulse 2s infinite;
}

@keyframes pc-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.3); }
}

/* ---- Progress Steps ---- */
.pc-progress-container {
    background: #f8f8fc;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--pc-border);
}

.pc-progress-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    max-width: 400px;
    margin: 0 auto;
}

.pc-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    opacity: 0.4;
    transition: opacity 0.3s;
}

.pc-step.active {
    opacity: 1;
}

.pc-step.done {
    opacity: 1;
}

.pc-step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--pc-border);
    color: var(--pc-text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    transition: all 0.3s;
}

.pc-step.active .pc-step-circle {
    background: var(--pc-primary);
    color: white;
}

.pc-step.done .pc-step-circle {
    background: var(--pc-success);
    color: white;
}

.pc-step span {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--pc-text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pc-step.active span,
.pc-step.done span {
    color: var(--pc-text);
}

.pc-step-line {
    flex: 1;
    height: 2px;
    background: var(--pc-border);
    margin-bottom: 1.2rem;
    margin: 0 0.5rem 1.2rem;
}

/* ---- Chat Messages ---- */
.pc-chat-container {
    padding: 1.5rem;
    min-height: 320px;
    max-height: 460px;
    overflow-y: auto;
    background: #fafafa;
    scroll-behavior: smooth;
}

.pc-messages {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.pc-msg {
    display: flex;
    gap: 0.6rem;
    animation: pc-slideIn 0.3s ease;
}

@keyframes pc-slideIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.pc-msg.pc-msg-bot {
    align-items: flex-start;
}

.pc-msg.pc-msg-user {
    align-items: flex-start;
    flex-direction: row-reverse;
}

.pc-msg-avatar {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--pc-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
}

.pc-msg-user .pc-msg-avatar {
    background: var(--pc-dark);
}

.pc-msg-bubble {
    max-width: 78%;
    padding: 0.75rem 1rem;
    border-radius: 14px;
    font-size: 0.9rem;
    line-height: 1.55;
}

.pc-msg-bot .pc-msg-bubble {
    background: white;
    border: 1px solid var(--pc-border);
    border-radius: 4px 14px 14px 14px;
    color: var(--pc-text);
}

.pc-msg-user .pc-msg-bubble {
    background: var(--pc-primary);
    color: white;
    border-radius: 14px 4px 14px 14px;
}

/* ---- Typing Indicator ---- */
.pc-typing {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
}

.pc-typing-bubble {
    background: white;
    border: 1px solid var(--pc-border);
    border-radius: 14px;
    padding: 0.5rem 0.85rem;
    display: flex;
    gap: 4px;
    align-items: center;
}

.pc-typing-bubble span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--pc-primary);
    animation: pc-bounce 1.2s infinite;
}

.pc-typing-bubble span:nth-child(2) { animation-delay: 0.2s; }
.pc-typing-bubble span:nth-child(3) { animation-delay: 0.4s; }

@keyframes pc-bounce {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
    40% { transform: translateY(-6px); opacity: 1; }
}

.pc-typing small {
    color: var(--pc-text-light);
    font-size: 0.75rem;
}

/* ---- Input Area ---- */
.pc-input-area {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--pc-border);
    background: white;
    align-items: flex-end;
}

#pc-user-input {
    flex: 1;
    border: 1.5px solid var(--pc-border);
    border-radius: 12px;
    padding: 0.7rem 1rem;
    font-family: var(--pc-font);
    font-size: 0.9rem;
    resize: none;
    outline: none;
    transition: border-color 0.2s;
    color: var(--pc-text);
    background: #fafafa;
    line-height: 1.5;
}

#pc-user-input:focus {
    border-color: var(--pc-primary);
    background: white;
}

#pc-send-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--pc-primary);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.2s;
    flex-shrink: 0;
}

#pc-send-btn:hover {
    background: var(--pc-primary-dark);
    transform: translateY(-1px);
}

#pc-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ---- Analysis Bar ---- */
.pc-analysis-bar {
    padding: 1rem 1.5rem;
    background: var(--pc-primary-light);
    border-top: 1px solid rgba(233,30,140,0.15);
    text-align: center;
}

.pc-analysis-bar p {
    margin: 0 0 0.75rem;
    font-size: 0.88rem;
    color: var(--pc-primary-dark);
}

/* ---- Buttons ---- */
.pc-btn-primary {
    background: var(--pc-primary);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 0.7rem 1.5rem;
    font-family: var(--pc-font);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.pc-btn-primary:hover {
    background: var(--pc-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(233,30,140,0.3);
}

.pc-btn-secondary {
    background: transparent;
    color: var(--pc-primary);
    border: 1.5px solid var(--pc-primary);
    border-radius: 10px;
    padding: 0.6rem 1.3rem;
    font-family: var(--pc-font);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.pc-btn-secondary:hover {
    background: var(--pc-primary-light);
}

/* ---- Results Panel ---- */
.pc-results {
    padding: 1.5rem;
    animation: pc-slideIn 0.4s ease;
}

.pc-results-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--pc-border);
}

.pc-results-header h3 {
    font-size: 1.2rem;
    color: var(--pc-text);
    margin: 0 0 0.3rem;
}

.pc-results-header p {
    font-size: 0.85rem;
    color: var(--pc-text-light);
    margin: 0;
}

/* ---- Result Cards ---- */
.pc-card {
    border: 1px solid var(--pc-border);
    border-radius: 12px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.pc-card-header {
    padding: 0.85rem 1.2rem;
    background: #f8f8fc;
    border-bottom: 1px solid var(--pc-border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.pc-card-header:hover {
    background: var(--pc-primary-light);
}

.pc-card-header h4 {
    margin: 0;
    font-size: 0.95rem;
    flex: 1;
    color: var(--pc-text);
}

.pc-card-header .pc-card-icon {
    font-size: 1.1rem;
}

.pc-card-header .pc-card-toggle {
    font-size: 0.7rem;
    color: var(--pc-text-light);
    transition: transform 0.2s;
}

.pc-card-header.open .pc-card-toggle {
    transform: rotate(180deg);
}

.pc-card-body {
    padding: 1.2rem;
    display: none;
}

.pc-card-body.visible {
    display: block;
}

/* ---- Leistung Items ---- */
.pc-leistung-item {
    border-left: 3px solid var(--pc-primary);
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    background: #fafafe;
    border-radius: 0 8px 8px 0;
}

.pc-leistung-item h5 {
    margin: 0 0 0.25rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.pc-leistung-item p {
    margin: 0;
    font-size: 0.82rem;
    color: var(--pc-text-light);
}

.pc-badge-prio {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.pc-badge-prio.hoch { background: #fee2e2; color: #dc2626; }
.pc-badge-prio.mittel { background: #fef3c7; color: #d97706; }
.pc-badge-prio.niedrig { background: #dcfce7; color: #16a34a; }

.pc-leistung-betrag {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--pc-primary);
}

/* ---- Fahrplan ---- */
.pc-fahrplan-step {
    display: flex;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px dashed var(--pc-border);
}

.pc-fahrplan-step:last-child {
    border-bottom: none;
}

.pc-fahrplan-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--pc-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.pc-fahrplan-content h5 {
    margin: 0 0 0.2rem;
    font-size: 0.88rem;
}

.pc-fahrplan-content p {
    margin: 0;
    font-size: 0.78rem;
    color: var(--pc-text-light);
}

/* ---- Antragstext ---- */
.pc-antragstext {
    background: #f8f8fc;
    border: 1px solid var(--pc-border);
    border-radius: 8px;
    padding: 1rem;
    font-size: 0.82rem;
    white-space: pre-wrap;
    font-family: var(--pc-font);
    line-height: 1.65;
    color: var(--pc-text);
    margin-top: 0.75rem;
}

.pc-copy-btn {
    margin-top: 0.5rem;
    background: none;
    border: 1px solid var(--pc-border);
    border-radius: 8px;
    padding: 0.4rem 0.8rem;
    font-size: 0.78rem;
    cursor: pointer;
    color: var(--pc-text-light);
    transition: all 0.2s;
    font-family: var(--pc-font);
}

.pc-copy-btn:hover {
    border-color: var(--pc-primary);
    color: var(--pc-primary);
}

/* ---- Actions row ---- */
.pc-actions-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1.25rem;
    justify-content: center;
}

/* ---- Privacy ---- */
.pc-privacy {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: #f4f4f8;
    font-size: 0.75rem;
    color: var(--pc-text-light);
    border-top: 1px solid var(--pc-border);
}

/* ---- Error ---- */
.pc-error {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    margin: 0.5rem 0;
}

/* ---- Entry Mode Selector ---- */
.pc-entry-panel {
    padding: 1.75rem 2rem;
    background: #fafafa;
    border-bottom: 1px solid var(--pc-border);
}

.pc-entry-intro {
    margin: 0 0 1rem;
    font-size: 0.9rem;
    color: var(--pc-text-light);
    text-align: center;
    font-weight: 500;
}

.pc-entry-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
}

.pc-entry-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1rem 1.1rem;
    border: 1.5px solid var(--pc-border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
    user-select: none;
}

.pc-entry-card:hover {
    border-color: var(--pc-primary);
    background: var(--pc-primary-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(233,30,140,0.1);
}

.pc-entry-card-icon {
    font-size: 1.6rem;
    flex-shrink: 0;
}

.pc-entry-card-text {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.pc-entry-card-text strong {
    font-size: 0.88rem;
    color: var(--pc-text);
}

.pc-entry-card-text span {
    font-size: 0.76rem;
    color: var(--pc-text-light);
    line-height: 1.35;
}

/* ---- Upload Drop Zone ---- */
.pc-upload-zone {
    padding: 1.5rem;
    background: #fafafa;
    border-bottom: 1px solid var(--pc-border);
}

.pc-dropzone {
    border: 2px dashed var(--pc-border);
    border-radius: 14px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
    background: white;
}

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

.pc-dropzone-icon {
    color: var(--pc-primary);
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: center;
}

.pc-dropzone-title {
    margin: 0 0 0.3rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--pc-text);
}

.pc-dropzone-sub {
    margin: 0 0 0.3rem;
    font-size: 0.85rem;
    color: var(--pc-text-light);
}

.pc-file-label {
    color: var(--pc-primary);
    cursor: pointer;
    font-weight: 600;
    text-decoration: underline;
}

.pc-dropzone-formats {
    margin: 0;
    font-size: 0.75rem;
    color: var(--pc-text-light);
}

/* ---- Upload Progress ---- */
.pc-upload-progress {
    margin-top: 1rem;
    padding: 1rem;
    background: white;
    border: 1px solid var(--pc-border);
    border-radius: 10px;
}

.pc-upload-file-info {
    font-size: 0.85rem;
    color: var(--pc-text);
    margin-bottom: 0.6rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.pc-progress-bar-wrap {
    height: 6px;
    background: var(--pc-border);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.pc-progress-bar-fill {
    height: 100%;
    width: 0%;
    background: var(--pc-primary);
    border-radius: 3px;
    transition: width 0.3s;
    animation: pc-progress-animate 1.5s ease infinite;
}

@keyframes pc-progress-animate {
    0%   { opacity: 1; }
    50%  { opacity: 0.7; }
    100% { opacity: 1; }
}

.pc-upload-status {
    margin: 0;
    font-size: 0.78rem;
    color: var(--pc-text-light);
}

.pc-upload-back {
    margin-top: 1rem;
    font-size: 0.8rem;
}

/* ---- Attach button in input area ---- */
.pc-attach-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--pc-text-light);
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
    flex-shrink: 0;
    margin-bottom: 3px;
}

.pc-attach-btn:hover {
    color: var(--pc-primary);
    background: var(--pc-primary-light);
}

/* ---- Attach preview bar ---- */
.pc-attach-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.5rem 1.5rem;
    background: var(--pc-primary-light);
    border-top: 1px solid rgba(233,30,140,0.15);
    font-size: 0.8rem;
    color: var(--pc-primary-dark);
}

.pc-attach-preview span {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

#pc-attach-remove {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--pc-primary);
    font-size: 1rem;
    line-height: 1;
    padding: 0;
}

/* ---- Document Badge (in chat) ---- */
.pc-doc-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 12px;
    margin-bottom: 0.25rem;
    animation: pc-slideIn 0.3s ease;
}

.pc-doc-badge-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
}

.pc-doc-badge-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.pc-doc-badge-text strong {
    font-size: 0.85rem;
    color: #166534;
}

.pc-doc-badge-text span {
    font-size: 0.75rem;
    color: #16a34a;
}

.pc-doc-badge-check {
    color: var(--pc-success);
    font-size: 1.2rem;
    font-weight: 700;
}

/* ---- Upload Error ---- */
.pc-upload-error {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    padding: 0.65rem 1rem;
    font-size: 0.82rem;
    margin-bottom: 0.75rem;
    text-align: left;
}

/* ---- Results check icon ---- */
.pc-results-check {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--pc-success);
    color: white;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.75rem;
    font-weight: 700;
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
    .pc-entry-options {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 600px) {
    .pc-header {
        padding: 1rem;
        flex-wrap: wrap;
    }
    .pc-header-badge {
        display: none;
    }
    .pc-chat-container {
        max-height: 340px;
        padding: 1rem;
    }
    .pc-input-area {
        padding: 0.75rem 1rem;
    }
    .pc-msg-bubble {
        max-width: 90%;
    }
    .pc-results {
        padding: 1rem;
    }
}
