/* ==========================================================================
   Pneuservis ROKO s.r.o. — vlastné štýly (dopĺňajú Tailwind CDN)
   Farby: #111111 / #1A1A1A / #222222 (tmavé), #C5161D (červená), #FFF / #E5E5E5
   ========================================================================== */

:root {
  --roko-red: #C5161D;
  --roko-red-light: #E32229;
  --roko-black: #111111;
  --roko-dark: #1A1A1A;
  --roko-card: #222222;
  --roko-text: #E5E5E5;
  --star-gold: #FFC53D;
}

html { scroll-behavior: smooth; }
body {
  background-color: var(--roko-black);
  color: var(--roko-text);
  font-family: 'Inter', system-ui, sans-serif;
  overflow-x: hidden;
}

/* Typografia nadpisov — automotive štýl */
.font-display { font-family: 'Anton', 'Arial Black', sans-serif; letter-spacing: .02em; }
.font-head { font-family: 'Rajdhani', 'Arial', sans-serif; }

::selection { background: var(--roko-red); color: #fff; }

/* ==========================================================================
   Tlačidlá (min. 44px dotyková plocha)
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 48px; padding: .8rem 1.75rem;
  font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 1.05rem;
  text-transform: uppercase; letter-spacing: .08em;
  border-radius: .375rem; transition: all .25s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn-red {
  background: var(--roko-red); color: #fff;
  box-shadow: 0 4px 24px rgba(197, 22, 29, .35);
}
.btn-red:hover { background: var(--roko-red-light); transform: translateY(-2px); box-shadow: 0 8px 32px rgba(197, 22, 29, .5); }
.btn-outline {
  border: 2px solid rgba(255, 255, 255, .25); color: #fff; background: rgba(255, 255, 255, .03);
}
.btn-outline:hover { border-color: var(--roko-red); color: #fff; background: rgba(197, 22, 29, .12); }

/* ==========================================================================
   Header + navigácia
   ========================================================================== */
#site-header { transition: background-color .3s ease, box-shadow .3s ease; }
#site-header.scrolled { background-color: rgba(17, 17, 17, .95); box-shadow: 0 4px 30px rgba(0, 0, 0, .55); }

.nav-link { position: relative; color: var(--roko-text); padding: .5rem 0; transition: color .2s; }
.nav-link::after {
  content: ''; position: absolute; left: 0; bottom: 0; height: 2px; width: 0;
  background: var(--roko-red); transition: width .25s ease;
}
.nav-link:hover { color: #fff; }
.nav-link:hover::after, .nav-link.is-active::after { width: 100%; }
.nav-link.is-active { color: #fff; }

/* Hamburger */
.hamburger {
  display: flex; flex-direction: column; justify-content: center; gap: 6px;
  width: 48px; height: 48px; padding: 12px; border-radius: .375rem; z-index: 60; position: relative;
}
.hamburger span { display: block; height: 2px; width: 100%; background: #fff; transition: all .3s ease; border-radius: 2px; }
.hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); background: var(--roko-red-light); }
.hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); background: var(--roko-red-light); }

/* Mobilné menu — fullscreen overlay */
#mobile-menu {
  position: fixed; inset: 0; z-index: 50;
  background: linear-gradient(160deg, #111 0%, #1A1A1A 60%, #17090a 100%);
  display: flex; flex-direction: column; justify-content: center; align-items: center; gap: .25rem;
  opacity: 0; visibility: hidden; transform: translateY(-4%);
  transition: opacity .3s ease, transform .3s ease, visibility .3s;
}
#mobile-menu.open { opacity: 1; visibility: visible; transform: translateY(0); }
#mobile-menu .m-link {
  font-family: 'Rajdhani', sans-serif; font-weight: 700; text-transform: uppercase;
  font-size: clamp(1.6rem, 6vw, 2.2rem); letter-spacing: .06em;
  color: var(--roko-text); padding: .55rem 1.5rem; transition: color .2s;
}
#mobile-menu .m-link:hover, #mobile-menu .m-link.is-active { color: var(--roko-red-light); }
body.menu-open { overflow: hidden; }

/* Plávajúce tlačidlo Zavolať (mobil) */
.call-fab {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 40;
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--roko-red); color: #fff;
  min-height: 52px; padding: .75rem 1.4rem; border-radius: 999px;
  font-family: 'Rajdhani', sans-serif; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  box-shadow: 0 6px 24px rgba(197, 22, 29, .55);
  animation: fabPulse 2.6s ease-in-out infinite;
}
@keyframes fabPulse {
  0%, 100% { box-shadow: 0 6px 24px rgba(197, 22, 29, .55); }
  50% { box-shadow: 0 6px 34px rgba(197, 22, 29, .9); }
}

/* ==========================================================================
   Dekoratívne pozadia — dezén pneumatiky, disky, červené pruhy
   ========================================================================== */

/* Vzor dezénu (šípky/chevrony) — jemný podklad sekcií */
.bg-tread {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56'%3E%3Cpath d='M0 42 L28 14 L56 42' stroke='%23ffffff' stroke-width='7' fill='none' stroke-linecap='square' opacity='0.032'/%3E%3C/svg%3E");
  background-size: 56px 56px;
}
/* Vzor dezénu s červeným nádychom — pre zvýraznené sekcie */
.bg-tread-red {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56'%3E%3Cpath d='M0 42 L28 14 L56 42' stroke='%23C5161D' stroke-width='7' fill='none' stroke-linecap='square' opacity='0.05'/%3E%3C/svg%3E");
  background-size: 56px 56px;
}

/* Šikmé červené pruhy (ako v logu) — dekoračný prvok */
.stripes-deco { position: absolute; pointer-events: none; }
.stripes-deco i {
  display: block; position: absolute; top: 0; bottom: 0; width: 14px;
  background: var(--roko-red); transform: skewX(-20deg); opacity: .85;
}
.stripes-deco i:nth-child(2) { left: 26px; opacity: .55; }
.stripes-deco i:nth-child(3) { left: 52px; opacity: .3; }

/* Veľká silueta pneumatiky / disku na pozadí */
.deco-tire { position: absolute; pointer-events: none; user-select: none; }

/* Červená deliaca linka pod nadpismi sekcií */
.section-line { width: 64px; height: 4px; background: var(--roko-red); transform: skewX(-20deg); }

/* ==========================================================================
   Hero — animácia vyskladania loga (SVG draw)
   ========================================================================== */
.logo-anim .draw {
  stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: logoDraw 1s ease-out forwards;
}
.logo-anim .d2 { animation-delay: .15s; }
.logo-anim .d3 { animation-delay: .3s; }
.logo-anim .d4 { animation-delay: .45s; }
@keyframes logoDraw { to { stroke-dashoffset: 0; } }

/* Dezén (prerušovaný kruh) — nábeh s rotáciou */
.logo-anim .tread-ring {
  opacity: 0; transform-origin: 160px 180px;
  animation: treadIn .8s .55s ease-out forwards;
}
@keyframes treadIn {
  from { opacity: 0; transform: rotate(-30deg); }
  to { opacity: 1; transform: rotate(0deg); }
}

/* Červený disk — „nasadí sa" s pružným dotočením */
.logo-anim .disk {
  opacity: 0; transform-origin: 160px 180px;
  animation: diskIn .75s .7s cubic-bezier(.25, .9, .3, 1.25) forwards;
}
@keyframes diskIn {
  from { opacity: 0; transform: scale(.55) rotate(-50deg); }
  to { opacity: 1; transform: scale(1) rotate(0deg); }
}

/* Texty loga — postupný nájazd */
.logo-anim .ft { opacity: 0; transform: translateX(26px); animation: ftIn .55s ease-out forwards; }
.logo-anim .f1 { animation-delay: .95s; }
.logo-anim .f2 { animation-delay: 1.1s; }
.logo-anim .f3 { animation-delay: 1.25s; }
@keyframes ftIn { to { opacity: 1; transform: translateX(0); } }

/* Tri pruhy — wipe */
.logo-anim .st { opacity: 0; transform: translateX(-14px) ; animation: stIn .35s ease-out forwards; }
.logo-anim .s1 { animation-delay: 1.4s; }
.logo-anim .s2 { animation-delay: 1.5s; }
.logo-anim .s3 { animation-delay: 1.6s; }
@keyframes stIn { to { opacity: 1; transform: translateX(0); } }

/* Swoosh */
.logo-anim .swoosh { opacity: 0; animation: swooshIn .6s 1.55s ease-out forwards; }
@keyframes swooshIn { from { opacity: 0; transform: translateX(-30px); } to { opacity: 1; transform: translateX(0); } }

/* Obsah hero pod logom */
.hero-fade { opacity: 0; transform: translateY(18px); animation: heroFade .7s ease-out forwards; }
.hf-1 { animation-delay: 1.7s; }
.hf-2 { animation-delay: 1.85s; }
.hf-3 { animation-delay: 2s; }
@keyframes heroFade { to { opacity: 1; transform: translateY(0); } }

/* ==========================================================================
   Scroll-reveal + počítadlá
   ========================================================================== */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }
.reveal-d1 { transition-delay: .1s; }
.reveal-d2 { transition-delay: .2s; }
.reveal-d3 { transition-delay: .3s; }

/* ==========================================================================
   Karty služieb / recenzií
   ========================================================================== */
.card {
  background: var(--roko-card);
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: .75rem; overflow: hidden;
  transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease;
}
.card:hover {
  transform: translateY(-6px);
  border-color: rgba(197, 22, 29, .55);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .5), 0 0 0 1px rgba(197, 22, 29, .25);
}
.card .card-img { transition: transform .5s ease; }
.card:hover .card-img { transform: scale(1.05); }

.stars { color: var(--star-gold); letter-spacing: .1em; }

/* ==========================================================================
   Tabuľka otváracích hodín + indikátor otvorené/zatvorené
   ========================================================================== */
.hours-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 1.25rem; }
.hours-row + .hours-row { border-top: 1px solid rgba(255, 255, 255, .08); }
.hours-row.today { background: rgba(197, 22, 29, .1); border-left: 3px solid var(--roko-red); }

.status-badge {
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: 'Rajdhani', sans-serif; font-weight: 700; letter-spacing: .04em;
  padding: .45rem 1rem; border-radius: 999px; font-size: .95rem;
  border: 1px solid rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .04);
}
.status-badge .dot { width: 10px; height: 10px; border-radius: 50%; background: #777; flex: none; }
.status-badge.is-open .dot { background: #2fbf5f; box-shadow: 0 0 10px rgba(47, 191, 95, .9); animation: dotPulse 1.8s infinite; }
.status-badge.is-open { color: #7fe0a0; border-color: rgba(47, 191, 95, .35); }
.status-badge.is-closed .dot { background: var(--roko-red-light); box-shadow: 0 0 10px rgba(227, 34, 41, .8); }
.status-badge.is-closed { color: #ff8f93; border-color: rgba(197, 22, 29, .4); }
@keyframes dotPulse { 50% { opacity: .55; } }

/* ==========================================================================
   Formulár
   ========================================================================== */
.form-field {
  width: 100%; background: #1c1c1c; color: #fff;
  border: 1px solid rgba(255, 255, 255, .14); border-radius: .5rem;
  padding: .85rem 1rem; font-size: 1rem; min-height: 48px;
  transition: border-color .2s, box-shadow .2s;
}
.form-field:focus { outline: none; border-color: var(--roko-red); box-shadow: 0 0 0 3px rgba(197, 22, 29, .25); }
.form-field.invalid { border-color: var(--roko-red-light); box-shadow: 0 0 0 3px rgba(227, 34, 41, .18); }
.form-field::placeholder { color: #8a8a8a; }
select.form-field { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%23C5161D' stroke-width='2' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 1rem center; padding-right: 2.6rem; }
.field-error { color: #ff8f93; font-size: .85rem; margin-top: .3rem; display: none; }
.form-field.invalid ~ .field-error { display: block; }

/* ==========================================================================
   Google mapa — tmavý vzhľad cez CSS filter
   ========================================================================== */
.map-dark iframe { filter: invert(90%) hue-rotate(180deg) contrast(88%) grayscale(18%); }

/* Calendly kontajner */
.calendly-shell { background: var(--roko-dark); border: 1px solid rgba(255, 255, 255, .08); border-radius: .75rem; overflow: hidden; }

/* ==========================================================================
   Ostatné
   ========================================================================== */
.text-outline {
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, .14);
}

/* Parallax vrstvy — posúva JS cez transform */
[data-parallax] { will-change: transform; }

/* ==========================================================================
   AI asistent — plávajúce koleso vpravo dole + chat panel
   ========================================================================== */
.ai-fab {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 45;
  width: 64px; height: 64px; border-radius: 50%;
  background: #1c1c1c; border: 2px solid rgba(197, 22, 29, .6);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .6), 0 0 18px rgba(197, 22, 29, .25);
  cursor: pointer; transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  -webkit-tap-highlight-color: transparent;
}
.ai-fab:hover { transform: translateY(-3px); border-color: var(--roko-red-light); box-shadow: 0 10px 30px rgba(0, 0, 0, .7), 0 0 26px rgba(197, 22, 29, .5); }
.ai-fab svg { width: 44px; height: 44px; animation: aiWheelSpin 14s linear infinite; }
.ai-fab:hover svg { animation-duration: 2.5s; }
@keyframes aiWheelSpin { to { transform: rotate(360deg); } }
/* Bublina s výzvou */
.ai-fab::after {
  content: 'Poradím?';
  position: absolute; right: 74px; top: 50%; transform: translateY(-50%);
  background: var(--roko-red); color: #fff;
  font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: .85rem;
  text-transform: uppercase; letter-spacing: .05em;
  padding: .35rem .7rem; border-radius: .4rem; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity .25s ease;
}
.ai-fab:hover::after { opacity: 1; }
.ai-fab[aria-expanded="true"]::after { display: none; }

/* Na mobile/tablete sedí nad tlačidlom Zavolať */
@media (max-width: 1023px) {
  .ai-fab { bottom: 5.4rem; }
}

/* Chat panel */
.ai-panel {
  position: fixed; right: 1rem; bottom: 5.6rem; z-index: 46;
  width: min(380px, calc(100vw - 2rem));
  max-height: min(560px, calc(100dvh - 7rem));
  display: flex; flex-direction: column;
  background: var(--roko-dark); border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 1rem; overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .7);
  opacity: 0; visibility: hidden; transform: translateY(14px) scale(.98);
  transition: opacity .25s ease, transform .25s ease, visibility .25s;
}
.ai-panel.open { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
@media (max-width: 1023px) {
  .ai-panel { bottom: 10rem; }
}

.ai-head {
  display: flex; align-items: center; gap: .75rem;
  padding: .9rem 1rem; background: #161616; border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.ai-head .ai-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  background: rgba(197, 22, 29, .15); border: 1px solid rgba(197, 22, 29, .5);
  display: flex; align-items: center; justify-content: center;
}
.ai-head .ai-avatar svg { width: 26px; height: 26px; }
.ai-title { font-family: 'Rajdhani', sans-serif; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #fff; line-height: 1.1; }
.ai-sub { font-size: .72rem; color: #7fe0a0; display: flex; align-items: center; gap: .35rem; }
.ai-sub::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #2fbf5f; box-shadow: 0 0 8px rgba(47, 191, 95, .9); }
.ai-close {
  margin-left: auto; width: 40px; height: 40px; border-radius: .5rem;
  display: flex; align-items: center; justify-content: center;
  color: #aaa; transition: color .2s, background .2s; font-size: 1.3rem; line-height: 1;
}
.ai-close:hover { color: #fff; background: rgba(255, 255, 255, .06); }

.ai-messages {
  flex: 1; overflow-y: auto; padding: 1rem;
  display: flex; flex-direction: column; gap: .6rem;
  min-height: 220px; scrollbar-width: thin; scrollbar-color: #3a3a3a transparent;
}
.ai-msg {
  max-width: 85%; padding: .6rem .85rem; border-radius: .8rem;
  font-size: .92rem; line-height: 1.45; word-wrap: break-word;
  animation: aiMsgIn .25s ease-out;
}
@keyframes aiMsgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.ai-msg.bot { align-self: flex-start; background: var(--roko-card); border: 1px solid rgba(255, 255, 255, .07); color: var(--roko-text); border-bottom-left-radius: .25rem; }
.ai-msg.user { align-self: flex-end; background: var(--roko-red); color: #fff; border-bottom-right-radius: .25rem; }
.ai-msg a { color: var(--roko-red-light); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.ai-msg.user a { color: #fff; }
.ai-msg .t-dots { display: inline-flex; gap: 4px; padding: .2rem 0; }
.ai-msg .t-dots i { width: 6px; height: 6px; border-radius: 50%; background: #888; animation: aiDot 1s infinite; }
.ai-msg .t-dots i:nth-child(2) { animation-delay: .15s; }
.ai-msg .t-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes aiDot { 50% { opacity: .3; transform: translateY(-3px); } }

.ai-chips { display: flex; flex-wrap: wrap; gap: .45rem; padding: 0 1rem .75rem; }
.ai-chip {
  font-family: 'Rajdhani', sans-serif; font-weight: 600; font-size: .8rem;
  text-transform: uppercase; letter-spacing: .04em;
  padding: .45rem .75rem; border-radius: 999px; cursor: pointer;
  color: var(--roko-text); border: 1px solid rgba(197, 22, 29, .5); background: rgba(197, 22, 29, .08);
  transition: background .2s, color .2s;
}
.ai-chip:hover { background: var(--roko-red); color: #fff; }

.ai-inputrow {
  display: flex; gap: .5rem; padding: .75rem; border-top: 1px solid rgba(255, 255, 255, .08); background: #161616;
}
.ai-inputrow input {
  flex: 1; min-width: 0; background: #1c1c1c; color: #fff;
  border: 1px solid rgba(255, 255, 255, .14); border-radius: .55rem;
  padding: .6rem .8rem; font-size: 16px; min-height: 44px;
}
.ai-inputrow input:focus { outline: none; border-color: var(--roko-red); }
.ai-send {
  width: 46px; min-height: 44px; border-radius: .55rem; flex: none;
  background: var(--roko-red); color: #fff; display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.ai-send:hover { background: var(--roko-red-light); }

/* Redukcia pohybu — vypnúť animácie */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .logo-anim .draw, .logo-anim .tread-ring, .logo-anim .disk,
  .logo-anim .ft, .logo-anim .st, .logo-anim .swoosh, .hero-fade {
    animation: none !important; opacity: 1 !important; transform: none !important;
    stroke-dashoffset: 0 !important;
  }
  .reveal { opacity: 1; transform: none; transition: none; }
  .call-fab { animation: none; }
  .ai-fab svg { animation: none; }
  .ai-msg { animation: none; }
  [data-parallax] { transform: none !important; }
}

/* Mobil — zjednodušené dekorácie kvôli výkonu a čitateľnosti */
@media (max-width: 767px) {
  .deco-tire { opacity: .5; transform: scale(.7); }
  .stripes-deco { display: none; }
}
