/* ============= Unlimited Crew Chat Widget ============= */

/* Osnovni widget */
.acwpro-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  font-family: system-ui, sans-serif;
  z-index: 9999;
}

/* Chat bubble */
.acwpro-toggle {
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  cursor: pointer;
  font-size: 16px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
.acwpro-toggle:hover { opacity: 0.95; }

/* Panel (desktop default) */
.acwpro-panel {
  background: #fff;
  width: 320px;
  max-height: 460px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  padding: 12px;
  margin-bottom: 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Poruke */
.acwpro-messages { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.acwpro-msg { padding: 8px 12px; border-radius: 16px; max-width: 80%; word-wrap: break-word; }
.acwpro-msg.user { background: #3b82f6; color: #fff; align-self: flex-end; }
.acwpro-msg.ai { background: #e5e7eb; color: #111; align-self: flex-start; }

/* Kontakt sekcija */
.acwpro-contact { text-align: center; margin-top: 12px; padding-top: 10px; border-top: 1px solid #ddd; }
.acwpro-buttons { display: flex; justify-content: center; gap: 8px; margin-top: 6px; }
.acwpro-btn { padding: 6px 12px; border-radius: 8px; text-decoration: none; font-weight: 500; }
.acwpro-btn.email { background: #3b82f6; color: #fff; }
.acwpro-btn.whatsapp { background: #25d366; color: #fff; }

/* Intro forma (ime + e-mail) */
.acwpro-intro { display: flex; flex-direction: column; gap: 8px; text-align: center; padding: 10px; }
.acwpro-intro-form input { width: 100%; margin: 4px 0; padding: 8px; border: 1px solid #ddd; border-radius: 6px; }
.acwpro-intro-form button { background: #3b82f6; color: #fff; border: none; padding: 8px 12px; border-radius: 6px; cursor: pointer; }
.acwpro-intro-form button:hover { opacity: 0.9; }

/* Scrollbar estetika */
.acwpro-messages::-webkit-scrollbar { width: 6px; }
.acwpro-messages::-webkit-scrollbar-thumb { background-color: rgba(0,0,0,0.2); border-radius: 3px; }

/* ========= MOBILNI + TABLET (do 1024px) ========= */
@media (max-width: 1024px) {
  .acwpro-toggle {
    position: fixed;
    right: 15px;
    bottom: 15px;
    width: 55px;
    height: 55px;
    font-size: 15px;
    z-index: 99999;
  }
  .acwpro-panel {
    position: fixed;
    right: 15px;
    bottom: 75px;         /* 55px gumb + razmak */
    width: 85vw;          /* 85% širine ekrana */
    max-width: 420px;
    max-height: 70vh;     /* 70% visine ekrana */
    border-radius: 14px;
    padding: 10px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.25);
    background: #fff;
    overflow: hidden;
    margin: 0;
    z-index: 99998;
  }
  .acwpro-msg { font-size: 15px; line-height: 1.4; }
  .acwpro-btn { font-size: 14px; padding: 6px 10px; }
  .acwpro-widget { width: auto; height: auto; }
}
.acwpro-panel[hidden] { display: none !important; }
/* ---- HARD OVERRIDE: mobile/tablet panel NE smije biti fullscreen ---- */
@media (max-width: 1024px) {
  /* bubble ostaje desno dolje */
  .acwpro-toggle {
    position: fixed !important;
    right: 15px !important;
    bottom: 15px !important;
    width: 55px !important;
    height: 55px !important;
    z-index: 99999 !important;
  }

  /* widget sam po sebi ne smije upravljati layoutom */
  .acwpro-widget {
    position: fixed !important;
    right: 15px !important;
    bottom: 15px !important;
    left: auto !important;
    width: auto !important;
    height: auto !important;
    z-index: 99990 !important;
  }

  /* PANEL: nikad 100% ekrana; sidro iznad bubblea */
  .acwpro-widget .acwpro-panel {
    position: fixed !important;
    right: 15px !important;
    left: auto !important;
    bottom: 75px !important;              /* 55px bubble + razmak */
    top: auto !important;

    width: 85vw !important;               /* 85% širine ekrana */
    max-width: 420px !important;
    height: auto !important;              /* nikad fiksna visina */
    max-height: 70vh !important;          /* najviše 70% visine ekrana */

    margin: 0 !important;
    padding: 10px !important;
    border-radius: 14px !important;
    overflow: hidden !important;
    box-shadow: 0 6px 18px rgba(0,0,0,0.25) !important;
    background: #fff !important;
    z-index: 99998 !important;

    transform: none !important;           /* poništi moguće transformacije */
  }

  /* sigurnosno: ako neka tema postavlja 100% na djecu, ograniči */
  .acwpro-panel, .acwpro-panel * {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* panel mora biti stvarno skriven kad je [hidden] */
  .acwpro-panel[hidden] { display: none !important; }
}


