/* Universal branding for all coaches */
/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@600&family=Open+Sans:wght@400&family=Poppins:wght@700&display=swap');

/* Brand tokens */
:root{
  --brand-dark:#002f45;
  --brand-mid:#1a3d52;
  --brand-accent:#16c2c6;
  --bg:#f7fafc;
  --text:#1f2937;
  --muted:#4a5568;
  --white:#ffffff;
  --shadow:0 20px 40px rgba(0,0,0,0.1);
  --radius:20px;
}

/* Reset-ish */
*{margin:0;padding:0;box-sizing:border-box}

/* Base */
html,body{height:100%}
body{
  font-family:'Open Sans','Lato',sans-serif;
  background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand-mid) 100%);
  color: var(--white);
}

/* Card container (login + chat shell) */
.container, .chat-container{
  background: var(--white);
  color: var(--text);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: 900px;
  width: 92%;
  margin: 24px auto;
}

/* Header */
.header{
  background: linear-gradient(45deg, var(--brand-dark), var(--brand-accent));
  color: var(--white);
  padding: 20px;
  text-align:center;
  border-top-left-radius: var(--radius);
  border-top-right-radius: var(--radius);
  position: relative;
}
.coach-info{
  display:flex;align-items:center;justify-content:center;gap:14px;margin-bottom:6px;
}
.header-avatar{
  width:60px;height:60px;border-radius:50%;object-fit:cover;
  border:3px solid rgba(255,255,255,.35);
}
.coach-name{
  font-family:'Poppins',sans-serif;font-weight:700;font-size:28px;
}
.tagline{opacity:.9}

/* Mini tags row under tagline */
.expertise-tags{
  display:flex;flex-wrap:wrap;justify-content:center;gap:10px;margin-top:10px
}
.tag{
  background: rgba(255,255,255,.2);
  padding:6px 12px;border-radius:14px;font-size:12px;font-weight:600;
}

/* Login card specifics */
.container{padding:32px}
.logo-section{margin-bottom:16px}
.expertise-grid{
  display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:16px 0;
}
.expertise-item{
  background:#f7fafc;padding:12px;border-radius:10px;color:var(--muted);font-size:14px;
}
.expertise-item strong{color:var(--text)}
.access-form{margin-top:12px}
.form-group{margin-bottom:16px;text-align:left}
label{display:block;margin-bottom:6px;font-weight:600;color:var(--text)}
input[type="text"], input[type="password"]{
  width:100%;padding:12px;border:2px solid #e2e8f0;border-radius:10px;font-size:16px;outline:none;
  background: rgba(255,255,255,0.95) !important;
  color: #1a1a1a !important;
}
input[type="text"]:focus, input[type="password"]:focus{
  border-color:var(--brand-accent);
  color: #1a1a1a !important;
  background: rgba(255,255,255,0.98) !important;
}
input[type="text"]::placeholder, input[type="password"]::placeholder {
  color: #666666 !important;
  opacity: 1 !important;
}
.submit-btn, .send-btn{
  width:100%;padding:12px;border:none;border-radius:12px;
  background: linear-gradient(135deg, var(--brand-accent) 0%, #00bcd4 100%);
  color:#fff;font-weight:700;cursor:pointer;transition:transform .2s
}
.submit-btn:hover, .send-btn:hover{transform:translateY(-1px)}
.submit-btn:disabled, .send-btn:disabled{opacity:.6;cursor:not-allowed}
.error-message{color:#e53e3e;margin-top:8px}
.loading{color:var(--brand-accent);margin-top:8px}

/* Chat layout */
.chat-container{display:flex;flex-direction:column;min-height:70vh}
.messages{flex:1;max-height:calc(100vh - 220px);overflow-y:auto;padding:20px}
.message{display:flex;align-items:flex-start;gap:12px;margin-bottom:18px}
.message-avatar{
  width:40px;height:40px;border-radius:50%;display:flex;align-items:center;justify-content:center;
  font-weight:700;font-size:14px;flex-shrink:0;overflow:hidden;background:#e2e8f0;color:#2d3748
}
.avatar-image{width:100%;height:100%;object-fit:cover;border-radius:50%}
.message.user{flex-direction:row-reverse}
.message.user .message-avatar{background:var(--brand-accent);color:#fff}
.message.user .message-content{
  background: var(--brand-accent);
  color:#ffffff !important;
  font-weight: 600 !important;
  border-color: transparent;
  border-bottom-right-radius:6px;
}
.message.assistant .message-content{
  border-bottom-left-radius:6px;
  background: rgba(255,255,255,0.95) !important;
  color: #1f2937 !important;
  word-wrap: break-word;
  overflow-wrap: break-word;
  padding: 16px 20px !important;
  border-radius: 12px !important;
  line-height: 1.6 !important;
}

/* Input area */
.input-container{
  padding:16px;
  background:#fff;
  border-top:1px solid #e2e8f0;
}

/* Use flexbox for better mobile responsiveness */
.input-form{
  display:flex;
  gap:8px;
  align-items:center;
  max-width:900px;
  margin:0 auto;
  flex-wrap:wrap;
}

.input-field{
  flex:1;
  min-width:200px;
  min-height:44px;
  padding:12px 14px;
  border:2px solid #e2e8f0;
  border-radius:24px;
  font-size:16px;
  outline:none;
}
.input-field:focus{ border-color: var(--brand-accent); }

.send-btn{
  padding:12px 18px;
  border:none;
  border-radius:24px;
  font-weight:700;
  color:#fff;
  cursor:pointer;
  white-space:nowrap;
  flex-shrink:0;
}

.download-btn{ 
  background:#4CAF50; 
  padding:12px 16px;
}

/* Mobile responsive adjustments */
@media (max-width: 640px) {
  .input-form {
    gap:6px;
  }

  .send-btn, .download-btn {
    padding:12px 16px;
    font-size:14px;
  }

  .download-btn {
    padding:12px 10px;
  }
}

/* Very small screens - stack buttons below input */
@media (max-width: 640px) {
  .input-form {
    flex-direction:column;
    gap:6px;
  }

  .input-field {
    width:100%;
    min-width:unset;
  }

  .send-btn, .download-btn {
    width:100%;
    padding:12px;
  }
}



/* Typing indicator */
.typing-indicator{display:none;align-items:center;gap:10px;margin:8px 20px}
.typing-indicator.show{display:flex}
.typing-dot{width:8px;height:8px;background:#cbd5e0;border-radius:50%;animation:typing 1.5s infinite}
.typing-dot:nth-child(2){animation-delay:.2s}
.typing-dot:nth-child(3){animation-delay:.4s}
@keyframes typing{0%,60%,100%{transform:translateY(0)}30%{transform:translateY(-8px)}}

/* Misc */
.logout-btn{
  position:absolute;top:16px;right:16px;background:rgba(255,255,255,.2);
  color:#fff;border:none;padding:8px 14px;border-radius:14px;font-size:14px;cursor:pointer
}
.logout-btn:hover{background:rgba(255,255,255,.3)}
.welcome-message{
  text-align:center;
  color:#ffffff !important;
  background: rgba(22,194,198,0.2) !important;
  margin:24px 0;
  padding: 16px !important;
  border-radius: 12px !important;
  font-style:italic;
  font-weight: 600 !important;
  white-space:normal;        /* allow wrapping */
  overflow-wrap:anywhere;    /* break long words if needed */
  max-width:100%;
}


/* Assistant response formatting */
.message.assistant .message-content h4{color:var(--brand-accent);margin:12px 0 8px 0;font-weight:700;font-size:16px}
.message.assistant .message-content ul{margin:10px 0 0 18px}
.message.assistant .message-content li{margin-bottom:6px;line-height:1.5}
.message.assistant .message-content p{margin-bottom:12px;color:#2d3748 !important}
.message.assistant .message-content strong{color:#1f2937 !important}
/* --- Avatar sizing (header & chat) --- */
.header-avatar {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.3);
}

.avatar-image {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 50%;
}

/* Safety: never let any <img> blow up the layout */
img { max-width: 100%; height: auto; }

.header { text-align: center; }
.coach-info { display:flex; align-items:center; justify-content:center; gap:12px; }
.tagline { opacity:.9; }
.expertise-tags { display:flex; flex-wrap:wrap; justify-content:center; gap:8px; margin-top:10px; }
/* Access page button */
.access-btn { width: 100%; }                 /* always full width */
/* Or, if you want full width only on small screens: */
/*
@media (max-width: 640px) {
  .access-btn { width: 100%; }
}
*/
.starter-prompts{
  display:flex; flex-wrap:wrap; gap:8px; margin:12px auto 0; max-width:900px;
}
.starter-prompts button{
  padding:8px 12px; border-radius:20px; border:1px solid var(--brand-accent);
  background:rgba(22,194,198,0.12); color:#005e70; font-weight:600; cursor:pointer;
}
.starter-prompts button:hover{ filter:brightness(1.05); }

/* Pills + emoji (header tags) */
.expertise-tags { gap: 12px; }

.tag{
  background:#ffffff;
  color:#0b3a46;
  border:1px solid rgba(0,0,0,0.08);
  font-size:16px;
  padding:8px 14px;
  border-radius:16px;
}

/* Removed emoji-specific styling for cleaner look */

.tag--specialty{
  background:#ffffff;
  color:#0b3a46;
  border-color:rgba(0,0,0,0.08);
}
/* ===== JOE HERO HEADER ===== */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
  padding: 18px 20px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand-dark, #002f45), #0f5d70);
  color: #fff;
  box-shadow: var(--shadow, 0 24px 40px rgba(0,0,0,.1));
  margin: 16px auto 22px;
  max-width: 1100px;
}

.hero-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255,255,255,.35);
  display: block;
}

.hero-name {
  margin: 6px 0 2px;
  font: 800 28px/1.15 'Poppins', sans-serif;
}

.hero-subtitle {
  margin: 0;
  font: 500 15px/1.35 'Open Sans', sans-serif;
  opacity: .95;
}

/* ===== DESKTOP LAYOUT WRAPPER ===== */
.wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: 24px;
  justify-content: center;
}

/* ===== CARD LAYOUT ===== */
.card {
  max-width: 1100px;
  width: 100%;
  padding: 24px 28px;
  background: rgba(255,255,255,.06);
  border-radius: 14px;
  box-shadow: var(--shadow, 0 18px 34px rgba(0,0,0,.08));
  display: flex;
  flex-direction: column;
  align-items: center;
}

.expertise-list {
  list-style: none;
  margin: 14px 0 8px;
  padding: 0;
  font: 500 18px/1.55 'Open Sans', sans-serif;
  text-align: center;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.expertise-list li {
  margin: 0;
  text-align: center;
  padding: 12px 20px;
  background: rgba(255,255,255,0.12);
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  font-weight: 500;
  letter-spacing: 0.3px;
}

/* ===== ACCESS FORM STYLING ===== */
.access-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  width: 100%;
}

.access-input, .message-input, #messageInput, #accessCode,
input[type="text"], textarea, .input-field {
  width: 100%;
  max-width: 400px;
  padding: 14px 18px;
  border: 2px solid rgba(255,255,255,.2);
  border-radius: 12px;
  background: rgba(255,255,255,0.95) !important;
  color: #1a1a1a !important;
  font-size: 16px;
  text-align: center;
  border: 2px solid rgba(22,194,198,0.3) !important;
}

.access-input::placeholder, .message-input::placeholder,
#messageInput::placeholder, #accessCode::placeholder,
input[type="text"]::placeholder, textarea::placeholder, .input-field::placeholder {
  color: #666666 !important;
  opacity: 1 !important;
}

.access-input:focus, .message-input:focus, #messageInput:focus, #accessCode:focus,
input[type="text"]:focus, textarea:focus, .input-field:focus {
  color: #1a1a1a !important;
  background: rgba(255,255,255,0.98) !important;
  border-color: #16c2c6 !important;
  outline: none !important;
}

.primary-btn, .send-btn {
  padding: 14px 32px;
  background: linear-gradient(135deg, var(--brand-accent), #14a8ac);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.primary-btn:hover, .send-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(22,194,198,.3);
}

.note {
  font-size: 14px;
  opacity: 0.8;
  margin: 8px 0 0;
}

/* ===== CHAT INTERFACE STYLING ===== */
.chat-interface {
  width: 100%;
  max-width: 800px;
}

.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,.2);
  margin-bottom: 20px;
  font-size: 14px;
}

.logout-btn {
  padding: 8px 16px;
  background: rgba(255,255,255,.2);
  color: #fff;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}

.messages {
  height: 400px;
  overflow-y: auto;
  padding: 16px;
  background: rgba(255,255,255,.05);
  border-radius: 12px;
  margin-bottom: 16px;
}

.welcome-message, .message {
  margin-bottom: 12px;
  padding: 12px;
  border-radius: 8px;
}

.welcome-message {
  background: rgba(22,194,198,.2);
  text-align: center;
  font-style: italic;
}

.message {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  padding: 8px 0;
}

.message.user {
  flex-direction: row-reverse;
  margin-left: 20%;
}

.message.bot {
  margin-right: 20%;
}

.message-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
  overflow: hidden;
  background: #e2e8f0;
  color: #2d3748;
}

.message.user .message-content {
  background: rgba(255,255,255,.15);
  border-radius: 18px;
  border-bottom-right-radius: 6px;
}

.message.bot .message-content {
  background: rgba(22,194,198,.15);
  border-radius: 18px;
  border-bottom-left-radius: 6px;
  white-space: pre-line;
  line-height: 1.6;
}

.message.bot .message-content {
  padding: 16px 20px;
}

.message.bot .message-content h4 {
  color: var(--brand-accent);
  margin: 12px 0 8px 0;
  font-weight: 700;
}

.message.bot .message-content ul {
  margin: 10px 0;
  padding-left: 20px;
}

.message.bot .message-content li {
  margin-bottom: 6px;
  line-height: 1.5;
}

.message.bot .message-content p {
  margin-bottom: 12px;
}

.input-container {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.message-input {
  flex: 1;
  text-align: left;
  min-height: 50px;
  padding: 14px 18px;
  font-size: 16px;
  line-height: 1.4;
}

.send-btn {
  padding: 14px 24px;
}

.primary-btn {
  appearance: none;
  border: 0;
  border-radius: 28px;
  padding: 12px 22px;
  font: 700 16px/1 'Poppins', sans-serif;
  background: var(--brand-accent, #16c2c6);
  color: #003847;
  box-shadow: 0 6px 16px rgba(0,0,0,.12);
  display: block;
  width: fit-content;
  margin: 16px auto 0;
  cursor: pointer;
}

.primary-btn:hover {
  filter: brightness(1.05);
}

.note {
  margin-top: 10px;
  font-weight: 600;
  opacity: .9;
  text-align: center;
}

/* ===== DESKTOP SCALING ===== */
@media (min-width: 900px) {
  .hero {
    padding: 28px 32px;
    border-radius: 18px;
  }

  .hero-avatar {
    width: 96px;
    height: 96px;
  }

  .hero-name {
    font-size: 44px;
  }

  .hero-subtitle {
    font-size: 22px;
    font-weight: 600;
  }

  .card {
    padding: 28px 32px;
    border-radius: 18px;
  }

  .expertise-list li {
    font-size: 20px;
    line-height: 1.6;
  }

  .primary-btn {
    font-size: 18px;
    padding: 14px 24px;
  }

  .note {
    font-size: 16px;
  }
}

/* ===== MOBILE ADJUSTMENTS ===== */
@media (max-width: 640px) {
  .hero {
    flex-direction: column;
    text-align: center;
    gap: 14px;
    padding: 16px;
    margin: 12px 12px 18px;
  }

  .hero-avatar {
    width: 68px;
    height: 68px;
  }

  .hero-name {
    font-size: 24px;
  }

  .hero-subtitle {
    font-size: 14px;
  }

  .card {
    padding: 18px 22px;
  }
  /* Make chat input take more width and Send button take less */
  .chat-input {
    display: flex !important;
  }

  .chat-input input[type="text"],
  .chat-input textarea {
    flex: 1 1 auto !important;   /* let it expand to fill space */
    width: auto !important;      /* no fixed width */
  }

  .chat-input button,
  .chat-input input[type="submit"] {
    flex: 0 0 auto !important;   /* don't stretch */
    width: auto !important;      /* shrink to fit text */
    padding: 0 14px !important;  /* smaller button */
  }

  /* Force Joe's responses to be much wider on mobile */
  .message.bot {
    margin-right: 2% !important;  /* minimal margin for maximum width */
    margin-left: 2% !important;   /* small left margin too */
  }

  .message.bot .message-content,
  .message.assistant .message-content {
    max-width: 96% !important;
    width: 96% !important;
    margin: 0 auto !important;
    padding: 16px 20px !important;
    background: rgba(255,255,255,0.98) !important;
    color: #2d3748 !important;
    line-height: 1.6 !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    border-radius: 12px !important;
    font-weight: 400 !important;
  }

  .message.user {
    margin-left: 12% !important;
    margin-right: 2% !important;
  }

  .message.user .message-content {
    max-width: 86% !important;
    margin-left: auto !important;
    padding: 14px 18px !important;
    color: #ffffff !important;
  }
}