

:root{--primary-color:#112c46;--header-height:60px;--input-height:85px;--bubble-radius:12px;--border-radius:8px;--bubble-padding:12px;    --input-background-color: hsl(255, 25%, 98%);--background-border-color: hsl(240deg, 25%, 88%)}
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0;}
body {
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial,
    sans-serif;
  font-weight: 400;
  line-height: 1.5;background-color:#f2f2f2;}
header{position:fixed;top:0;left:0;right:0;height:var(--header-height);background:var(--primary-color);display:flex;align-items:center;padding:0 16px;z-index:1000;}
header img{height:40px;} header p{margin-left:12px;color:#fff;background:rgba(255,255,255,0.15);padding:4px 10px;border-radius:20px;font-size:18px;}

header .header-btn{
    color: var(--primary-color);
    background-color: white;
    border-radius: 4px;
    padding: 0 4px;
}

.content a{
    color: var(--primary-color);;
    font-weight: 500;
}

#barra-laterale {
    padding-top: calc(40px + var(--header-height));
    position: fixed;
    width: 285px;
    pointer-events: auto;
    height: 100%;
    padding-left: 10px;
    padding-right: 10px;
}
#barra-laterale .menu-tag {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-content: space-around;
    justify-content: space-around;
    gap: 4px;
    padding: 4px;
}
.menu-tag .tag-pill{
    font-size: 10px;
}
#barra-laterale .box,
.menu-laterale .box {
    border: 1px solid var(--background-border-color);
    background: var(--input-background-color);
    border: 1px solid var(--background-border-color);
    height: auto;
    margin-top: 10px;
    border-radius: var(--border-radius);
}
#barra-laterale #tag-suggestions-list li{
    font-size: 12px;
}
/* Scrollbar sottile */
.chat-container::-webkit-scrollbar {
  width: 6px;
}
.chat-container::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}
.bubble {
    width: 100%;
    border-radius: 3px;
    padding: var(--bubble-padding);
    margin-bottom: 8px;
    background-color: white;
}
.bubble .username{font-weight:bold;font-size:0.85rem;color:rgba(0,0,0,0.7);margin-bottom:4px;}
.bubble .content{font-size:1rem;color:#000;margin-bottom:8px;white-space:pre-wrap;white-space: pre-wrap;
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: normal;  
  hyphens: auto;}
.bubble img {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 8px;
}
.thread-container{
    display: flex
;
    overflow-y: auto;
    padding: 8px 10px;
    position: absolute;
    top: calc(50px + var(--header-height));
    bottom: var(--input-height);
    left: 0;
    right: 0;
    background-color: #f2f2f2;
    scroll-behavior: smooth;
    padding-bottom: 10px;
    flex-direction: column;
}
#barra-laterale {
    overflow: scroll;
    scrollbar-width: thin;
}
#reply-indicator {
  display: none;
  bottom: calc(var(--input-height) + 8px);
  left: 0; right: 0;
  background: #fff;
  padding: 8px 16px;
  border-top: 1px solid #ddd;
  font-size: 0.9rem;
  color: var(--primary-color);
  align-items: center;
  justify-content: space-between;
  z-index: 1001;
}
    .chat-container {
    display: flex
;
    flex-direction: column-reverse;
    align-items: flex-start;
    overflow-y: auto;
    padding: 8px 10px;
    position: absolute;
    top: var(--header-height);
    bottom: 10px;
    left: 0;
    right: 0;
    background-color: #f2f2f2;
    scroll-behavior: smooth;
    padding-bottom: 10px;
}
#anteprimaImmagine {
    bottom: 120px;
    width: 100%;
    left: 300px;
    right: 0;
    align-items: center;
    padding: 0 8px;
    z-index: 1100;
    top: 260px;
}
#anteprimaImmagine img {
    max-width: calc(100% - 20px);
    margin: 10px;
    border-radius: 8px;
}
input#mediaInput{display:none;}
.input-bar {
    height: auto;
    align-items: center;
    box-shadow: 0 -1px 6px rgba(0, 0, 0, 0.1);
    display: flex
;
    padding: 4px;
    flex-direction: column;
    gap: 4px;
}
.input-bar textarea {
    height: 100px;
    display: block;
    box-sizing: border-box;
    width: 100%;
    margin: 0;
    color: #292938;
    background: var(--input-background-color);
    font-family: inherit;
    font-size: 14px;
    padding: 12px;
    line-height: normal;
    border: 0;
    outline: 0;
}
.input-bar button.upload, .input-bar button.send {
    display: flex
;
    align-items: center;
    gap: 4px;
    background: transparent;
    color: var(--primary-color);;
    border-radius: 6px;
    border: 1px solid var(--primary-color);;
    padding: 4px 8px;
    font-size: 13px;
    line-height: normal;
    font-weight: 400;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.controlli{
    display: flex
;
    gap: 4px;
    justify-content: center;
    flex-wrap: nowrap;
    flex-direction: row;
}
@media(min-width:1200px){
    header{
        display: flex;
        flex-wrap: nowrap;
        justify-content: space-between;
    }
    .chat-container,
    .thread-container{
    max-width: 500px;
    margin: auto;
    }
}

@media(max-width:600px){:root{--header-height:50px;--input-height:85px;}header img{height:32px;}    header p {
        font-size: 16px;
        text-align: center;
        margin: auto;
        margin-left: calc(50% - 145px);
    }.input-bar input[type="text"]{font-size:14px;padding:8px 12px;} .input-bar button.upload,.input-bar button.send{width:40px;height:40px;font-size:1.2rem;} }

.barra-bassa {
    display: flex;
    justify-content: space-between;
    flex-direction: row;
    align-items: center;
    align-content: center;
}
.micro-immagine {
    max-width: 105px !important;
    margin-bottom: -5px !important;
}
.channel-pill{
    font-size: 10px;
    background: var(--primary-color);
    padding: 2px 10px;
    border-radius: 8px;
    color: white;
}
.hashtag {
  color: var(--primary-color);
  font-weight: bold;
  text-decoration: none;
}
.hashtag:hover {
  text-decoration: underline;
}
#tag-menu {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  height: 40px;
  background: #fff;
  display: flex;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch; /* fluidità su iOS */
  padding: 8px 16px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
  z-index: 1000;
}
#tag-menu::-webkit-scrollbar {
  display: none; /* nasconde la scrollbar */
}
.tag-pill,
.menu-canali a {
    display: flex;
    flex: 0 0 auto;
    margin-right: 8px;
    padding: 4px 12px;
    border-radius: 16px;
    background: var(--primary-color);
    color: #fff;
    text-decoration: none;
    font-size: 0.85rem;
    white-space: nowrap;
    align-content: center;
    align-items: center;
}
.tag-pill:hover {
  opacity: 0.8;
}
/* Barra “lineare” stile Bluesky */
.bubble .barra-bassa {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 6px 0 0;
  margin-top: 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  font-size: 0.75rem;
  color: #657786; /* grigio neutro tipo Bluesky */
}

/* Timestamp sulla sinistra */
.bubble .barra-bassa time {
  flex-shrink: 0;
  color: inherit;
}

/* Wrapper delle azioni sulla destra */
.bubble .barra-bassa .reply-link {
  display: flex !important;
  align-items: center;
  gap: 1.5rem;
  text-decoration: none;
  color: inherit;
}

/* Pulsanti like/dislike/comment */
.bubble .barra-bassa .btn-react,
.bubble .barra-bassa .btn-send,
.bubble .barra-bassa .btn-repost,
.bubble .barra-bassa .post-btn {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  cursor: pointer;
  color: inherit;
  transition: color 0.2s ease-in-out;
}

/* Spazio tra icona e contatore */
.bubble .barra-bassa .btn-react span {
  margin-left: 4px;
  font-weight: 500;
}

/* Icona comment */
.bubble .barra-bassa .fa-comment-dots {
  font-size: 1rem;
}

/* Hover con primary color */
.bubble .barra-bassa .btn-react:hover,
.bubble .barra-bassa .fa-comment-dots:hover {
  color: var(--primary-color);
}

/* Mobile tweaks */
@media (max-width: 600px) {
  .bubble .barra-bassa {
    padding-top: 4px;
    margin-top: 6px;
    gap: 0.5rem;
  }
  .bubble .barra-bassa .reply-link {
    gap: 1rem;
  }
}
.link-preview {
    display: flex;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    margin-bottom: 8px;
    flex-direction: column;
}

.link-preview .preview-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.link-preview .preview-body {
  padding: 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.link-preview .preview-title {
  font-weight: bold;
  margin-bottom: 4px;
  font-size: 0.95rem;
}
.link-preview .preview-desc {
  font-size: 0.85rem;
  color: #555;
}


.bubble .reply-preview {
  border-radius: ;px
}


.reply-preview {
    display: flex;
    align-items: flex-start;
    background: #ffffff;
    border: 1px solid #e1e8ed;
    padding: 6px 10px;
    margin-bottom: 2px;
    transition: background 0.2s, box-shadow 0.2s;
}


.reply-preview:hover {
  background: #f7f9fa;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.reply-preview > a {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: inherit;
    width: 100%;
}


.reply-preview > a > i {
  flex-shrink: 0;
  font-size: 1rem;
  color: var(--primary-color);
  margin-top: 4px; 
}

.reply-preview > a > div {
    display: flex !important;
    flex-direction: column-reverse;
    align-items: flex-start !important;
    gap: 4px;
    flex: 1;
    font-size: 0.75rem;
    color: #555;
    line-height: 1.3;
    word-break: break-word;
}


@media (max-width: 600px) {
  .reply-preview {
    padding: 5px 8px;
  }
  .reply-preview > a > div {
    font-size: 0.7rem;
    gap: 3px;
  }
  .reply-preview > a > i {
    margin-top: 2px;
    font-size: 0.9rem;
  }
}


/* Contenitore laterale */
.menu-laterale {
    padding: 10px;
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: 280px;
  background: #fff;
  box-shadow: 2px 0 12px rgba(0,0,0,0.2);
  transform: translateX(-100%);
  transition: transform 0.3s ease-in-out;
  z-index: 1001;
  overflow-y: auto;
}

.menu-canali{
    display: flex
;
    flex-direction: column;
    justify-content: space-around;
    align-content: space-around;
    align-items: center;
    gap: 10px;
    padding: 10px;
}
/* Quando è aperto */
.ritorna {
  display: none;
}
.ritorna.open {
    display: block !important;
    width: 100%;
    height: 100%;
    background-color: #0000007a;
    position: absolute;
    z-index: 1;
}
/* Quando è aperto */
.menu-laterale.open {
  transform: translateX(0);
}



/* Overlay visibile quando menu aperto */
.menu-laterale.open + .overlay {
  opacity: 1;
  pointer-events: auto;
}

/* Pulsante di toggle (float laterale) */
.toggle-menu-btn {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 1002;
  background: var(--primary-color);
  border: none;
  color: #fff;
  padding: 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
}
.toggle-menu-btn:hover {
  background: darken(var(--primary-color), 10%);
}
/* search bar mobile */
.search-bar-mobile {
    padding: 8px;
}

.search-bar-mobile input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 6px;
}

/* sposta il thread-content sotto la search-bar */
.chat-container,
.thread-container {
  padding-top: calc(var(--header-height) + 48px); /* 48px ≈ altezza search-bar + margin */
}

@media only screen and (min-width: 992px) {
    .compose-bar-mobile {
    display: block !important;
    background: none !important;
    position: relative !important;
    margin-top: 0px !important;
    padding-top: 0px !important;}
.compose-header{display: none !important;}}
.compose-bar-mobile {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #00000085;
    border-bottom: 1px solid #ddd;
    z-index: 1002;
    padding-top: 90px;
    height: 100%;
    margin-top: 50px;
}

.compose-form {
    padding: 5px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background-color: white;
}

.compose-textarea {
  width: 100%;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 0.75rem;
  resize: vertical;
  font-size: 1rem;
  line-height: 1.4;
}

.compose-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.action-btn {
  background: none;
  border: none;
  font-size: 1.25rem;
  padding: 0.5rem;
  border-radius: 6px;
  cursor: pointer;
}

.action-btn i{color: var(--primary-color);}
.action-btn:disabled i {color: #727775 !important;}
.action-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

.send-btn {
  margin-left: auto; /* spinge “Invia” a destra */
  color: var(--primary-color);
}
  .compose-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem;
    border-bottom: 1px solid #ddd;
  }
  .compose-header .title {
    font-weight: 600;
    font-size: 1rem;
  }
  .compose-header .close-btn {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
  }
  .compose-header .close-btn:hover {
    background: rgba(0,0,0,0.05);
  }
    .bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3.5rem;
    background: #fff;
    border-top: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 1002;
  }
  .bottom-nav button {
    background: none;
    border: none;
    font-size: 1.5rem;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--primary-color);
  }
  .bottom-nav button:active,
  .bottom-nav button:hover {
    background: rgba(0,0,0,0.05);
    border-radius: 6px;
  }
  .link-preview-card {
  margin: 0.5rem 0;
  border: 1px solid #ddd;
  border-radius: 6px;
  overflow: hidden;
}
.preview-link-card {
  text-decoration: none;
  color: inherit;
  display: block;
}
.preview-link-card img {
  width: 100%;
  object-fit: cover;
}
.preview-link-card h4 {
  margin: 0.5rem;
  font-size: 1rem;
}
.preview-link-card p {
  margin: 0.25rem 0.5rem 0.5rem;
  font-size: 0.875rem;
  color: #555;
}
.embedded{width: 100%;
    min-height: 150px;}
.embedded iframe {
    width: 100%;
    min-height: 250px;
    max-height: 500px;
}


