@import url('https://fonts.cdnfonts.com/css/jetbrains-mono');

:root{
  --bg-1: #3a0ca3;
  --bg-2: #5a189a;
  --card-bg: rgba(0,0,0,0.45);
  --accent: #7b2cbf;
  --accent-2: #9d4edd;
  --text-1: #ffd670;
  --text-2: #e0ccff;
}

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

html, body{
  height:100%;
  margin:0;
  font-family: 'JetBrains Mono', monospace;
  background: radial-gradient(circle at 20% 20%, #a259ff, transparent 25%),
              radial-gradient(circle at 80% 80%, #ff3cac, transparent 25%),
              linear-gradient(135deg, #3a0ca3, #662796, #8921b1);
  background-attachment: fixed;
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before {
  content: "";
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-image: 
      linear-gradient(to right, rgba(255,255,255,0.05) 1px, transparent 1px),
      linear-gradient(to bottom, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 50px 50px;
  z-index: 0;
  animation: moveGrid 15s linear infinite;
  pointer-events: none;
}

@keyframes moveGrid {
  0% {background-position: 0 0, 0 0;}
  50% {background-position: 100px 100px, -100px -100px;}
  100% {background-position: 0 0, 0 0;}
}

.quiz-container{
  width: 92%;
  max-width: 800px;
  margin: 5vh auto;
  background: var(--card-bg) !important;
  border-radius: 16px;
  padding: 28px;
  color: #fff;
  box-shadow: 0 10px 30px rgba(0,0,0,0.45);
  display:flex;
  flex-direction:column;
  align-items:stretch;
  position: relative;
  z-index: 1;
  overflow: auto;
}

.quiz-container::after, .quiz-container::before, .controls::after, .controls::before {
  display: none !important;
}

.quiz-header{
  text-align:center;
  margin-bottom: 10px;
}
.quiz-header h2{
  margin:0 0 6px 0;
  color: var(--text-1);
  font-size: 1.9rem;
}
.quiz-header p{
  margin:0;
  color: var(--text-2);
  opacity:0.95;
}

.question {
  font-size: 1.4rem;
  margin: 18px 0;
  min-height: 56px;
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  padding: 6px 12px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

#questionText {
  text-align: left !important;
  line-height: 1.8 !important;
  font-size: 1.1rem !important;
}
#questionText ul {
  padding-left: 24px;
  margin: 16px 0;
}
#questionText strong {
  color: #ffd670;
}
#questionText small {
  color: #b19cd9;
  font-size: 0.9rem;
  display: block;
  margin-top: 12px;
}

.answers {
  display:flex;
  flex-direction:column;
  gap: 10px;
  margin-top: 8px;
}
.answer-btn{
  background: rgba(255,255,255,0.06);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.06);
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 1rem;
  cursor: pointer;
  transition: transform .12s ease, background-color .12s ease, box-shadow .12s ease;
  text-align:left;
}
.answer-btn:hover{
  transform: translateY(-3px);
  background: rgba(157,78,221,0.12);
  box-shadow: 0 6px 16px rgba(0,0,0,0.35);
}
.answer-btn[disabled]{ cursor: default; opacity: 0.95; }

/* Odabrani odgovor - samo ljubicasta oznaka, bez zelene/crvene */
.answer-selected {
    background: rgba(123, 44, 191, 0.3) !important;
    border-color: var(--accent) !important;
}

.controls{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-top: 18px;
  gap:12px;
  background: transparent !important;
}
.progress { flex:1; margin-right:12px; height:10px; background: rgba(255,255,255,0.08); border-radius: 6px; overflow:hidden; }
.progress > span { display:block; height:100%; width:0%; background: linear-gradient(90deg,var(--accent),var(--accent-2)); transition: width .4s ease; }

#nextBtn{
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight:600;
  cursor:pointer;
  transition: transform .12s ease, background .12s ease;
}
#nextBtn:disabled{ opacity:0.6; cursor:default; transform:none; }
#nextBtn:hover:not(:disabled){ transform: translateY(-3px); background: var(--accent-2); }

.result { text-align:center; padding:18px; font-size:1.2rem; color: var(--text-1); }

#answers .text-center .btn {
  min-width: 210px !important;
  padding: 16px 32px !important;
  font-size: 1.15rem !important;
  border-radius: 12px !important;
  margin: 0 12px !important;
}

::-webkit-scrollbar{ width: 10px; }
::-webkit-scrollbar-track{ background: rgba(0,0,0,0.3); border-radius: 10px; }
::-webkit-scrollbar-thumb{ background: var(--accent); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover{ background: var(--accent-2); }

/* Timer stilovi */
.timer-container {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 12px 16px;
    margin: 15px 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.timer-text {
    color: var(--text-2);
    font-size: 0.95rem;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.timer-text span {
    color: var(--text-1);
    font-weight: bold;
    font-size: 1.1rem;
}

.timer-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
}

.timer-progress {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #0dd60d, #7b2cbf);
    border-radius: 4px;
    transition: width 1s linear;
}

.timer-warning {
    color: #ff6b6b !important;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* REZULTATI STILOVI */
.results-screen {
    text-align: center;
}

.results-header .trophy {
    font-size: 4rem;
    margin-bottom: 10px;
}

.results-header h2 {
    color: var(--text-1);
    font-size: 2rem;
    margin-bottom: 8px;
}

.grade-excellent { color: #0dd60d; font-size: 1.5rem; font-weight: bold; }
.grade-good { color: var(--text-1); font-size: 1.5rem; font-weight: bold; }
.grade-ok { color: var(--text-2); font-size: 1.5rem; font-weight: bold; }
.grade-bad { color: #ff4d4f; font-size: 1.5rem; font-weight: bold; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 20px 0;
}

.stat-card {
    background: rgba(123, 44, 191, 0.2);
    border: 1px solid rgba(123, 44, 191, 0.4);
    border-radius: 12px;
    padding: 16px;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: #fff;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-2);
    margin-top: 4px;
}

.stat-percent {
    font-size: 1.4rem;
    color: #00f7ff;
    margin-top: 8px;
}

.stat-icon {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.results-title {
    color: #fff;
    font-size: 1.2rem;
    text-align: left;
    margin: 20px 0 12px;
}

.results-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.result-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 8px;
    text-align: left;
}

.result-correct {
    background: rgba(13, 214, 13, 0.15);
    border: 1px solid rgba(13, 214, 13, 0.3);
}

.result-wrong {
    background: rgba(255, 77, 79, 0.15);
    border: 1px solid rgba(255, 77, 79, 0.3);
}

.result-icon {
    font-size: 1.5rem;
    font-weight: bold;
}

.result-correct .result-icon { color: #0dd60d; }
.result-wrong .result-icon { color: #ff4d4f; }

.result-content {
    flex: 1;
}

.result-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-2);
    margin-bottom: 6px;
}

.result-question {
    color: #fff;
    font-size: 0.95rem;
    margin-bottom: 8px;
}

.result-answers {
    font-size: 0.85rem;
}

.result-answers .label {
    color: var(--text-2);
}

.text-correct { color: #0dd60d; }
.text-wrong { color: #ff4d4f; }

.results-summary {
    background: rgba(0,0,0,0.2);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 20px;
}

.summary-bar {
    display: flex;
    height: 10px;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 8px;
}

.summary-correct { background: #0dd60d; }
.summary-wrong { background: #ff4d4f; }

.summary-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

.btn-restart {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 14px 28px;
    font-size: 1.1rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-restart:hover {
    background: var(--accent-2);
    transform: scale(1.05);
}

@media (max-width: 768px) {
  ::-webkit-scrollbar{ width: 0px; }
  #questionText{ font-size: 1rem !important; }
  #answers .text-center .btn{ display: block !important; width: 85% !important; margin: 12px auto !important; }
}

@media (max-width: 600px) {
    .stats-grid { grid-template-columns: 1fr; }
    .stat-value { font-size: 1.4rem; }
}

@media (max-width:480px){
  .question{ font-size:1.05rem; }
  .answer-btn{ font-size:0.95rem; padding:10px; }
}
