
/* =========================================
   OSNOVNI IZGLED
========================================= */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 25px;
}

body {
    margin: 0;
    padding: 0;
    background-color: #F8F4ED;
    font-family: Arial, sans-serif;
    color: #302725;
    line-height: 1.7;
}

/* =========================================
   ZAGLAVLJE
========================================= */

header {
    background: linear-gradient(
        135deg,
        #42151E,
        #681F2B,
        #87343A
    );

    min-height: 220px;
    padding: 40px 20px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Dekorativna zlatna linija */

header::after {
    content: "";
    width: 75px;
    height: 3px;
    background: #C5A46D;
    margin-top: 22px;
    border-radius: 5px;
}

h1 {
    font-size: clamp(36px, 6vw, 68px);
    font-weight: 700;
    letter-spacing: 1px;
    line-height: 1.2;

    color: #FFF9F0;

    text-shadow: 0 3px 12px rgba(0,0,0,0.2);

    margin: 0;
}

header h2 {
    font-size: clamp(19px, 3vw, 30px);
    font-weight: 400;

    color: #EADCC9;

    margin: 12px 0 0;
}

/* =========================================
   NAVIGACIJA
========================================= */

nav {
    width: 100%;
    background: #FFFCF7;

    display: flex;
    justify-content: center;
    align-items: center;

    padding: 14px 20px;

    box-shadow: 0 3px 15px rgba(50, 25, 20, 0.07);

    position: relative;
    z-index: 10;
}

nav ul {
    list-style: none;

    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;

    gap: 8px;

    padding: 0;
    margin: 0;
}

nav ul li a {
    display: block;

    padding: 10px 19px;

    color: #63232D;
    text-decoration: none;

    font-size: 15px;
    font-weight: 600;

    border-radius: 7px;

    transition: all 0.25s ease;
}

nav ul li a:hover,
nav ul li a.active {
    color: #FFFFFF;
    background: #681F2B;
}

nav ul li a:hover {
    transform: translateY(-2px);
}

/* =========================================
   GLAVNI SADRŽAJ
========================================= */

main {
    width: 100%;
    max-width: 1150px;

    margin: 45px auto;
    padding: 0 25px;
}

/* =========================================
   KARTICE SADRŽAJA
========================================= */

.intro,
.pravila,
.osobitosti,
.zanimljivosti {

    position: relative;

    background: #FFFCF7;

    border: 1px solid #E9DFD1;
    border-radius: 12px;

    padding: 35px;

    margin: 30px auto;

    box-shadow:
        0 4px 15px rgba(55, 30, 20, 0.05);

    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease;
}

.intro:hover,
.pravila:hover,
.osobitosti:hover,
.zanimljivosti:hover {

    transform: translateY(-3px);

    box-shadow:
        0 9px 25px rgba(55, 30, 20, 0.09);
}

/* =========================================
   DEKORATIVNE IKONICE
========================================= */

.intro::before,
.pravila::before,
.osobitosti::before,
.zanimljivosti::before {

    content: "";

    position: absolute;

    top: 22px;
    right: 24px;

    width: 27px;
    height: 27px;

    background-image: url("ikona.png");

    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;

    opacity: 0.80;
}

/* =========================================
   NASLOVI KARTICA
========================================= */

.intro h2,
.pravila h2,
.osobitosti h2,
.zanimljivosti h2 {

    color: #681F2B;

    font-size: clamp(24px, 3vw, 33px);
    font-weight: 700;

    margin: 0 0 22px;
    padding-bottom: 13px;

    border-bottom: 1px solid #DCC9AC;
}

.pravila h3,
.osobitosti h3,
.zanimljivosti h3 {

    color: #87343A;

    font-size: 21px;
    font-weight: 700;

    margin-top: 30px;
    margin-bottom: 12px;
}

/* =========================================
   TEKST
========================================= */

.intro p,
.pravila p,
.osobitosti p,
.zanimljivosti p {

    color: #453B36;

    font-size: 16px;
    line-height: 1.85;

    margin-top: 0;
    margin-bottom: 18px;
}

.intro p {
    text-align: left;
}

.pravila p,
.osobitosti p,
.zanimljivosti p {
    text-align: justify;
}

/* =========================================
   POPISI
========================================= */

.pravila ul,
.osobitosti ul,
.zanimljivosti ul {

    padding-left: 25px;

    line-height: 1.9;
}

.pravila li,
.osobitosti li,
.zanimljivosti li {

    padding-left: 5px;
    margin-bottom: 9px;
}

.pravila em,
.osobitosti em,
.zanimljivosti em {

    color: #87343A;

    font-weight: 700;
    font-style: normal;
}

/* =========================================
   PREPOZNAVANJE KARTICA
========================================= */

#prepoznavanje {
    text-align: center;
}

#webcam-container {

    width: 100%;
    max-width: 500px;

    margin: 25px auto;

    padding: 12px;

    background: #F0E7DB;

    border: 2px solid #D7C3A5;
    border-radius: 12px;

    box-shadow:
        0 5px 18px rgba(55, 30, 20, 0.08);
}

#webcam-container canvas {
    display: block;

    width: 100%;
    height: auto;

    border-radius: 7px;
    background: #302725;
}

#webcam {
    display: block;

    width: 100%;

    border-radius: 7px;
    background: #302725;
}

/* =========================================
   GUMBI
========================================= */

#prepoznavanje button {

    margin: 7px;
    padding: 13px 23px;

    color: #FFF9F0;
    background: #681F2B;

    border: 1px solid #681F2B;
    border-radius: 7px;

    font-size: 15px;
    font-weight: 600;

    cursor: pointer;

    transition: all 0.25s ease;

    box-shadow:
        0 3px 9px rgba(80, 25, 35, 0.13);
}

#prepoznavanje button:hover {

    background: #87343A;
    border-color: #87343A;

    transform: translateY(-2px);

    box-shadow:
        0 6px 14px rgba(80, 25, 35, 0.18);
}

#prepoznavanje button:active {
    transform: scale(0.97);
}

#prepoznavanje button:focus-visible {
    outline: 3px solid #C5A46D;
    outline-offset: 4px;
}

/* =========================================
   REZULTAT PREPOZNAVANJA
========================================= */

#status,
#result {

    color: #681F2B;

    font-size: 16px;
    font-weight: 600;

    line-height: 1.7;

    margin: 15px auto;
}

/* =========================================
   KONTAKTNA FORMA
========================================= */

.kontakt-forma {

    width: 100%;
    max-width: 550px;

    margin: 35px auto;
    padding: 32px;

    background: #FFFCF7;

    border: 1px solid #E9DFD1;
    border-radius: 12px;

    box-shadow:
        0 5px 18px rgba(55, 30, 20, 0.07);

    display: flex;
    flex-direction: column;
    gap: 12px;

    position: relative;
}

/* =========================================
    PODNOŽJE
========================================= */

footer {

    margin-top: 60px;
    padding: 35px 20px;

    text-align: center;

    color: #F8EDE0;
    background: #42151E;

    border-top: 3px solid #C5A46D;
}

footer a {

    color: #E6C99A;

    font-weight: 600;
    text-decoration: none;

    transition: color 0.2s ease;
}

footer a:hover {
    color: #FFFFFF;
    text-decoration: underline;
}

/* =========================================
   RESPONZIVNI DIZAJN
========================================= */

@media (max-width: 768px) {

    header {
        min-height: 175px;
        padding: 30px 15px;
    }

    nav {
        padding: 12px;
    }

    nav ul {
        gap: 5px;
    }

    nav ul li a {
        padding: 10px 13px;
        font-size: 14px;
    }

    main {
        margin: 25px auto;
        padding: 0 17px;
    }

    .intro,
    .pravila,
    .osobitosti,
    .zanimljivosti {
        padding: 27px 22px;
        margin: 23px auto;
    }

    .kontakt-forma {
        padding: 25px 20px;
    }
}

@media (max-width: 600px) {

    header {
        min-height: 150px;
        padding: 25px 12px;
    }

    nav ul {
        flex-direction: column;
        width: 100%;
    }

    nav ul li,
    nav ul li a {
        width: 100%;
        text-align: center;
    }

    main {
        padding: 0 12px;
    }

    .intro,
    .pravila,
    .osobitosti,
    .zanimljivosti {

        padding: 23px 17px;
        margin: 20px auto;

        border-radius: 10px;
    }

    .intro p,
    .pravila p,
    .osobitosti p,
    .zanimljivosti p {

        font-size: 15px;
        line-height: 1.75;
    }

    .intro::before,
    .pravila::before,
    .osobitosti::before,
    .zanimljivosti::before {

        width: 21px;
        height: 21px;

        top: 17px;
        right: 16px;
    }

    .kontakt-forma {
        margin: 22px auto;
        padding: 22px 17px;
    }

    #prepoznavanje button {
        width: 100%;
        max-width: 280px;
        margin: 6px auto;
    }

    #webcam-container {
        padding: 7px;
    }
}

/* =========================================
    PRISTUPAČNOST
========================================= */

a:focus-visible,
button:focus-visible {
    outline: 3px solid #C5A46D;
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}
