
.agent-header{
    display:flex; 
    align-items:center;
    justify-content: center;
    gap:12px; 
    padding:.3em 1em; 
    border-bottom: 1px solid rgba(255,255,255,.06);
    position: sticky; 
    top:0; 
    background:linear-gradient(180deg, rgba(255,255,255,.04), transparent);
    backdrop-filter: blur(6px);
}

.agent-title a{
    font-weight:700; 
    letter-spacing:.2px; 
    color: var(--text); 
    text-decoration:none;
}
.agent-title a:hover{
    text-decoration: underline;
}

.agent-links{
    display:flex; 
    gap:12px; 
    align-items:center;
}

.agent-links a {
    color: var(--muted); 
    font-size: .9rem; 
    text-decoration:none;
}
.agent-links a:hover {
    text-decoration: underline;
}

#agent-header {
    flex-shrink: 0;  /* always visible */
}

#agent-footer {
    flex-shrink: 0;   /* don’t collapse or push out of view */
}

.agent-footer {
    background: rgba(0,0,0,0.35);
    padding: .5rem 0;
    z-index: 1000;
}

.agent-footer img{
    width:2rem; 
    height:2rem; 
    cursor:pointer;
}

.chat {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100svh;   /* full viewport height */
    max-height: 100vh;
    overflow: hidden; /* prevent anything from pushing outside */
}
.chat__header{
    display:flex; 
    align-items:center; 
    gap:12px; 
    padding:14px 18px; 
    border-bottom: 1px solid rgba(255,255,255,.06);
    position: sticky; 
    top:0; 
    background:linear-gradient(180deg, rgba(255,255,255,.04), transparent);
    backdrop-filter: blur(6px);
}
.title{
    font-weight:700; letter-spacing:.2px;
}
.status{ margin-left:auto; display:flex; align-items:center; gap:8px; }
.dot{ width:10px; height:10px; border-radius:50%; background: #22c55e; box-shadow:0 0 0 4px rgba(34,197,94,.15); }
.muted{ color: var(--muted); font-size: .9rem; }
.visually-hidden{ position:absolute !important; height:1px; width:1px; overflow:hidden; clip:rect(1px, 1px, 1px, 1px); white-space:nowrap; }
chat {
flex: 1 1 auto;
min-height: 0;
height: 100%;
}

#messages-wrapper {
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 0;   /* VERY important for mobile scrolling */    
    flex-direction: column;             /* take all remaining space */
    display: flex;
    box-shadow: 0 0 7px rgba(88, 129, 87, 0.5) inset;
    position: relative;
}

.messages {
    position: relative;
    z-index: 0;
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 0;      /* required */
    gap: .5rem;
    width: 100%;
    max-width: 100%;
    -ms-overflow-style: none;   /* hide scrollbar in IE and Edge */
    scrollbar-width: none;   
    overscroll-behavior: contain;        /* stop rubber-band / parent scroll */
    -webkit-overflow-scrolling: touch;   /* iOS momentum scrolling */   
}

.msg{
    display:flex; 
    gap:10px; 
    max-width: 95%;
}
.msg.user{ align-self:flex-end; flex-direction: row-reverse; }
.msg .avatar{
    width:32px; height:32px; border-radius:50%; background:#0b1220; display:grid; place-items:center; color:#93c5fd; flex: 0 0 32px;
    border:1px solid rgba(255,255,255,.08);
}
.msg.user .avatar{ color:#34d399; }

.bubble{
    padding: 10px 12px; 
    position:relative; 
    word-wrap:break-word; 
}

.msg.user .bubble{ 
background: var(--bubble-bot); 
color: var(--text); 
border-radius: 20px;
font-family: 'Roboto', sans-serif;
font-size: 1.1rem;
}

.msg.bot .bubble{ 
color: var(--fern); 
font-family: "Roboto", sans-serif;
letter-spacing: 0.05em;
}
.meta{ font-size: .75rem; color: var(--muted); margin-top: 4px; }

.agent_btn{
    border:none; 
    padding:12px 14px; 
    border-radius:14px; 
    font-weight:600; 
    cursor:pointer;
    background: linear-gradient(135deg, var(--fern), var(--mint)); 
    color:var(--sage);
    display:flex; 
    align-items:center; 
    gap:8px; 
    box-shadow: 0 8px 16px rgba(0,0,0,.25);
}
.agent_btn[disabled]{ opacity:.6; cursor:not-allowed; }

.toolbar{ margin-left: 8px; display:flex; gap:8px; }
.icon-btn{
    background: transparent; border:1px solid rgba(255,255,255,.12); color: var(--text);
    padding: 8px 10px; border-radius:12px; cursor:pointer;
}

.icon-image {
    width: 2rem;
    height: 2rem;
}

::-webkit-scrollbar{ width: 10px; height: 10px; }
::-webkit-scrollbar-thumb{ background: rgba(255,255,255,.15); border-radius: 8px; }
::-webkit-scrollbar-track{ background: transparent; }

/* Animated typing dots */
.typing-indicator {
    display: flex;
    justify-content: center;
    gap: 6px;
    align-items: center;
    margin: 15px 0;
    width: 100%;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background-color: white;
    border-radius: 50%;
    animation: bounce 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}
.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes bounce {
0%, 80%, 100% {
    transform: scale(0.6);
    opacity: 0.6;
}
40% {
    transform: scale(1);
    opacity: 1;
}
}

/*
    CSS For components
*/
.component {
  position: relative;
  width: 100%;
  color: white;
  overflow: hidden;
  max-width: 95%;
  margin-left: .5rem;
  margin-bottom: 2rem;
  border-radius: .5rem;
}

/* appear animation for any component */
.component.show {
  opacity: 1;
  transform: translateY(0);
}



.component a {
    color: rgb(145, 240, 72);
    text-decoration: underline;
}
.component a:hover {
    color: rgb(102, 204, 0);
}

.message-bubble {
  display: inline-block;
  width: 100%;
}

.user-message-component {
    border-color: rgba(14, 165, 233, 0.4);
    font-size: 1rem;
    align-self: flex-end; /* move user messages to right side */
}

.agent-messages {
    width: 100%;
    display: flex;
    flex-direction: column;
}

.joke-component {
    display: flex;
    flex-direction: column;
}

.joke-text-bar {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: .5em;
}

.joke-text {
    padding: .3rem .3rem;
    color: white;
    min-height: 2rem;
    font-size: 1.2rem;
}

.joke-component-flags {
    display: flex;
    gap: 1rem;
}

.joke-component-action-panel {
    display: flex;
    flex-direction: row;
    position: relative;
    margin-top: .5rem;
    justify-content: space-between;
    padding: 0 .5rem;
}

.joke-component-action-panel img{
    width: 2rem;
    height: 2rem;
}

.joke-component-action-panel img:hover {
    transform: scale(1.1);
    transition: transform 0.2s;
    cursor: pointer;
}

.joke-component-ratings {
    display: flex;
    justify-content: center;
    gap: .5rem;
    min-width: 100px;
    border-radius: .5rem;
    background-color: rgba(255, 255, 255, .2);
    padding: .2rem .5rem;
}

.joke-component-ratings img {
    width: 2.5rem;
    height: 2.5rem;
}

.joke-component-ratings-rated {
    background-color: rgba(0, 255, 0, .4);
}

.submit-joke-cta-component {
    background-color: rgba(34, 197, 94, 0.2);
    padding: 1rem;
    border-radius: .5rem;
    text-align: center;
    font-size: 1rem;
    cursor: pointer;
}

.staff-notes {
    font-size: .7rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: .5rem;
}

.staff-notes:hover {
    color: white;
    text-decoration: underline;
    cursor: pointer;
}

.custom-topic-input {
    border-radius: .5rem;
    padding: .5rem;
    font-size: .9rem;
    width: 200px;
}

.joke-status-indicator{
    width: 100%;
    height: .3rem;
    border-radius: .5em .5em 0 0;
}

.joke-status-indicator-approved{
    background-color: #22c55e;
}

.joke-status-indicator-registered_approved{
    background-color: #abbf15;
}

.joke-status-indicator-paid_approved{
    background-color: #ef4444;
}

.big-buttons-component {
    background-color: transparent;
    font-size: .7rem;
    padding: 0;
}
.rating-buttons {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-content: center;
}

.rating-buttons div {
    display: flex;
    gap: 3em;
    align-items: center;
    justify-content: center;
}

.rating-buttons img:hover {
    transform: scale(1.1);
    transition: transform 0.2s;
    cursor: pointer;
}

.big-buttons-component .rating-section {
    display: flex;
    gap: .3rem;
}

.big-buttons-component .rating-section .action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    align-items: end;
}

.submit-joke-hide {
    display: none;
}
.submit-joke-show {
    display: block;
}

.response-component {
    border-color: rgba(227, 7, 212, 0.4);
    font-size: 1rem;
}

.message-component {
    border-color: rgba(227, 7, 212, 0.4);
    font-size: 1rem;
}

.login-register-component {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 1rem;
}

.login-component,
.registration-component {
    border-color: rgba(221, 240, 8, 0.6);
    font-size: 1rem;
    position: relative;
}

.menu-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: .5rem;
}
.menu-item {
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: .5rem;
    padding: .5rem 1rem;
    color: white;
    font-size: .7rem;
    
}
.menu-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    cursor: pointer;
}
.menu-item a,
.menu-item a:hover {
    color: white;
    text-decoration: none;
}

.login-shield {
    background-color: rgba(235, 125, 219, 0.8);
    color: white;
    padding: .5rem 1rem;
    border-radius: .5rem;
    font-size: .9rem;
}

.login-shield a {
    color: rgb(0, 0, 0);
    font-weight: 600;
    text-decoration: none;
}
.login-shield a:hover {
    color: rgb(0, 0, 0);
    text-decoration: underline;
}

.overlay {
  position: absolute;
  inset: 0; 
  background-color: rgba(0, 0, 0, 0.6);
  justify-content: center;
  align-items: center;
  z-index: 1000;
  display: flex;
  align-items: start;
  padding-top: 15%;
}

#overlay-component-holder {
    max-height: 70vh;
    overflow-y: auto;
}

.overlay-content {
    background-color: rgba(0, 0, 0, 0.9);
    padding: 1rem;
    border-radius: .5rem;
    position: relative;
    width: 90%;
    max-width: 400px;
    border: 3px solid rgba(34, 180, 233, 0.5);
}

.overlay-close-button {
    position: absolute;
    top: .5rem;
    right: .5rem;
    font-size: 1.5rem;
    color: white;
    cursor: pointer;
}

.overlay-close-button:hover {
    color: #22c55e;
    cursor: pointer;
}

.overlay-hidden {
    display: none;
}

.component-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    display: flex;
    border-radius: .5rem;
    border: 3px solid rgba(255, 255, 255, 0.2);
}

.component-overlay-hidden {
    display: none;  
}

#reading-zone-marker {
    position: fixed;
    left: 0;
    width: 100%;
    background: rgba(255, 0, 0, 0.15); /* translucent red */
    pointer-events: none; /* don't block scrolling */
    z-index: 9999;
}

.ontop {
    position: absolute;   /* instead of fixed */
    inset: 0;  
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: black; /* translucent black */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.ontop-hidden {
    display: none;
}

#screenshot-joke-container {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    height: 100%;
    overflow: hidden;
    background-image: url('/static/images/screenshot-background.png');
    background-size: cover;          /* scale to fill container */
    background-position: center;     /* keep subject centered */
    background-repeat: no-repeat;    /* prevent tile repetition */
}

#share-btn {
    width: 1.5rem;
    height: 1.5rem;
    margin-top: .3rem;
}


#screenshot-joke-text {
    flex: 1 1 auto;   
    color: black;
    font-size: 2rem;
    white-space: pre-wrap; /* preserve line breaks */
    background-color: rgba(240, 206, 155, 0.9);
    padding: 1rem;
    border-radius: .5rem .5rem 0 0;

}

#screenshot-joke-footer {
    flex: 0 0 auto;
    text-align: center;
    color: black;
    font-size: 1.5rem;
    font-weight: bold;
    background-color: rgba(240, 206, 155, 0.9);
    padding: 1rem;
    border-radius: 0 0 .5rem .5rem;
}

.flag-joke-component img {
    width: 2rem;
    height: 2rem;
    cursor: pointer;
}
