/* Treatment Builder - Public Styles */
/* Matches the original treatment-builder.com design */

.tb-wrapper {
    --tb-primary: #6c63ff;
    --tb-dark-bg: #4a4a4a;
    --tb-light-bg: #f5f5f7;
    --tb-text-dark: #2d2d2d;
    --tb-text-muted: #888;
    --tb-border: #e8e8e8;
    --tb-white: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    display: flex;
    width: 100%;
    min-height: 700px;
    border-radius: 0;
    overflow: hidden;
    position: relative;
    line-height: 1.5;
    box-sizing: border-box;
}

.tb-wrapper *, .tb-wrapper *::before, .tb-wrapper *::after {
    box-sizing: border-box;
}

/* ===== LEFT PANEL ===== */
.tb-left-panel {
    flex: 1;
    background: var(--tb-dark-bg);
    display: flex;
    flex-direction: column;
    position: relative;
    min-height: 700px;
}

.tb-figure-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 40px 60px 20px;
}

/* Welcome overlay on body */
.tb-body-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 20;
    text-align: center;
}

.tb-click-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.05);
    margin-bottom: 16px;
}

.tb-click-circle:hover {
    border-color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

.tb-click-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    font-weight: 500;
    margin: 0;
}

/* Figure Container */
.tb-figure-container {
    position: relative;
    width: 260px;
    height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tb-figure-container.tb-face-mode {
    width: 280px;
    height: 450px;
}

.tb-figure-container svg.tb-body-svg {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

/* Hotspot Buttons - "+" style */
.tb-hotspot {
    position: absolute;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid var(--tb-primary);
    background: rgba(255, 255, 255, 0.95);
    cursor: pointer;
    transition: all 0.25s ease;
    transform: translate(-50%, -50%);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.tb-hotspot::before,
.tb-hotspot::after {
    content: '';
    position: absolute;
    background: var(--tb-primary);
    border-radius: 1px;
}

.tb-hotspot::before {
    width: 12px;
    height: 2px;
}

.tb-hotspot::after {
    width: 2px;
    height: 12px;
}

.tb-hotspot:hover {
    transform: translate(-50%, -50%) scale(1.15);
    box-shadow: 0 2px 8px rgba(108, 99, 255, 0.4);
}

.tb-hotspot.active {
    background: var(--tb-primary);
    border-color: var(--tb-primary);
}

.tb-hotspot.active::before,
.tb-hotspot.active::after {
    background: #fff;
}

.tb-hotspot.has-selections {
    background: var(--tb-primary);
    border-color: var(--tb-primary);
}

.tb-hotspot.has-selections::before,
.tb-hotspot.has-selections::after {
    background: #fff;
}

/* Face expand hotspot - special icon */
.tb-hotspot-face {
    width: 34px;
    height: 34px;
    border: 2px solid rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.15);
}

.tb-hotspot-face::before,
.tb-hotspot-face::after {
    display: none;
}

.tb-hotspot-face svg {
    width: 16px;
    height: 16px;
    color: rgba(255, 255, 255, 0.9);
}

.tb-hotspot-face:hover {
    border-color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.25);
}

/* Rotate Buttons */
.tb-rotate-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.tb-rotate-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.95);
}

.tb-rotate-left {
    left: 30px;
}

.tb-rotate-right {
    right: 30px;
}

/* Bottom Controls */
.tb-bottom-controls {
    padding: 16px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tb-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.tb-link-btn:hover {
    color: rgba(255, 255, 255, 1);
    text-decoration: underline;
}

/* ===== RIGHT PANEL ===== */
.tb-right-panel {
    width: 420px;
    background: var(--tb-light-bg);
    padding: 40px 36px;
    overflow-y: auto;
    max-height: 700px;
    display: flex;
    flex-direction: column;
}

.tb-right-panel h2 {
    color: var(--tb-text-dark);
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 8px;
    line-height: 1.3;
}

/* ===== WELCOME VIEW ===== */
.tb-welcome-view {
    text-align: center;
    padding: 20px 0;
}

.tb-welcome-view h2 {
    font-size: 26px;
    margin-bottom: 12px;
}

.tb-welcome-subtitle {
    color: var(--tb-text-muted);
    font-size: 14px;
    margin-bottom: 32px;
    line-height: 1.6;
}

.tb-steps {
    text-align: left;
}

.tb-step {
    display: flex;
    align-items: center;
    padding: 18px 20px;
    background: var(--tb-white);
    border-radius: 10px;
    margin-bottom: 10px;
    gap: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.tb-step-num {
    color: var(--tb-primary);
    font-size: 16px;
    font-weight: 700;
    flex-shrink: 0;
    min-width: 28px;
}

.tb-step span:last-child {
    font-size: 15px;
    color: var(--tb-text-dark);
    line-height: 1.4;
}

/* ===== SELECTIONS VIEW ===== */
.tb-selections-view {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.tb-selections-view h2 {
    margin-bottom: 20px;
}

.tb-empty-msg {
    color: var(--tb-text-muted);
    font-size: 15px;
    line-height: 1.6;
    margin: 0 0 8px;
}

.tb-selections-group {
    margin-bottom: 16px;
    padding: 14px 16px;
    background: var(--tb-white);
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.tb-selections-group h4 {
    color: var(--tb-text-dark);
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.tb-selection-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
    color: #555;
    border-bottom: 1px solid #f0f0f0;
}

.tb-selection-item:last-child {
    border-bottom: none;
}

.tb-selection-remove {
    background: none;
    border: none;
    color: #ccc;
    cursor: pointer;
    font-size: 18px;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.2s;
}

.tb-selection-remove:hover {
    color: #ff4444;
}

/* ===== CONCERNS VIEW ===== */
.tb-concerns-view {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.tb-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--tb-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 20px;
    transition: opacity 0.2s;
}

.tb-back-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.tb-concerns-view h2 {
    margin-bottom: 20px;
}

.tb-concerns-list {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 20px;
    padding-right: 4px;
}

/* Pill-shaped concern items */
.tb-concern-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border: 1.5px solid var(--tb-border);
    border-radius: 50px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 14px;
    background: var(--tb-white);
}

.tb-concern-item:hover {
    border-color: var(--tb-primary);
}

.tb-concern-item.selected {
    border-color: var(--tb-primary);
    background: rgba(108, 99, 255, 0.04);
}

.tb-concern-checkbox {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid #d0d0d0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}

.tb-concern-item.selected .tb-concern-checkbox {
    background: var(--tb-primary);
    border-color: var(--tb-primary);
}

.tb-concern-item.selected .tb-concern-checkbox::after {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
}

.tb-concern-name {
    font-size: 15px;
    color: var(--tb-text-dark);
    font-weight: 400;
}

/* ===== BUTTONS ===== */
.tb-btn {
    border: none;
    padding: 16px 28px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    text-align: center;
}

.tb-btn-submit {
    background: var(--tb-primary);
    color: #fff;
    margin-top: auto;
}

.tb-btn-submit:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.tb-btn-add {
    background: #3d3d3d;
    color: #fff;
    margin-top: auto;
    flex-shrink: 0;
}

.tb-btn-add:hover {
    background: #2d2d2d;
}

/* ===== MODAL ===== */
.tb-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    padding: 20px;
}

.tb-modal-content {
    background: #ffffff;
    border-radius: 16px;
    padding: 40px;
    max-width: 480px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.tb-modal-content h2 {
    font-size: 22px;
    margin-bottom: 12px;
}

.tb-modal-content p {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 16px;
}

/* Contact Form */
.tb-contact-form {
    text-align: left;
}

.tb-contact-form h2,
.tb-contact-form > p {
    text-align: center;
}

.tb-privacy-note {
    font-size: 12px !important;
    color: #999 !important;
}

.tb-form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.tb-form-row input {
    flex: 1;
    padding: 14px 18px;
    border: 1.5px solid var(--tb-border);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    background: #fff;
}

.tb-form-row input:focus {
    border-color: var(--tb-primary);
}

.tb-contact-form .tb-btn {
    margin-top: 12px;
}

/* Success */
.tb-success-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #4CAF50;
    color: #fff;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .tb-wrapper {
        flex-direction: column;
        min-height: auto;
    }

    .tb-left-panel {
        min-height: 500px;
    }

    .tb-right-panel {
        width: 100%;
        max-height: none;
        min-height: 400px;
    }

    .tb-rotate-left {
        left: 10px;
    }

    .tb-rotate-right {
        right: 10px;
    }

    .tb-rotate-btn {
        width: 44px;
        height: 44px;
    }

    .tb-figure-area {
        padding: 30px 40px 20px;
    }
}

@media (max-width: 600px) {
    .tb-right-panel {
        padding: 24px 20px;
    }

    .tb-form-row {
        flex-direction: column;
    }

    .tb-concern-item {
        padding: 14px 16px;
    }

    .tb-figure-area {
        padding: 20px 20px 10px;
    }
}
