/* ============================================================
   1. Globālie stili
============================================================ */

body {
  margin: 0;
  height: 100vh;
  font-family: "Kanit", sans-serif;
  background-image: url("../images/a-mix.lv.png");
  background-repeat: no-repeat;
  background-position: center center;
  background-size: contain;
  color: #fff;
  transition: background-color 1s ease;
}

.hidden {
  display: none !important;
}

/* ============================================================
   2. Kustīgie kvadrāti (squares)
============================================================ */

.square {
  position: absolute;
  width: clamp(50px, 10vw, 120px);
  height: clamp(50px, 10vw, 120px);
  background: rgba(94, 104, 140, 0.5);
  border-radius: 8px;
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-weight: bold;
  cursor: pointer;
  user-select: none;
  transition: transform 0.4s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  will-change: transform;
  transform-origin: center center;
}

.square img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: 6px;
  pointer-events: none;
}

/* Mirgošanas efekts sadursmē */
.square.flash {
  animation: flashEffect 0.25s ease-out;
}

@keyframes flashEffect {
  0%   { box-shadow: 0 0 20px 8px orange; border-color: orange; }
  100% { box-shadow: none; border-color: transparent; }
}

/* Hover stāvoklis — “izgaismojas kvadrāta līnija” */
.square.hovered {
  box-shadow: 0 0 18px rgba(0, 255, 255, 0.8);
  border-color: rgba(0, 255, 255, 0.9);
}

.square.stack-anim {
  transition: transform 0.6s cubic-bezier(.25,.8,.25,1);
}
.square.unstack-anim {
  transition: transform 0.5s cubic-bezier(.25,.8,.25,1);
}

/* ============================================================
   3. Kaudzes režīms (stack mode)
============================================================ */

.stack {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-height: 62%;
  height: 45%;
  pointer-events: none;
}

.square.stack-mode {
  pointer-events: auto;
}

/* ============================================================
   4. Back poga
============================================================ */

.slide-btn {
  position: fixed;
  top: 20px;
  left: 20px;
  padding: clamp(8px, 2vw, 12px) clamp(16px, 4vw, 24px);
  background: #5e688c7c;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.3s ease;
  z-index: 1000;
}

.slide-btn.collapsed {
  transform: translateX(-90%);
}

.slide-btn.collapsed:hover {
  transform: translateX(0);
}

/* ============================================================
   5. Pogas (globālais stils)
============================================================ */

button {
  background: linear-gradient(135deg, #00c6ff, #0072ff);
  color: #fff;
  font-family: "Kanit", sans-serif;
  font-size: clamp(12px, 2vw, 18px);
  font-weight: 600;
  padding: clamp(8px, 2vw, 12px) clamp(16px, 4vw, 24px);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  transition: all 0.3s ease;
}

button:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 6px 16px rgba(0,0,0,0.4);
  background: linear-gradient(135deg, #0072ff, #00c6ff);
}

button:active {
  transform: scale(0.95);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* ============================================================
   6. Apmeklētāju skaitītājs
============================================================ */

.counter-text {
  font-family: "Kanit", sans-serif;
  font-size: clamp(5px, 2vw, 18px);
  text-align: center;
}

/* ============================================================
   7. Statusa indikators
============================================================ */

#status-indicator {
  position: fixed;
  top: 15px;
  right: 15px;
  z-index: 3000;
}

.status-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  animation: pulse 1.5s infinite ease-in-out;
}

.online-dot {
  background-color: #00ff55;
  box-shadow: 0 0 10px #00ff55;
}

.offline-dot {
  background-color: #ff3333;
  box-shadow: 0 0 10px #ff3333;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
  100% { transform: scale(1); opacity: 1; }
}

/* ============================================================
   8. Logo bumbas (multi-ball)
============================================================ */

.logo-ball {
  position: fixed;
  border-radius: 50%;
  background-image: url("../images/a-mix.lv.png");
  background-size: cover;
  background-position: center;
  pointer-events: none;
  z-index: 9999;
}

/* ============================================================
   9. Splosion efekts
============================================================ */

.splosion {
  position: fixed;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: radial-gradient(circle, white, orange, red);
  opacity: 0.9;
  pointer-events: none;
  animation: splosionAnim 0.4s ease-out forwards;
}

@keyframes splosionAnim {
  0%   { transform: scale(0.2); opacity: 1; }
  100% { transform: scale(3); opacity: 0; }
}

/* ============================================================
   10. Enerģijas efekti kvadrātiem
============================================================ */

.energy-node {
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: radial-gradient(circle, cyan 0%, rgba(0,255,255,0.2) 70%);
  animation: nodePulse 0.8s infinite alternate;
  pointer-events: none;
}

@keyframes nodePulse {
  from { transform: scale(0.7); opacity: 0.5; }
  to   { transform: scale(1.3); opacity: 1; }
}

.energy-wave {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid cyan;
  opacity: 0.6;
  animation: waveExpand 0.8s forwards;
  pointer-events: none;
}

@keyframes waveExpand {
  from { transform: scale(0.2); opacity: 0.8; }
  to   { transform: scale(3); opacity: 0; }
}

/* SVG elastīgās saites */
.energy-link {
  stroke: cyan;
  stroke-width: 3;
  fill: none;
  filter: drop-shadow(0 0 6px cyan);
}

.dust {
  position: fixed;
  width: 6px;
  height: 6px;
  background: rgba(200, 200, 200, 0.7);
  border-radius: 50%;
  pointer-events: none;
  animation: dustFade 0.6s ease-out forwards;
}

@keyframes dustFade {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(3); opacity: 0; }
}

/* ============================================================
   11. Valodu pārslēgšanas uznirstošais logs (Language Popup)
============================================================ */
.lang-popup {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
}

.lang-popup-box {
    background: #0e0e0e5d;
    padding: 30px 40px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 0 25px rgba(0,0,0,0.4);
    animation: popupIn 0.3s ease;
}

.lang-btn {
    display: block;
    width: 200px;
    margin: 10px auto;
    padding: 12px;
    font-size: 18px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: #0078ff;
    color: white;
    transition: 0.2s;
}

.lang-btn:hover {
    background: #005fcc;
}

.lang-p {
    font-size: 14px;
    color: #ccc;
    margin-top: 10px;
}

.hidden {
    display: none;
}

@keyframes popupIn {
    from { transform: scale(0.8); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

/* ============================================================
   12. Valodu pārslēgšanas poga (Language Reopen Button)
============================================================ */
.lang-reopen {
    position: fixed;
    bottom: 15px;
    right: 15px;

    /* Izskats */
    background: #0078ff;
    color: white;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-size: 22px;

    /* Centrēšana */
    display: flex;
    justify-content: center;
    align-items: center;

    /* Noņem default pogas uzvedību */
    border: none;
    outline: none;
    padding: 0;
    line-height: 1;
    appearance: none;
    -webkit-appearance: none; */

    /* Animācija */
    cursor: pointer;
    z-index: 9999;
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
    transition: 0.2s;
}

/* .lang-reopen:hover {
    background: #005fcc;
    transform: scale(1.1); */
}

.lang-reopen:focus {
    outline: none;
}
