/*
Theme Name: Mgr. art. Martin Dlugolinský — 6TH SENSE Studio (v3.1.2c Ultra Optimized)
Author: 6TH SENSE Studio
Description: Ultra-optimized portfolio theme based on v3.1.2b. Hero video loads on click (Variant B) with single-click Play/Pause and overlay restored on pause.
Version: v3.1.2c
Text Domain: dlugolinsky-portfolio
*/

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
  background: #000;
  color: #fff;
  line-height: 1.6;
}

:root{
  --black: #000;
  --white: #fff;
  --orange: #ff6a00;
  --gray-900: #0e0e0e;
  --gray-800: #1f1f1f;
  --gray-700: #232323;
  --gray-400: #9ca3af;
}

.container { width: min(1200px, 92%); margin: 0 auto; }
.section { padding: 56px 0; }

/* Header */
.site-header { background: var(--black); border-bottom: 1px solid #111; position: sticky; top: 0; z-index: 50; }
.brand { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.brand__logo { width: 40px; height: 40px; border-radius: 8px; overflow: hidden; background: var(--gray-700); display: grid; place-items: center; }
.brand__logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brand__title { font-weight: 700; font-size: 18px; letter-spacing: .02em; }
.brand__subtitle { color: var(--gray-400); font-size: 13px; }

/* Hero */
.hero { position: relative; }
.hero video { width: 100%; max-height: 72vh; display: block; background: #000; }
.hero__overlay { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0,0,0,.2), rgba(0,0,0,.9)); pointer-events: none; }
.hero__caption { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); width: min(1200px, 92%); display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: 12px; }
.hero__title { font-size: clamp(22px, 4vw, 36px); font-weight: 800; }
.hero__note { font-size: 13px; color: var(--gray-400); }

.hero__overlay {
  display: none !important;
}

/* Play overlay */
.play-overlay { position: absolute; inset: 0; display: grid; place-items: center; }
.play-overlay button {
  background: var(--orange);
  color: #000;
  border: none;
  border-radius: 999px;
  padding: 14px 22px;
  font-weight: 800;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0,0,0,.35);
  transition: transform .15s ease, box-shadow .15s ease;
}
.play-overlay button:hover { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(0,0,0,.45); }
.play-overlay.hidden { display: none; }

/* Grid */
.section--grid { background: var(--gray-900); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.card { background: var(--gray-800); border-radius: 14px; overflow: hidden; transition: transform .2s ease, box-shadow .2s ease; border: 1px solid #111; }
.card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(0,0,0,.35); }
.card video { width: 100%; display: block; }
.card__body { padding: 16px; }
.card__title { font-weight: 700; margin-bottom: 4px; }
.card__desc { color: var(--gray-400); font-size: 14px; }

/* CTA */
.section--cta { background: var(--gray-800); border-top: 1px solid #111; border-bottom: 1px solid #111; }
.cta { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: center; gap: 18px; }
.cta__text { font-weight: 800; font-size: clamp(18px, 3vw, 24px); }
.cta__btn { background: var(--orange); color: var(--black); padding: 12px 18px; border-radius: 12px; font-weight: 800; text-decoration: none; border: 2px solid transparent; transition: transform .15s ease, box-shadow .15s ease; }
.cta__btn:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(0,0,0,.35); }
/* === CTA Modern Glow Button === */
.cta-btn-glow {
  display: inline-block;
  padding: 14px 36px;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  letter-spacing: 0.5px;
  color: #fff;
  background: linear-gradient(135deg, #ff7a00, #ff3c00);
  border: none;
  border-radius: 50px;
  text-transform: uppercase;
  text-decoration: none;
  box-shadow: 0 0 15px rgba(255, 100, 0, 0.4);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.cta-btn-glow::before {
  content: "";
  position: absolute;
  top: 0;
  left: -75%;
  width: 50%;
  height: 100%;
  background: linear-gradient(120deg, rgba(255,255,255,0.3), transparent);
  transform: skewX(-25deg);
  transition: left 0.4s ease;
}

.cta-btn-glow:hover::before {
  left: 125%;
}

.cta-btn-glow:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 0 20px rgba(255, 120, 0, 0.6);
}

/* Modal */
#contact-modal { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.78); z-index: 999; visibility: hidden; opacity: 0; transition: opacity .28s ease, visibility .28s ease; }
#contact-modal.active { visibility: visible; opacity: 1; }
.modal-box { background: var(--gray-800); border: 1px solid #111; padding: 28px; border-radius: 16px; width: min(360px, 92%); text-align: center; transform: translateY(6px) scale(.98); opacity: 0; transition: transform .28s ease, opacity .28s ease; }
#contact-modal.active .modal-box { transform: translateY(0) scale(1); opacity: 1; }
.modal-box h2 { font-size: 20px; margin-bottom: 12px; }
.modal-box p { margin: 8px 0; color: var(--gray-400); }
.modal-actions { margin-top: 12px; }
.modal-close { margin-top: 10px; background: var(--orange); color: var(--black); border: none; padding: 8px 16px; border-radius: 10px; font-weight: 800; cursor: pointer; }

.copyable { cursor: pointer; font-weight: 700; color: var(--white); }
.copyable:hover { color: var(--orange); }

/* Toast */
#copy-toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(8px); background: var(--orange); color: #000; font-weight: 800; padding: 10px 14px; border-radius: 12px; opacity: 0; visibility: hidden; transition: opacity .25s ease, transform .25s ease, visibility .25s ease; z-index: 1000; }
#copy-toast.show { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }

/* Footer */
.site-footer { padding: 28px 0 48px; color: var(--gray-400); text-align: center; border-top: 1px solid #111; }
.site-footer a { color: var(--orange); text-decoration: none; }

/* --- KARTY PROJEKTOV (vylepšený popis) --- */

.card {
  background: #111; /* tmavosivý podklad */
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 25px rgba(255,106,0,0.3); /* oranžový efekt pri hover */
}

/* Video časť */
.card__media video {
  display: block;
  width: 100%;
  border-bottom: 2px solid #ff6a00;
}

/* Nadpis */
.card__title {
  color: #ff6a00;
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 0.5em;
  text-transform: uppercase;
}

/* Popis textu */
.card__desc {
  color: #e0e0e0;
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 0.8em;
  text-align: justify;
  padding: 0 0.3em;
}

/* Ak je v popise viac odstavcov alebo odkazov */
.card__desc p {
  margin: 0.5em 0;
}

.card__desc a {
  color: #ff6a00;
  text-decoration: none;
  border-bottom: 1px solid #ff6a00;
  transition: color 0.3s ease, border-color 0.3s ease;
}

.card__desc a:hover {
  color: #fff;
  border-color: #fff;
}

.card__desc .highlight {
  color: #ffffff;
  font-weight: 600;
  text-transform: uppercase;
  display: block;
  margin-bottom: 0.4em;
  letter-spacing: 0.5px;
}

.card__desc .subtext {
  color: #ccc;
  font-size: 0.95rem;
  line-height: 1.5;
}

.custom-png-logo {
  max-height: 48px;
  width: auto;
  height: auto;
  object-fit: contain;
  vertical-align: middle;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.custom-png-logo:hover {
  transform: scale(1.05);
  opacity: 0.9;
}

/* === Vlastné PNG logo – oprava veľkosti === */
.brand__logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  max-height: 80px; /* uprav podľa výšky hlavičky */
}

.brand__logo img.custom-png-logo {
  max-height: 60px; /* predvolená výška loga */
  max-width: 100%;
  width: auto;
  height: auto;
  display: block;
  object-fit: contain;
  border: none;
  background: none;
  box-shadow: none;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.brand__logo img.custom-png-logo:hover {
  transform: scale(1.05);
  opacity: 0.9;
}

/* --- ŠIRŠIA SEKCIA PRE VIDEÁ A POPISY --- */

/* Zvýšenie šírky hlavného kontajnera */
.section--grid .container {
  max-width: 1600px; /* pôvodne býva 1200px */
  margin: 0 auto;
  padding: 0 2rem;
}

/* Usporiadanie mriežky – väčšie karty */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(450px, 1fr)); /* zväčšené karty */
  gap: 2.5rem;
  align-items: start;
}

/* Videá – viac priestoru, lepšia prezentácia */
.card__media video {
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 2px solid #ff6a00;
}

/* Popis – viac miesta na text */
.card__body {
  padding: 1.5rem;
}

/* Väčší text pre názvy projektov */
.card__title {
  font-size: 1.5rem;
  margin-bottom: 0.6rem;
}

/* Popis projektu – mierne širšie riadkovanie pre lepšiu čitateľnosť */
.card__desc {
  line-height: 1.8;
  font-size: 1.05rem;
}

/* --- Video controls --- */
.video-wrapper {
  position: relative;
  display: inline-block;
}

.video-controls {
  position: absolute;
  bottom: 10px;
  right: 10px;
  display: flex;
  gap: 10px;
  z-index: 10;
}

.video-controls button {
  background: rgba(0, 0, 0, 0.6);
  border: none;
  color: #ff6a00;
  font-size: 1.2rem;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s;
}

.video-controls button:hover {
  background: rgba(0, 0, 0, 0.9);
  color: #fff;
}

/* --- Video controls (rozšírené o fullscreen) --- */
.video-wrapper {
  position: relative;
  display: inline-block;
}

.video-controls {
  position: absolute;
  bottom: 10px;
  right: 10px;
  display: flex;
  gap: 10px;
  z-index: 10;
}

.video-controls button {
  background: rgba(0, 0, 0, 0.6);
  border: none;
  color: #ff6a00;
  font-size: 1.2rem;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s, color 0.3s;
}

.video-controls button:hover {
  background: rgba(0, 0, 0, 0.9);
  color: #fff;
}

/* === Video Progress Bars === */
.progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 4px;
  width: 100%;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
  border-radius: 2px;
}

.progress-played,
.progress-loaded {
  position: absolute;
  top: 0;
  left: 0;
  height: 4px;
  width: 0%;
  transition: width 0.2s linear;
  border-radius: 2px;
}

.progress-played {
  background-color: #ff6a00; /* oranžová – prehrané */
  z-index: 2;
}

.progress-loaded {
  background-color: rgba(255, 255, 255, 0.3); /* sivobiela – načítané */
  z-index: 1;
}

/* Pri prehrávaní mierne oranžový okraj */
.video-wrapper.playing {
  box-shadow: 0 0 0 3px rgba(255, 106, 0, 0.4);
  transition: box-shadow 0.3s ease;
}

/* === VYLEPŠENÝ PROGRESS BAR === */
.progress-bar {
  position: absolute;
  bottom: 8px;
  left: 8px;
  right: 8px;
  height: 6px; /* bolo 4px */
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.15);
  overflow: hidden;
}

.progress-played,
.progress-loaded {
  position: absolute;
  top: 0;
  left: 0;
  height: 6px;
  width: 0%;
  transition: width 0.2s linear;
  border-radius: 3px;
}

.progress-played {
  background-color: #ff6a00; /* oranžová – prehrané */
  z-index: 2;
}

.progress-loaded {
  background-color: rgba(255, 255, 255, 0.4); /* svetlejšia sivá – načítané */
  z-index: 1;
}

/* Zvýraznenie počas prehrávania */
.video-wrapper.playing {
  box-shadow: 0 0 0 3px rgba(255, 106, 0, 0.4);
  transition: box-shadow 0.3s ease;
}

/* === TEXT NAČÍTANIA (horný text) === */
.loading-info {
  position: absolute;
  top: 8px;
  right: 12px;
  background: rgba(0, 0, 0, 0.6);
  color: #ffb56b;
  font-size: 13px;
  padding: 4px 8px;
  border-radius: 4px;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.3px;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 5;
}

.loading-info.visible {
  display: block;
  opacity: 1;
}

/* === VIDEO WRAPPER === */
.video-wrapper {
  position: relative;
  display: inline-block;
  overflow: hidden;
}

/* 🔄 Netflix-style loader (centrálny kruh) */
.video-loader {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.55);
  z-index: 10;
  opacity: 1;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  visibility: visible;
}

.video-loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* 🌀 Kruhový spinner */
.spinner {
  width: 72px;
  height: 72px;
  border: 5px solid rgba(255, 255, 255, 0.25);
  border-top-color: #ff6a00;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* 🔢 Percentá v strede kruhu */
.loader-percent {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  text-shadow: 0 0 6px rgba(0,0,0,0.6);
  pointer-events: none;
  animation: fadeIn 0.4s ease;
}

/* ✨ Animácie */
@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.cta-btn-neon {
  position: relative;
  display: inline-block;
  padding: 14px 40px;
  border-radius: 50px;
  color: #fff;
  background: #111;
  border: 1px solid #ff6a00;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-decoration: none;
  overflow: hidden;
  transition: all 0.3s ease;
}

.cta-btn-neon::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(from 0deg, transparent, #ff6a00, #ff3c00, transparent 70%);
  animation: rotateGlow 3s linear infinite;
  opacity: 0.3;
}

.cta-btn-neon:hover {
  box-shadow: 0 0 25px rgba(255, 106, 0, 0.8);
  background: #ff6a00;
  color: #fff;
}

@keyframes rotateGlow {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}