/* =========================
   kamerytanie.pl — style.css
   Mobile-first + czytelne menu
   ========================= */

:root{
  --bg: #f3f6ff;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #334155;
  --border: #e2e8f0;
  --shadow: 0 10px 30px rgba(2, 6, 23, .08);
  --shadow2: 0 6px 18px rgba(2, 6, 23, .08);
  --primary: #2563eb;
  --primary2:#1d4ed8;
  --dark: #0b1220;
  --dark2:#0f172a;
  --soft: #eef4ff;
  --softBorder:#bfdbfe;
}

*{ box-sizing:border-box; }
html,body{ margin:0; padding:0; }
body{
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: linear-gradient(180deg, #eaf0ff 0%, var(--bg) 35%, #ffffff 100%);
  color: var(--text);
}

a{ color:inherit; text-decoration:none; }
img{ max-width:100%; display:block; }

.container{
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
}

/* ===== TOP BAR ===== */
.topbar{
  background: linear-gradient(180deg, #0b1220 0%, #0f172a 100%);
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.topbar-wrap{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding: 14px 0;
}

.brand{
  font-weight: 800;
  font-size: 22px;
  letter-spacing:.2px;
  display:flex;
  align-items:center;
  gap:10px;
}

.brand span{
  color:#93c5fd;
  font-weight: 900;
}

/* desktop menu */
.menu{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.menu a{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.10);
  color:#fff;
  font-weight: 700;
  font-size: 14px;
  min-width: 120px;
  transition: .15s ease;
}

.menu a:hover{
  background: rgba(255,255,255,.14);
  transform: translateY(-1px);
}

/* ===== BUTTONS ===== */
.btns{ display:flex; gap:12px; flex-wrap:wrap; margin-top:14px; }

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid transparent;
  font-weight: 800;
  cursor:pointer;
  transition:.15s ease;
  user-select:none;
  min-height: 44px;
}

.btn-primary{
  background: var(--primary);
  color:#fff;
}
.btn-primary:hover{ background: var(--primary2); transform: translateY(-1px); }

.btn-light{
  background: #ffffff;
  border-color: var(--border);
  color: var(--text);
}
.btn-light:hover{ transform: translateY(-1px); box-shadow: var(--shadow2); }

/* ===== HERO ===== */
.hero{
  padding: 26px 0 8px;
}

.hero-grid{
  display:grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 18px;
  align-items: start;
}

.badge{
  display:inline-block;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(37,99,235,.14);
  color: #1d4ed8;
  border:1px solid rgba(37,99,235,.20);
  font-weight: 900;
  font-size: 13px;
}

h1{
  margin: 10px 0 10px;
  line-height: 1.05;
  font-size: 44px;
}

.lead{
  font-size: 17px;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

.hero-card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow:hidden;
}

.hero-photo{
  padding: 14px;
  display:flex;
  align-items:center;
  justify-content:center;
  min-height: 320px;
}

.image-placeholder{
  padding: 24px;
  text-align:center;
  color: var(--muted);
  min-height: 320px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:700;
}

/* ===== SECTIONS ===== */
.section{
  padding: 34px 0;
}

.section-header{
  text-align:center;
  margin-bottom: 18px;
}

.section-header h2{
  margin:0;
  font-size: 30px;
}

.section-header p{
  margin: 10px auto 0;
  max-width: 860px;
  color: var(--muted);
  line-height: 1.55;
}

.grid-2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.grid-3{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow2);
  padding: 18px;
}

.card h3{
  margin:0 0 10px;
  font-size: 18px;
}

.card p{
  margin: 8px 0;
  color: var(--muted);
  line-height: 1.5;
}

.price-card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow2);
  padding: 18px;
}

.price-card h3{
  margin:0;
  font-size: 16px;
}

.price{
  font-size: 26px;
  font-weight: 900;
  margin: 8px 0 6px;
}

.muted{ color: var(--muted); }

.notice{
  background: var(--soft);
  border: 1px solid var(--softBorder);
  color: var(--text);
  padding: 14px 16px;
  border-radius: 16px;
  margin-top: 14px;
  line-height: 1.45;
}

.message{
  padding: 12px 14px;
  border-radius: 16px;
  margin: 12px 0;
  border:1px solid var(--border);
  background:#fff;
}
.message-success{ border-color:#86efac; background:#dcfce7; color:#166534; }
.message-error{ border-color:#fca5a5; background:#fee2e2; color:#991b1b; }

/* ===== FORMS ===== */
.form-box{
  background: var(--card);
  border:1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow2);
  padding: 18px;
}

label{
  display:block;
  font-weight: 800;
  margin: 10px 0 6px;
}

input, select, textarea{
  width:100%;
  padding: 12px 12px;
  border-radius: 14px;
  border:1px solid var(--border);
  outline: none;
  font-size: 16px;
  background: #fff;
}

textarea{ min-height: 110px; resize: vertical; }

input:focus, select:focus, textarea:focus{
  border-color: rgba(37,99,235,.55);
  box-shadow: 0 0 0 4px rgba(37,99,235,.12);
}

.form-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ===== LIST / CTA ===== */
.list{
  display:flex;
  flex-direction:column;
  gap: 12px;
}

.list-item{
  background:#fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  border-left: 6px solid rgba(37,99,235,.35);
}

.cta{
  background: linear-gradient(180deg, #0f172a 0%, #0b1220 100%);
  color:#fff;
  border-radius: 20px;
  padding: 18px;
  display:flex;
  justify-content:space-between;
  gap: 16px;
  align-items:center;
  border: 1px solid rgba(255,255,255,.10);
}

.cta p{ margin: 8px 0 0; color: rgba(255,255,255,.85); }

.contact-box{
  display:flex;
  flex-direction:column;
  gap: 12px;
}

.contact-row{
  background:#fff;
  border:1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
}

/* ===== VISITOR COUNTER ===== */
.visitor-counter{
  margin-top: 14px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow2);
  padding: 14px 16px;
  font-weight: 700;
}

.visitor-counter div + div{
  margin-top: 6px;
}

/* ===== ADMIN ===== */
.admin-box{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow2);
  padding: 18px;
}

.admin-top{
  margin-top: 20px;
}

.admin-links{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

/* ===== CHAT WIDGET ===== */
.chat-widget{
  position: fixed !important;
  right: 20px !important;
  bottom: 20px !important;
  z-index: 99999 !important;
  width: 340px !important;
  max-width: calc(100vw - 24px) !important;
  display: block !important;
}

.chat-toggle{
  width: 100% !important;
  display: block !important;
  border: 0;
  border-radius: 16px;
  background: #2563eb;
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  padding: 14px 16px;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(2, 6, 23, .22);
}

.chat-toggle:hover{
  background: #1d4ed8;
}

.chat-panel{
  margin-top: 10px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(2, 6, 23, .18);
}

.chat-head{
  background: #0f172a;
  color: #fff;
  padding: 14px 16px 10px;
  font-weight: 800;
}

.chat-subhead{
  background: #0f172a;
  color: rgba(255,255,255,.86);
  padding: 0 16px 14px;
  font-size: 13px;
  line-height: 1.4;
}

.chat-body{
  height: 320px;
  overflow-y: auto;
  padding: 12px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-msg{
  max-width: 86%;
  padding: 10px 12px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.45;
}

.chat-msg-admin{
  align-self: flex-start;
  background: #fff;
  border: 1px solid #e2e8f0;
  color: #0f172a;
}

.chat-msg-client{
  align-self: flex-end;
  background: #2563eb;
  color: #fff;
}

.chat-msg-time{
  margin-top: 6px;
  font-size: 11px;
  opacity: .75;
}

.chat-form{
  padding: 12px;
  border-top: 1px solid #e2e8f0;
  background: #fff;
}

.chat-form input,
.chat-form textarea{
  width: 100%;
  margin-bottom: 8px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  font-size: 16px;
  background:#fff;
}

.chat-form textarea{
  min-height: 90px;
  resize: vertical;
}

/* ===== ADMIN CHAT ===== */
.admin-chat-layout{
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 16px;
}

.admin-chat-list{
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #f8fafc;
  padding: 10px;
  max-height: 520px;
  overflow-y: auto;
}

.admin-chat-item{
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 14px;
  padding: 12px;
  cursor: pointer;
  margin-bottom: 10px;
}

.admin-chat-item:hover{
  transform: translateY(-1px);
  box-shadow: var(--shadow2);
}

.admin-chat-item.active{
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.admin-chat-name{
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 4px;
}

.admin-chat-preview{
  color: #475569;
  font-size: 13px;
  line-height: 1.35;
}

.chat-badge{
  display: inline-block;
  margin-left: 6px;
  min-width: 20px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.admin-chat-messages{
  min-height: 380px;
  max-height: 420px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #f8fafc;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-chat-form{
  margin-top: 10px;
}

.admin-chat-form textarea{
  min-height: 100px;
}

/* ===== TABLE (admin) ===== */
.table-wrap{ overflow:auto; }
table{
  width:100%;
  border-collapse: collapse;
  min-width: 900px;
}
th, td{
  border-bottom: 1px solid var(--border);
  padding: 10px 12px;
  vertical-align: top;
  text-align:left;
  color: var(--muted);
}
th{ color: var(--text); background:#f8fafc; position: sticky; top:0; z-index:1; }

/* ===== FOOTER ===== */
footer{
  padding: 26px 0;
  border-top: 1px solid var(--border);
  background: #fff;
}

.footer-wrap{
  display:flex;
  justify-content:space-between;
  gap: 12px;
  flex-wrap:wrap;
  color: var(--muted);
}

.small-link{
  color: var(--primary);
  font-weight: 800;
}

/* =========================
   RESPONSIVE / MOBILE FIX
   ========================= */

@media (max-width: 980px){
  .hero-grid{ grid-template-columns: 1fr; }
  h1{ font-size: 38px; }
  .grid-3{ grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px){
  .topbar-wrap{
    flex-direction: column;
    align-items: stretch;
    padding: 10px 0;
    gap: 10px;
  }

  .brand{
    justify-content:center;
    font-size: 20px;
  }

  .topbar .brand img{
    width: 32px !important;
    height: 32px !important;
    border-radius: 10px !important;
  }

  .menu{
    width:100%;
    display:grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .menu a{
    min-width: 0;
    padding: 12px 10px;
    font-size: 16px;
    border-radius: 14px;
  }

  h1{ font-size: 32px; }
  .lead{ font-size: 16px; }

  .grid-2{ grid-template-columns: 1fr; }
  .grid-3{ grid-template-columns: 1fr; }

  .form-grid{ grid-template-columns: 1fr; }

  .hero-photo, .image-placeholder{ min-height: 220px; }

  .chat-widget{
    right: 12px !important;
    bottom: 12px !important;
    width: calc(100vw - 24px) !important;
  }

  .admin-chat-layout{
    grid-template-columns: 1fr;
  }
}

@media (max-width: 380px){
  .menu a{ padding: 10px 8px; font-size: 15px; }
  h1{ font-size: 28px; }
}