/* ============================================
   CASE PRESENTER — Clinical Pro-forma Generator
   Ward Companion
   ============================================ */

/* ---- Template Picker ---- */
.cp-picker-subtitle {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.cp-specialty-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.cp-specialty-tab {
    padding: 6px 16px;
    border-radius: 20px;
    background: var(--glass-bg);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.cp-specialty-tab.active,
.cp-specialty-tab:hover {
    background: rgba(0, 191, 165, 0.12);
    border-color: rgba(0, 191, 165, 0.4);
    color: #00bfa5;
}

.cp-template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 12px;
    margin-bottom: 40px;
}

.cp-template-card {
    background: var(--glass-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.cp-template-card:hover {
    border-color: rgba(0, 191, 165, 0.5);
    box-shadow: 0 4px 20px rgba(0, 191, 165, 0.1);
    transform: translateY(-2px);
}

.cp-template-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.cp-template-info h5 {
    font-size: 0.88rem;
    font-weight: 700;
    margin-bottom: 2px;
    color: var(--text);
}

.cp-template-info p {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* ---- Form Container ---- */
.cp-form-container {
    max-width: 700px;
    margin: 0 auto;
}

.cp-form-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 20px;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--glass-bg);
    transition: all 0.2s;
}

.cp-form-back-btn:hover {
    color: #00bfa5;
    border-color: rgba(0, 191, 165, 0.4);
}

/* ---- Step Indicator ---- */
.cp-steps-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    overflow-x: auto;
    padding: 4px 0 10px;
}

.cp-step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.cp-step-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--border);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 800;
    transition: all 0.3s;
    z-index: 1;
}

.cp-step-dot.active {
    background: #00bfa5;
    color: white;
    box-shadow: 0 0 0 4px rgba(0, 191, 165, 0.2);
}

.cp-step-dot.done {
    background: rgba(0, 191, 165, 0.25);
    color: #00bfa5;
}

.cp-step-label {
    font-size: 0.58rem;
    color: var(--text-muted);
    font-weight: 600;
    text-align: center;
    min-width: 50px;
}

.cp-step-label.active {
    color: #00bfa5;
}

.cp-step-line {
    width: 28px;
    height: 2px;
    background: var(--border);
    margin-bottom: 14px;
}

.cp-step-line.done {
    background: rgba(0, 191, 165, 0.4);
}

/* ---- Section Headers ---- */
.cp-section-hdr {
    font-size: 0.72rem;
    font-weight: 800;
    color: #00bfa5;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 22px 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(0, 191, 165, 0.2);
}

/* ---- Fields ---- */
.cp-field {
    margin-bottom: 14px;
}

.cp-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.cp-optional {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 400;
}

.cp-input,
.cp-textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--glass-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-size: 0.87rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    box-sizing: border-box;
}

.cp-input:hover,
.cp-textarea:hover {
    border-color: rgba(0, 191, 165, 0.35);
}

.cp-input:focus,
.cp-textarea:focus {
    outline: none;
    border-color: rgba(0, 191, 165, 0.6);
    box-shadow: 0 0 0 3px rgba(0, 191, 165, 0.1);
    background: var(--bg);
}

/* Custom Dropdown (replaces native <select>) */
.cpdd-wrap {
    position: relative;
    width: 100%;
}

.cpdd-trigger {
    width: 100%;
    padding: 10px 14px;
    padding-right: 38px;
    background: var(--glass-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-muted);
    font-size: 0.87rem;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    user-select: none;
}

.cpdd-trigger:hover {
    border-color: rgba(0, 191, 165, 0.35);
}

.cpdd-wrap.open .cpdd-trigger {
    border-color: rgba(0, 191, 165, 0.6);
    box-shadow: 0 0 0 3px rgba(0, 191, 165, 0.1);
}

.cpdd-value.has-value {
    color: var(--text);
    font-weight: 600;
}

.cpdd-arrow {
    font-size: 0.65rem;
    color: #00bfa5;
    transition: transform 0.25s ease;
    flex-shrink: 0;
}

.cpdd-wrap.open .cpdd-arrow {
    transform: rotate(180deg);
}

.cpdd-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--bg, #ffffff);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.18);
    z-index: 100;
    max-height: 240px;
    overflow-y: auto;
    padding: 4px;
    animation: cpddSlideIn 0.2s ease;
}

.cpdd-wrap.open .cpdd-menu {
    display: block;
}

@keyframes cpddSlideIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cpdd-option {
    padding: 9px 14px;
    font-size: 0.84rem;
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    font-weight: 500;
}

.cpdd-option:hover {
    background: rgba(0, 191, 165, 0.08);
    color: #00bfa5;
}

.cpdd-option.selected {
    background: rgba(0, 191, 165, 0.12);
    color: #00bfa5;
    font-weight: 700;
}

.cpdd-option.selected::before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-right: 8px;
    font-size: 0.7rem;
}

/* Scrollbar for dropdown */
.cpdd-menu::-webkit-scrollbar {
    width: 5px;
}

.cpdd-menu::-webkit-scrollbar-track {
    background: transparent;
}

.cpdd-menu::-webkit-scrollbar-thumb {
    background: rgba(0, 191, 165, 0.25);
    border-radius: 10px;
}

.cp-textarea {
    min-height: 75px;
    resize: vertical;
}

.cp-input::placeholder,
.cp-textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

.cp-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 500px) {
    .cp-field-row {
        grid-template-columns: 1fr;
    }
}

/* ---- Radio Pills ---- */
.cp-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.cp-radio-pill {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--glass-bg);
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}

.cp-radio-pill.selected {
    background: rgba(0, 191, 165, 0.15);
    border-color: rgba(0, 191, 165, 0.5);
    color: #00bfa5;
}

/* ---- Nav Buttons ---- */
.cp-nav-btns {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--border-light);
}

.cp-btn {
    padding: 12px 22px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cp-btn-secondary {
    background: var(--glass-bg);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.cp-btn-primary {
    background: #00bfa5;
    color: white;
    flex: 1;
    justify-content: center;
}

.cp-btn-primary:hover {
    background: #00a896;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 191, 165, 0.3);
}

.cp-btn-generate {
    width: 100%;
    justify-content: center;
    padding: 16px;
    font-size: 1rem;
    border-radius: 14px;
    background: linear-gradient(135deg, #00bfa5, #0097a7);
    color: white;
    margin-top: 10px;
    box-shadow: 0 4px 20px rgba(0, 191, 165, 0.3);
}

.cp-btn-generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 191, 165, 0.35);
}

/* ---- Script Output ---- */
.cp-script-toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.cp-script-action-btn {
    padding: 9px 18px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--border);
    background: var(--glass-bg);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 7px;
}

.cp-script-action-btn.primary {
    background: #00bfa5;
    border-color: transparent;
    color: white;
}

.cp-script-action-btn:hover {
    opacity: 0.85;
}

.cp-script-output {
    background: var(--glass-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 28px;
    font-size: 0.9rem;
    line-height: 1.95;
    color: var(--text);
}

.cp-script-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #00bfa5;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(0, 191, 165, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cp-script-section-hdr {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin: 22px 0 6px;
}

.cp-script-para {
    margin-bottom: 10px;
}

.cp-copied-toast {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    background: #00bfa5;
    color: white;
    padding: 10px 24px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.88rem;
    z-index: 9999;
    animation: fadeInUp 0.3s ease;
    pointer-events: none;
}