/* ===== AI TUTOR CHAT BUBBLE ===== */
#ep-tutor-wrap {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    font-family: var(--font-body, 'Inter', sans-serif);
}

#ep-tutor-btn {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: var(--color-accent-gold, #F5C518);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(245,197,24,.45);
    display: flex; align-items: center; justify-content: center;
    transition: transform .2s, box-shadow .2s;
    position: relative; z-index: 2;
    color: #0A0F1E;
}
#ep-tutor-btn:hover { transform: scale(1.08); box-shadow: 0 6px 28px rgba(245,197,24,.6); }
#ep-tutor-btn .ep-ic-close { display: none; }
#ep-tutor-btn.is-open .ep-ic-chat  { display: none; }
#ep-tutor-btn.is-open .ep-ic-close { display: block; }
#ep-tutor-btn::before {
    content: '';
    position: absolute; inset: -5px;
    border-radius: 50%;
    border: 2px solid var(--color-accent-gold, #F5C518);
    opacity: 0;
    animation: ep-tutor-ring 2.8s ease-out infinite;
}
@keyframes ep-tutor-ring {
    0%   { opacity:.7; transform:scale(1); }
    100% { opacity:0;  transform:scale(1.6); }
}

/* Panel */
#ep-tutor-panel {
    position: absolute;
    bottom: 68px; right: 0;
    width: 360px; height: 520px;
    background: #141929;
    border: 1px solid #2A3350;
    border-radius: 16px;
    box-shadow: 0 12px 48px rgba(0,0,0,.55);
    display: flex; flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    animation: ep-tutor-in .22s ease;
}
#ep-tutor-panel[hidden] { display: none; }
@keyframes ep-tutor-in {
    from { opacity:0; transform:scale(.93) translateY(10px); }
    to   { opacity:1; transform:scale(1)   translateY(0); }
}

/* Header */
.ep-tutor-hdr {
    display: flex; align-items: center; justify-content: space-between;
    padding: 13px 16px;
    background: #1E2740;
    border-bottom: 1px solid #2A3350;
    flex-shrink: 0;
}
.ep-tutor-hdr-left { display: flex; align-items: center; gap: 10px; }
.ep-tutor-av {
    width: 34px; height: 34px; border-radius: 50%;
    background: linear-gradient(135deg,#F5C518,#d4a81a);
    display: flex; align-items: center; justify-content: center;
    font-size: 17px; flex-shrink: 0;
}
.ep-tutor-hdr-title { color: #F0F0F0; font-weight: 700; font-size: .88rem; }
.ep-tutor-hdr-sub   { color: #8A93A8; font-size: .7rem;  margin-top: 1px; }
.ep-tutor-hdr-close {
    background: none; border: none;
    color: #8A93A8; cursor: pointer;
    font-size: 18px; line-height: 1; padding: 4px 6px;
    border-radius: 6px; transition: background .15s, color .15s;
}
.ep-tutor-hdr-close:hover { background: #2A3350; color: #F0F0F0; }

/* Messages */
#ep-tutor-msgs {
    flex: 1; overflow-y: auto;
    padding: 14px 12px;
    display: flex; flex-direction: column; gap: 10px;
    scroll-behavior: smooth;
}
#ep-tutor-msgs::-webkit-scrollbar { width: 4px; }
#ep-tutor-msgs::-webkit-scrollbar-thumb { background: #2A3350; border-radius: 2px; }

.ep-tm { display: flex; }
.ep-tm--user      { justify-content: flex-end; }
.ep-tm--assistant { justify-content: flex-start; }

.ep-tm-bubble {
    max-width: 86%; padding: 9px 13px;
    border-radius: 14px;
    font-size: .855rem; line-height: 1.58;
    word-break: break-word;
}
.ep-tm--user .ep-tm-bubble {
    background: #F5C518; color: #0A0F1E;
    border-bottom-right-radius: 3px; font-weight: 500;
}
.ep-tm--assistant .ep-tm-bubble {
    background: #1E2740; color: #F0F0F0;
    border: 1px solid #2A3350;
    border-bottom-left-radius: 3px;
}

/* Typing dots */
.ep-tm--typing .ep-tm-bubble {
    display: flex; gap: 5px; align-items: center;
    padding: 12px 16px;
}
.ep-tm--typing .ep-tm-bubble span {
    display: block; width: 7px; height: 7px;
    border-radius: 50%; background: #F5C518; opacity: .4;
    animation: ep-dot 1.2s ease-in-out infinite;
}
.ep-tm--typing .ep-tm-bubble span:nth-child(2) { animation-delay: .2s; }
.ep-tm--typing .ep-tm-bubble span:nth-child(3) { animation-delay: .4s; }
@keyframes ep-dot {
    0%,80%,100% { opacity:.35; transform:scale(1); }
    40%          { opacity:1;   transform:scale(1.35); }
}

/* Streaming cursor */
.ep-cursor {
    display: inline-block;
    width: 2px; height: 13px;
    background: #F5C518;
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: ep-cur .65s step-end infinite;
}
@keyframes ep-cur { 50% { opacity:0; } }

/* Action buttons */
.ep-tutor-action { padding: 2px 0 4px; }
.ep-tutor-action-btn {
    background: linear-gradient(135deg,#F5C518,#d4a81a);
    color: #0A0F1E; border: none;
    border-radius: 20px; padding: 7px 16px;
    font-size: .8rem; font-weight: 700;
    cursor: pointer; transition: transform .15s, box-shadow .15s;
}
.ep-tutor-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(245,197,24,.4);
}

/* Input row */
.ep-tutor-input {
    display: flex; align-items: flex-end; gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid #2A3350;
    background: #141929;
    flex-shrink: 0;
}
#ep-tutor-field {
    flex: 1;
    background: #1E2740; border: 1px solid #2A3350;
    border-radius: 12px; color: #F0F0F0;
    padding: 9px 13px; font-size: .855rem;
    font-family: inherit; resize: none;
    min-height: 40px; max-height: 110px;
    outline: none; line-height: 1.45;
    overflow-y: auto;
}
#ep-tutor-field:focus   { border-color: #F5C518; }
#ep-tutor-field::placeholder { color: #8A93A8; }
#ep-tutor-send {
    width: 38px; height: 38px; flex-shrink: 0;
    border-radius: 50%; background: #F5C518;
    color: #0A0F1E; border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: transform .15s;
}
#ep-tutor-send:hover:not(:disabled) { transform: scale(1.1); }
#ep-tutor-send:disabled { opacity: .45; cursor: not-allowed; }

/* Mobile full-screen */
@media (max-width: 480px) {
    #ep-tutor-panel {
        position: fixed;
        inset: auto 0 0 0;
        width: 100%; height: 72vh;
        border-radius: 18px 18px 0 0;
        bottom: 0;
    }
    #ep-tutor-wrap { bottom: 16px; right: 16px; }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
    #ep-tutor-btn::before,
    .ep-tm--typing .ep-tm-bubble span,
    .ep-cursor { animation: none !important; }
}
/* ===== AI Performance Coach — Feature 2 ===== */
#ep-coach-section { margin: 24px 0 32px; }
.ep-coach-card {
  background: #141929;
  border-left: 4px solid #F5C518;
  border-radius: 12px;
  padding: 20px 24px;
  box-shadow: 0 2px 16px rgba(0,0,0,.35);
}
.ep-coach-hdr {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.ep-coach-icon { font-size: 1.4rem; }
.ep-coach-title {
  font-size: 1rem;
  font-weight: 600;
  color: #F5C518;
  flex: 1;
}
.ep-coach-badge {
  font-size: .6rem;
  font-weight: 700;
  background: linear-gradient(135deg, #F5C518, #d4960a);
  color: #0A0F1E;
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.ep-coach-body {
  color: #c8d0e0;
  font-size: .95rem;
  line-height: 1.75;
  min-height: 48px;
}
.ep-coach-loading {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ep-coach-sk {
  height: 13px;
  border-radius: 6px;
  width: 100%;
  background: linear-gradient(90deg, #1E2740 25%, #2a3558 50%, #1E2740 75%);
  background-size: 200% 100%;
  animation: ep-sk-shimmer 1.4s infinite linear;
}
.ep-coach-sk-sm { width: 78%; }
.ep-coach-sk-xs { width: 52%; }
@keyframes ep-sk-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}