@import url("https://fonts.googleapis.com/css2?family=Roboto+Mono:300,400,500,600&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900&display=swap");

:root {
  --bg-color: #f6f9f9;
  --text-color: #0d1200;
  --primary-color: #1e40af;
  --accent-color: #065f46;
  --modal-bg: #cce3fc;
  --border-color: #ccc;
  --white: #fff;
  --accent-dark: #065f46;
}

[data-theme="dark"] {
  --bg-color: #202020;
  --text-color: #f9fafb;
  --primary-color: #374151;
  --accent-color: #A6831D;
  --modal-bg: #222a37;
  --border-color: #4b5563;
  --white: #f9fafb;
  --accent-dark: #065f46;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
}

.c { width: 100%; display:flex; justify-content:center; align-items:center; padding: 2rem 0; }

/* GRID WRAPPER centers everything and keeps consistent sizing */
.grid-wrapper {
  position: relative;
  width: 500px;   /* base width for 5x5 of 100px */
  height: 500px;  /* 5 rows of 100px */
  display: block;
}

/* Velebit image behind the middle 3 rows - make it wider to match grid */
.veleb {
  position: absolute;
  left: 0;
  top: 100px;          /* starts at row 2 (1 row = 100px) */
  width: 100%;
  height: 300px;       /* 3 rows */
  z-index: 0;
  overflow: hidden;
}

.veleb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}


/* Title centered horizontally and vertically across the middle area */
.title {
  font-family: 'Lato', sans-serif;
  position: absolute;
    left: 25px;  /* center of the 500px wrapper (columns 2-4 middle) */
  top: 192px; /* center of the 500px wrapper (rows 2-4 middle) */
  /* transform: translate(-50%, -50%); */
  margin: 0;
  z-index: 5;
  font-size: 6.7rem;
  font-weight: 300 !important;
  font-kerning: auto;
  color: var(--white);
  pointer-events: none;
  white-space: nowrap;
}
h1 {
  -webkit-text-fill-color: transparent; /* Will override color (regardless of order) */
  -webkit-text-stroke: 1px var(--white); /* White outline */
}


/* Make the grid exactly match the image width */
.grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(5, 100px);
  grid-template-rows: repeat(5, 100px);
  gap: 0; /* Remove gap to make boxes fit exactly */
  width: 500px;
  height: 500px;
}

/* define named areas for readability (not strictly required by inline area assignments) */
.grid {
  grid-template-areas:
    "top1 top2 top3 top4 top5"
    "mid1 mid2 mid3 mid4 mid5"
    "mid6 mid7 mid8 mid9 mid10"
    "mid11 mid12 mid13 mid14 mid15"
    "bottom1 bottom2 bottom3 bottom4 bottom5";
}

/* Box base style */
.box {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-color);
  color: var(--text-color);
  border-radius: 2px;
  outline: 1px solid var(--text-color);
  outline-offset: -2px; /* This makes the outline sit inside */
  font-size: 1.05rem;
  transition: transform 0.2s ease, opacity 0.3s ease, background-color 0.2s ease;
  user-select: none;
  text-align: center;
  padding: 0.2rem;
  line-height: 1.1;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.box span {
  display: block;
  max-width: 100%;
  line-height: 1.1;
  font-size: 0.9rem;
}

/* Fix for long text boxes */
.box[style*="top1"] span,
.box[style*="top2"] span,
.box[style*="top3"] span {
  /* font-size: 0.75rem; */
  line-height: 1;
}

/* Green actionable boxes */
.box.green {
  font-weight: 600;
  cursor: pointer;
}

/* Transparent middle tiles */
.box.trans {
  background-color: transparent;
  box-shadow: none;
  cursor: default;
  border: 4px solid transparent;
}

.box.trans span {
  opacity: 1;
  color: var(--white);
}
/* Modal styles - COVER ONLY THE GRID */
/* Modal styles - POSITION RELATIVE TO CONTAINER */
.container {
  position: relative; /* This makes the modal position relative to container */
  /* ... other container styles ... */
}

.modal {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 500px;  /* Same as grid width */
  height: 500px; /* Same as grid height */
  background: var(--modal-bg);
  z-index: 100;
  border: 1px solid var(--accent-dark);
}
.modal.active { display: block; }

.modal-content {
  background: var(--modal-bg);
  padding: 2rem;
  width: 100%;
  height: 100%;
  position: relative;
  overflow-y: auto;
}

.close-modal {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 1.5rem;
  cursor: pointer;
  background: none;
  border: none;
  color: var(--accent-color);
  z-index: 101;
}

/* Overlay styles - cover the same area */

/* Overlay covers everything */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(255, 255, 255, 0.5);
  z-index: 99; /* Lower than grid */
  cursor: pointer;
}
.modal-overlay.active { display: block; }

/* PJAT CONTENT STYLES */
.pjat {
  color: var(--text-color);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.pjat h2 {
  margin-bottom: 1rem;
  font-size: 1.5rem;
  color: var(--accent-color);
}

.pjat p,
.pjat li {
  margin-bottom: 0.8rem;
  line-height: 1.5;
  font-size: 1rem;
}

.pjat ul {
  padding-left: 1.5rem;
}

.pjat a {
  color: var(--accent-color);
  text-decoration: none;
}

.pjat a:hover {
  text-decoration: underline;
}

.dlogici {
  margin-top: auto;
  text-align: center;
  padding-top: 1rem;
  color: var(--accent-color);
}


/* Footer Styles */
.fut {
  background-color: var(--primary-color);
  color: var(--white);
  padding: 2rem 1rem;
  margin-top: 2rem;
  width: 100%;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h3 {
  color: var(--accent-color);
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.footer-section p {
  line-height: 1.6;
  margin-bottom: 0.5rem;
}

.footer-section a {
  color: var(--text-color);
  text-decoration: none;
}

.footer-section a:hover {
  text-decoration: underline;
}

/* Cookie Consent Banner - WORKING VERSION */
.cookie-consent {
  position: fixed;
  bottom: -300px; /* Start completely off-screen */
  left: 0;
  right: 0;
  background: var(--modal-bg);
  color: var(--text-color);
  padding: 1.5rem;
  box-shadow: 0 -5px 25px rgba(0,0,0,0.3);
  z-index: 10000;
  transition: bottom 0.4s ease;
  border-top: 3px solid var(--accent-color);
}

.cookie-consent.active {
  bottom: 0; /* Slide up to bottom */
}

.cookie-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
}

.cookie-content p {
  margin: 0;
  flex: 1;
  font-size: 1rem;
  line-height: 1.5;
}

.cookie-content a {
  color: var(--accent-color);
  text-decoration: underline;
  font-weight: bold;
}

.cookie-buttons {
  display: flex;
  gap: 1rem;
}

.cookie-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  font-size: 1rem;
  transition: all 0.3s ease;
  min-width: 120px;
}

.cookie-btn.accept {
  background-color: var(--accent-color);
  color: white;
}

.cookie-btn.reject {
  background-color: #666;
  color: white;
}

.cookie-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Copyright */
.copyleft {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  max-width: 1200px;
  margin: 0 auto;
}

.copyleft p {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.8;
}

/* Make sure it works on ALL screen sizes */
@media (max-width: 768px) {
  .cookie-content {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }
  
  .cookie-buttons {
    width: 100%;
    justify-content: center;
  }
  
  .cookie-btn {
    min-width: 140px;
  }
}

/* Tablet adjustments */
@media (max-width: 768px) {
  .grid-wrapper { 
    width: 450px; 
    height: 450px; 
  }
  .grid { 
    grid-template-columns: repeat(5, 90px); 
    grid-template-rows: repeat(5, 90px); 
    width: 450px;
    height: 450px;
  }
  .veleb { 
    top: 90px; 
    height: 270px; 
  }
  .title { 
    font-size: 5.5rem; 
    top: 172px; 
    padding: 0.4rem 1.5rem;
  }
  .modal {
    width: 450px;
    height: 450px;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* Mobile adjustments */
@media (max-width: 640px) {
  .grid-wrapper { 
    width: 400px; 
    height: 400px; 
  }
  .grid { 
    grid-template-columns: repeat(5, 80px); 
    grid-template-rows: repeat(5, 80px); 
    width: 400px;
    height: 400px;
  }
  .veleb { 
    top: 80px; 
    height: 240px; 
  }
  .title { 
    font-size: 5rem; 
    top: 153px; 
    padding: 0.3rem 1.2rem;
  }
  .modal {
    width: 400px;
    height: 400px;
  }
  .modal-content {
    padding: 1.5rem;
  }
}

/* Small mobile adjustments */
@media (max-width: 480px) {
  .grid-wrapper { 
    width: 350px; 
    height: 350px; 
  }
  .grid { 
    grid-template-columns: repeat(5, 70px); 
    grid-template-rows: repeat(5, 70px); 
    width: 350px;
    height: 350px;
  }
  .veleb { 
    top: 70px; 
    height: 210px; 
  }
  .title { 
    font-size: 4.3rem; 
    top: 138px; 
    padding: 0.2rem 1rem;
  }
  .modal {
    width: 350px;
    height: 350px;
  }
}

/* Extra small mobile adjustments */
@media (max-width: 420px) {
  .grid-wrapper { 
    width: 300px; 
    height: 300px; 
  }
  .grid { 
    grid-template-columns: repeat(5, 60px); 
    grid-template-rows: repeat(5, 60px); 
    width: 300px;
    height: 300px;
  }
  .veleb { 
    top: 60px; 
    height: 180px; 
  }
  .title { 
    font-size: 3.3rem; 
    top: 123px; 
    padding: 0.1rem 0.8rem;
  }
  .modal {
    width: 300px;
    height: 300px;
  }
  .modal-content {
    padding: 1rem;
  }
  
  .box span {
    font-size: 0.8rem;
  }
  
  .box[style*="top2"] span,
  .box[style*="top3"] span {
    font-size: 0.7rem;
  }
}