/* ============================================================
   TogetherMindsAI — Main Stylesheet
   Green / Teal therapeutic theme
   ============================================================ */

:root {
    --green-primary:   #4CAF50;
    --green-dark:      #388E3C;
    --green-light:     #C8E6C9;
    --green-pale:      #E8F5E9;
    --teal-primary:    #009688;
    --teal-dark:       #00796B;
    --gray-bubble:     #F1F3F4;
    --text-dark:       #212121;
    --text-muted:      #757575;
    --border-radius:   16px;
}

/* ---- Persistent disclaimer bar ---- */
.disclaimer-bar {
    background-color: #fff8e1;
    border-bottom: 1px solid #ffe082;
    color: #5d4037;
    font-size: 0.82rem;
    line-height: 1.5;
}

/* ---- Global ---- */
body {
    background-color: #F7FAF7;
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    color: var(--text-dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main.container {
    flex: 1;
}

/* ---- Navbar ---- */
.bg-primary-teal {
    background: linear-gradient(135deg, var(--teal-primary) 0%, var(--green-dark) 100%) !important;
}

.navbar-brand {
    font-size: 1.3rem;
    letter-spacing: 0.3px;
}

/* ---- Color utilities ---- */
.text-primary-green { color: var(--green-primary) !important; }

.btn-primary-green {
    background: linear-gradient(135deg, var(--green-primary), var(--teal-primary));
    border: none;
    color: #fff;
    font-weight: 600;
    transition: opacity 0.2s, transform 0.1s;
}
.btn-primary-green:hover {
    opacity: 0.92;
    transform: translateY(-1px);
    color: #fff;
}
.btn-primary-green:active {
    transform: translateY(0);
}

.btn-delete {
    background-color: #d32f2f;
    border: none;
    color: #fff;
    font-weight: 600;
}
.btn-delete:hover,
.btn-delete:focus,
.btn-delete:active {
    background-color: #d32f2f;
    color: #fff;
}

.btn-outline-green {
    border: 2px solid var(--green-primary);
    color: var(--green-primary);
    background: transparent;
    font-weight: 600;
    transition: background 0.2s, color 0.2s;
}
.btn-outline-green:hover {
    background: var(--green-primary);
    color: #fff;
}

.bg-primary-green {
    background-color: var(--green-primary) !important;
}

.border-green {
    border-color: var(--green-primary) !important;
}

/* ---- Hero section ---- */
.hero-icon {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: var(--green-pale);
    display: flex;
    align-items: center;
    justify-content: center;
}

.border-green.border {
    border-color: var(--green-primary) !important;
}
hr.border-green {
    border-color: var(--green-primary);
    opacity: 0.4;
    border-width: 2px;
}

/* ---- Therapy cards (home) ---- */
.therapy-card {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border-radius: var(--border-radius) !important;
    background: #fff;
}
.therapy-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(76, 175, 80, 0.18) !important;
}

.therapy-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--green-pale);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---- Auth card ---- */
.alert-info-teal {
    background: #E0F2F1;
    border: 1px solid #B2DFDB;
    color: var(--teal-dark);
}

/* ---- Chat window ---- */
.chat-window {
    height: calc(100vh - 280px);
    min-height: 320px;
    border-radius: var(--border-radius) !important;
}
.chat-window .card-body {
    overflow-y: auto;
    height: 100%;
    scroll-behavior: smooth;
}

/* ---- Chat bubbles ---- */
.bubble {
    max-width: 72%;
    padding: 10px 14px;
    border-radius: 18px;
    position: relative;
    word-break: break-word;
}

.bubble-user {
    background: linear-gradient(135deg, var(--green-primary), var(--teal-primary));
    color: #fff;
    border-bottom-right-radius: 4px;
}

.bubble-ai {
    background: var(--gray-bubble);
    color: var(--text-dark);
    border-bottom-left-radius: 4px;
}

.bubble p {
    white-space: pre-wrap;
}

.bubble-sender {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.75;
    display: block;
    margin-bottom: 3px;
}

.bubble-time {
    font-size: 0.68rem;
    opacity: 0.65;
    display: block;
    margin-top: 4px;
    text-align: right;
}

/* ---- Avatars ---- */
.avatar-ai,
.avatar-user {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}
.avatar-ai {
    background: var(--green-light);
    color: var(--green-dark);
}
.avatar-user {
    background: linear-gradient(135deg, var(--green-primary), var(--teal-primary));
    color: #fff;
}

/* ---- Input group ---- */
.input-group.rounded-4 {
    border-radius: var(--border-radius) !important;
}
.input-group .form-control:focus {
    box-shadow: none;
    border-color: var(--green-primary);
}

/* ---- Share alert ---- */
.alert-share {
    background: var(--green-pale);
    border: 1px solid var(--green-light);
    color: var(--text-dark);
}

/* ---- Session ID badge ---- */
.session-id-badge {
    display: inline-block;
    background: var(--green-primary);
    color: #fff;
    padding: 2px 12px;
    border-radius: 20px;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 2px;
}

/* ---- Progress stat cards ---- */
.stat-card {
    background: #fff;
    transition: transform 0.15s;
}
.stat-card:hover {
    transform: translateY(-2px);
}

/* ---- Consent checkboxes ---- */
.cursor-pointer { cursor: pointer; }

.consent-check {
    width: 1.35em;
    height: 1.35em;
    border: 2px solid #888;
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0;
    accent-color: var(--green-primary);
}

.consent-item {
    background: #fff;
    border-color: #ccc !important;
    color: var(--text-dark);
    transition: border-color 0.15s, background 0.15s;
    cursor: pointer;
}
.consent-item:hover {
    border-color: var(--green-primary) !important;
    background: var(--green-pale);
}
.consent-item:has(.consent-check:checked) {
    border-color: var(--green-primary) !important;
    background: var(--green-pale);
}

/* ---- Footer ---- */
.footer-bar {
    border-top: 1px solid #E0E0E0;
    background: #fff;
}

/* ---- Scrollbar styling (webkit) ---- */
.chat-window .card-body::-webkit-scrollbar {
    width: 5px;
}
.chat-window .card-body::-webkit-scrollbar-track {
    background: transparent;
}
.chat-window .card-body::-webkit-scrollbar-thumb {
    background: var(--green-light);
    border-radius: 10px;
}

/* ---- Multi-colored send spinner ---- */
.spinner-multi {
    display: inline-block;
    vertical-align: middle;
    width: 1.15em;
    height: 1.15em;
    border-radius: 50%;
    background: conic-gradient(
        #ff6b6b   0deg,
        #ffd93d  90deg,
        #6bcb77 180deg,
        #4d96ff 270deg,
        #ff6b6b 360deg
    );
    -webkit-mask: radial-gradient(farthest-side, transparent 54%, #000 55%);
    mask: radial-gradient(farthest-side, transparent 54%, #000 55%);
    animation: spin-multi 0.8s linear infinite;
}
@keyframes spin-multi {
    to { transform: rotate(360deg); }
}

/* ---- Responsive tweaks ---- */
@media (max-width: 576px) {
    .bubble { max-width: 88%; }
    .chat-window { height: calc(100vh - 240px); min-height: 280px; }
    .therapy-card .card-body { padding: 1.5rem 1rem; }
}
