/* ==========================================
   MOJ.CSS - Estetika, boje i vizuelni identitet
   ========================================== */

:root {
  --modal_backdrop: 20, 20, 20;
  --modal_box_background: var(--modal_background_color);
  --modal_box_color: 255, 255, 255;

  --info_color: 52, 152, 219;
  --success_color: 46, 204, 113;
  --warning_color: 241, 196, 15;
  --error_color: 231, 76, 60;
  --toast_background_color: 45, 45, 45;
}

/* Nevidljivi štit nema boju, samo providnost */
body:has(modal-box:popover-open)::after,
body:has(modal-picture:popover-open)::after,
body:has(modal-gallery:popover-open)::after,
body:has(modal-confirm:popover-open)::after,
body:has(modal-alert:popover-open)::after,
body:has(modal-video:popover-open)::after,
body:has(modal-wizard:popover-open)::after {
  background: transparent;
}

/* ==========================================
   ZAJEDNIČKI DIJALOŠKI PROZORI
   ========================================== */
modal-box,
modal-confirm,
modal-alert,
modal-wizard {
  background-color: rgb(var(--modal_box_background));
  color: rgb(var(--modal_box_color));
  border: none;
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  padding: 20px;
}

modal-header {
  font-size: 1.4rem;
  font-weight: bold;
  border-bottom: 1px solid rgba(var(--modal_box_color), 0.5);
  padding-bottom: 10px;
  margin-bottom: 10px;
  user-select: none;
}

modal-footer {
  gap: 10px;
  border-top: 1px solid rgba(var(--modal_box_color), 0.5);
  padding-top: 10px;
  margin-top: 10px;
}

/* ==========================================
   SVG KONTROLE I DUGMAD (Boje i efekti)
   ========================================== */
modal-close svg,
modal-fullscreen svg,
gallery-prev svg,
gallery-next svg,
gallery-playpause svg,
.modal-status-icon svg {
  fill: currentColor;
}

[type="info"] .modal-status-icon {
  color: #3498db;
}
[type="success"] .modal-status-icon {
  color: #2ecc71;
}
[type="warning"] .modal-status-icon {
  color: #f1c40f;
}
[type="error"] .modal-status-icon {
  color: #e74c3c;
}

modal-close {
  cursor: pointer;
  font-family: sans-serif;
  font-size: 30px;
  font-weight: bold;
  line-height: 1;
  color: inherit;
  transition: transform 0.1s ease-in-out;
  user-select: none;
}
modal-close:hover {
  transform: scale(1.2);
}

/* Standardna dugmad */
.modal-btn {
  padding: 8px 18px;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.1s ease;
}
.modal-btn:hover { opacity: 0.9; }
.modal-btn:active { transform: scale(0.97); }

.modal-btn-confirm { background-color: #3498db; color: #ffffff; }
.modal-btn-cancel { background-color: rgba(255, 255, 255, 0.2); color: rgb(var(--modal_box_color)); }

/* ==========================================
   MEDIJALNI MODALI (Picture, Gallery, Video)
   ========================================== */
modal-picture,
modal-gallery,
modal-video {
  background-color: transparent;
  user-select: none;
  box-shadow: none !important;
  border: none;
  outline: none;
}

modal-picture picture-info,
modal-gallery picture-info,
modal-video picture-info {
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 100%);
  color: #ffffff;
  padding: 30px 20px 15px 20px;
  box-sizing: border-box;
  font-family: sans-serif;
}

modal-picture picture-title,
modal-gallery picture-title,
modal-video video-title {
  font-size: 1.2rem;
  font-weight: bold;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
  background-color: rgba(var(--modal_backdrop), 0.8);
  backdrop-filter: blur(5px);
  padding: 0px 10px;
  border-radius: 5px;
}

modal-picture picture-description,
modal-gallery picture-description,
modal-video video-description {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.8;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
  background-color: rgba(var(--modal_backdrop), 0.8);
  backdrop-filter: blur(5px);
  padding: 0px 10px;
  border-radius: 5px;
}

modal-loader {
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top: 4px solid #ffffff;
  border-radius: 50%;
  animation: modal-spin 1s linear infinite;
}

@keyframes modal-spin {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

video-wrapper {
  background: #000;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

video-wrapper video,
video-wrapper iframe {
  border: none;
}

/* KONTROLE GALERIJE I VIDEA (Boje i efekti) */
modal-picture > modal-close,
modal-gallery > modal-close,
modal-video > modal-close {
  color: white;
  text-shadow: 0px 0px 5px rgba(0,0,0,0.8);
  font-size: 30px;
}

modal-fullscreen {
  cursor: pointer;
  font-family: sans-serif;
  font-size: 30px;
  font-weight: bold;
  line-height: 1;
  color: white;
  text-shadow: 0px 0px 5px rgba(0,0,0,0.8);
  transition: transform 0.1s ease-in-out;
  user-select: none;
}
modal-fullscreen:hover { transform: scale(1.15); }
modal-picture > modal-fullscreen,
modal-gallery > modal-fullscreen { color: white; }

gallery-playpause {
  font-family: sans-serif;
  font-size: 30px;
  font-weight: bold;
  line-height: 1;
  color: white;
  cursor: pointer;
  text-shadow: 0px 0px 5px rgba(0,0,0,0.8);
  transition: transform 0.1s ease, color 0.2s ease;
  user-select: none;
}
gallery-playpause:hover { transform: scale(1.2); }

gallery-prev,
gallery-next {
  font-family: sans-serif;
  font-weight: bold;
  line-height: 1;
  border-radius: 50%;
  font-size: 40px;
  color: white;
  cursor: pointer;
  text-shadow: 0 2px 10px rgba(0,0,0,0.8);
  transition: transform 0.1s ease, opacity 0.2s ease;
  opacity: 0.7;
  padding: 20px;
}
gallery-prev:hover,
gallery-next:hover {
  opacity: 1;
  transform: scale(1.2);
  text-shadow: 0 2px 10px rgba(0,0,0,1);
}

gallery-dots {
  gap: 8px;
  padding: 10px;
  background-color: rgba(0, 0, 0, 0.3);
  border-radius: 20px;
}
.gallery-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
.gallery-dot:hover { background-color: rgba(255, 255, 255, 0.8); transform: scale(1.2); }
.gallery-dot.active { background-color: rgba(255, 255, 255, 1); transform: scale(1.2); }

@media (max-width: 768px) {
  gallery-prev, gallery-next { display: none; }
}

@keyframes galleryFadeInAnim {
  0% { opacity: 0; transform: scale(0.98); }
  100% { opacity: 1; transform: scale(1); }
}
modal-gallery picture.gallery-fade-in,
modal-gallery picture-info.gallery-fade-in {
  animation: galleryFadeInAnim 0.3s ease-out forwards;
}

/* ==========================================
   MODAL TOAST
   ========================================== */
modal-toast {
  padding: 14px 45px 14px 18px;
  background-color: rgb(var(--toast_background_color));
  color: rgb(var(--modal_box_color));
  border: none;
  border-radius: 0 6px 6px 0;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  font-family: sans-serif;
  transition: top 0.25s ease, bottom 0.25s ease, opacity 0.2s ease;
}

modal-toast:popover-open {
  gap: 10px;
  animation: toastFadeIn 0.25s ease-out forwards;
}

modal-toast > modal-close:hover {
  transform: translateY(-50%) scale(1.15);
}

modal-toast[type="info"] {
  border-left: 4px solid rgb(var(--info_color));
}
modal-toast[type="success"] {
  border-left: 4px solid rgb(var(--success_color));
}
modal-toast[type="warning"] {
  border-left: 4px solid rgb(var(--warning_color));
}
modal-toast[type="error"] {
  border-left: 4px solid rgb(var(--error_color));
}

@keyframes toastFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ==========================================
   MODAL WIZARD (Stepper) - Estetika
   ========================================== */
wizard-steps-nav {
  gap: 15px;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(var(--modal_box_color), 0.2);
  user-select: none;
}

.wizard-step-indicator {
  gap: 8px;
  opacity: 0.45;
  font-size: 0.9rem;
  transition: opacity 0.2s ease;
  cursor: pointer;
}
.wizard-step-indicator.active,
.wizard-step-indicator.completed {
  opacity: 1;
}

.wizard-step-number {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: rgba(var(--modal_box_color), 0.2);
  font-weight: bold;
  font-size: 0.85rem;
}
.wizard-step-indicator.active .wizard-step-number { background-color: #3498db; color: #ffffff; }
.wizard-step-indicator.completed .wizard-step-number { background-color: #2ecc71; color: #ffffff; }

wizard-step {
  min-height: 80px;
}

wizard-previous,
wizard-next,
wizard-finish {
  padding: 8px 18px;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  user-select: none;
  transition: opacity 0.15s ease, transform 0.1s ease;
}
wizard-previous:hover, wizard-next:hover, wizard-finish:hover { opacity: 0.9; }
wizard-previous:active, wizard-next:active, wizard-finish:active { transform: scale(0.97); }

wizard-previous { background-color: rgba(255, 255, 255, 0.2); color: rgb(var(--modal_box_color)); }
wizard-next { background-color: #3498db; color: #ffffff; }
wizard-finish { background-color: #2ecc71; color: #ffffff; }
