
/* ============================================================
   CSS SECTION: RESET & BASE – body, globalni elementi
   ============================================================ */
body {
    font-family: Arial, sans-serif;
    margin: 0; padding: 0;
    background: #f5f5f5;
    color: #333;
    line-height: 1.5;
    overflow-x: hidden;
}
img, iframe, video {
    max-width: 100%;
    height: auto;
}

/* ============================================================
   CSS SECTION: HEADER – logo, naslov, navigacija
   ============================================================ */
header {
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    padding: 15px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.header-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    text-align: center;
    margin-bottom: 15px;
}
.logo-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
}
header img { height: 50px; margin-bottom: 10px; }
.site-title {
    font-size: 20px;
    font-weight: bold;
    color: red;
    text-align: center;
}
nav { width: 100%; overflow-x: auto; padding-bottom: 5px; }
.nav-container {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    min-width: min-content;
    padding: 5px 0;
}
nav a {
    display: inline-block;
    padding: 8px 12px;
    text-decoration: none;
    color: #333;
    font-weight: bold;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
    border-radius: 4px;
    margin: 2px;
    transition: all 0.3s;
}
nav a:hover { background: #007ACC; color: white; }

/* ============================================================
   CSS SECTION: HERO – desktop bazni stil (cover, desno poravnanje)
   ============================================================ */
.hero {
    position: relative;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center center;
    background-color: #000;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    text-align: right;
    padding: 20px;
    font-family: 'Cuprum', sans-serif;
    color: #007ACC;
}
.hero-content {
    max-width: 80%;
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}
.hero h1, .hero h2, .hero p {
    text-shadow: 1px 1px 2px rgba(255,255,255,0.6);
    max-width: 100%;
    margin: 0;
    text-align: right;
}
.hero h1 { font-size: 37px; font-weight: 700; line-height: 1.3; }
.hero h2 { font-size: 32px; font-weight: 400; margin-top: 10px; line-height: 1.2; }
.hero p  { font-size: 20px; margin-top: 15px; font-weight: 400; }
.hero a {
    display: inline-block;
    margin-top: 40px;
    padding: 12px 25px;
    background: #FFD700;
    color: #000;
    text-decoration: none;
    font-weight: bold;
    border-radius: 5px;
    box-shadow: 0 3px 6px rgba(0,0,0,0.2);
    font-size: 14px;
    align-self: center;
    text-align: center;
}
.hero a:hover { background: #FFC107; }

/* ============================================================
   CSS SECTION: MAIN LAYOUT – wrapper, sekcije, section-header
   ============================================================ */
main {
    width: 100%;
    padding: 15px;
    max-width: 1200px;
    margin: 0 auto;
}
section {
    background: #fff;
    padding: 0;
    margin-bottom: 24px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
    overflow: hidden;
}
.section-header {
    padding: 20px 24px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.section-header h2 {
    font-size: 1.15rem;
    color: #002B5C;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}
.section-header h2 i { color: #ffd700; }
.section-header a {
    font-size: 0.85rem;
    font-weight: 600;
    color: #ffd700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color 0.2s;
}
.section-header a:hover { color: #002B5C; }
.section-body { padding: 20px 24px 24px; }
.grid3 { display: grid; grid-template-columns: 1fr; gap: 18px; }

/* ============================================================
   CSS SECTION: SCROLLING NEWS TICKER – animirani natpisi vijesti
   ============================================================ */
.scrolling-news {
    background: #002B5C;
    overflow: hidden;
    white-space: nowrap;
    box-sizing: border-box;
    padding: 10px 0;
    position: relative;
    width: 100%;
    margin: 10px 0;
    border-top: 2px solid #ffd700;
    border-bottom: 2px solid #ffd700;
}
.scrolling-wrapper {
    display: inline-block;
    white-space: nowrap;
    animation: scrollNews 50s linear infinite;
}
.scrolling-wrapper a {
    display: inline-block;
    padding: 0 20px;
    font-weight: bold;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}
.scrolling-wrapper a:hover { color: #ffd700; }
@keyframes scrollNews {
    0%   { transform: translateX(0%); }
    100% { transform: translateX(-50%); }
}

/* ============================================================
   CSS SECTION: NEWS CARDS – kartice vijesti (slika + tekst)
   ============================================================ */
.news-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
    display: flex;
    flex-direction: column;
}
.news-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    border-color: #002B5C;
}
.news-card-img {
    width: 100%;
    height: auto;
    min-height: 180px;
    overflow: hidden;
    background: #f5f5f5;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.news-card-img img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    transition: transform 0.6s ease;
}
.news-card:hover .news-card-img img { transform: scale(1.02); }
.news-body { padding: 14px 16px 16px; display: flex; flex-direction: column; flex-grow: 1; }
.news-body h3 { margin: 0 0 8px; font-size: 1rem; font-weight: 600; color: #002B5C; line-height: 1.4; }
.news-body p  { margin: 0 0 12px; color: #64748b; font-size: 0.875rem; line-height: 1.5; flex-grow: 1; }
.news-card-foot { display: flex; justify-content: flex-end; margin-top: auto; }
.news-read-more { font-size: 0.82rem; font-weight: 600; color: #ffd700; display: inline-flex; align-items: center; gap: 4px; transition: color 0.2s; }
.news-card:hover .news-read-more { color: #002B5C; }

/* ============================================================
   CSS SECTION: COMPETITION CARDS – kartice natjecanja
   ============================================================ */
.competition-cards { display: grid; grid-template-columns: 1fr; gap: 14px; }
.card-competition {
    background: white;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
    transition: all 0.3s ease;
}
.card-competition:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.08);
    border-color: #002B5C;
}
.card-competition-header {
    background: #f8fafc;
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.card-competition h4 { margin: 0; color: #002B5C; font-size: 0.95rem; font-weight: 600; line-height: 1.3; }
.card-competition-status { flex-shrink: 0; font-size: 0.72rem; font-weight: 600; padding: 3px 10px; border-radius: 20px; white-space: nowrap; }
.status-past      { background: #f1f5f9; color: #64748b; }
.status-current   { background: #dcfce7; color: #166534; }
.status-next      { background: #fefce8; color: #854d0e; }
.status-cancelled { background: #fee2e2; color: #991b1b; }
.card-competition-body { padding: 12px 16px; }
.card-competition-row {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.82rem;
    color: #475569;
    margin-bottom: 6px;
}
.card-competition-row:last-child { margin-bottom: 0; }
.card-competition-row i        { color: #ffd700; width: 14px; flex-shrink: 0; }
.card-competition-row strong   { color: #002B5C; }
.card-competition-cancelled {
    background: #fff1f2;
    border: 1px solid #fecaca;
    border-left: 4px solid #dc2626;
    border-radius: 8px;
    padding: 10px 14px;
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: #991b1b;
    font-weight: 600;
}
.card-competition-cancelled i { color: #dc2626; }

/* ============================================================
   CSS SECTION: SPONZORI – preview grid s logotipima i badge-evima
   ============================================================ */
.sponzori-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
    align-items: center;
}
.sponzor-preview-card {
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 100px;
}
.sponzor-preview-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.08);
    border-color: #ffd700;
    background: white;
}
.sponzor-preview-card img { max-width: 100%; max-height: 60px; width: auto; height: auto; object-fit: contain; filter: grayscale(20%); transition: filter 0.3s ease; }
.sponzor-preview-card:hover img { filter: grayscale(0%); }
.sponzor-preview-name  { font-size: 0.78rem; font-weight: 600; color: #64748b; text-align: center; line-height: 1.3; }
.sponzor-preview-badge { font-size: 0.68rem; font-weight: 600; padding: 2px 8px; border-radius: 20px; }
.sponzor-preview-badge.generalni { background: #002B5C; color: #ffd700; }
.sponzor-preview-badge.zlatni    { background: #ffd700; color: #002B5C; }
.sponzor-preview-badge.srebrni   { background: #e2e8f0; color: #475569; }
.sponzor-preview-badge.broncani  { background: #fed7aa; color: #9a3412; }
.sponzor-preview-badge.ostalo    { background: #f1f5f9; color: #64748b; }
.sponzori-loading { text-align: center; padding: 30px; color: #94a3b8; font-size: 0.9rem; grid-column: 1 / -1; }
.sponzori-loading i { color: #ffd700; margin-right: 8px; }

/* ============================================================
   CSS SECTION: FOOTER
   ============================================================ */
footer { background: #222; color: #fff; padding: 20px; text-align: center; font-size: 14px; }
footer a { color: #FFD700; text-decoration: none; display: inline-block; margin-top: 10px; }

/* ============================================================
   CSS SECTION: PRIVACY MODAL
   ============================================================ */
.privacy-modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(12px);
    z-index: 20000;
    justify-content: center;
    align-items: center;
    padding: 24px;
}
.privacy-modal.active { display: flex; animation: modalFadeIn 0.3s ease-out; }
@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to   { opacity: 1; transform: scale(1); }
}
.privacy-modal-content {
    background: white;
    border-radius: 12px;
    max-width: 900px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    border: 1px solid #e2e8f0;
    box-shadow: 0 25px 50px rgba(0,0,0,0.3);
}
.privacy-modal-close {
    position: sticky;
    top: 12px; right: 0;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #64748b;
    transition: all 0.3s ease;
    width: 36px; height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: white;
    margin: 10px 16px 0 0;
    z-index: 10;
}
.privacy-modal-close:hover { color: #ffd700; background: #002B5C; transform: rotate(90deg); }
.privacy-modal-body { padding: 0 24px 24px 24px; clear: both; }

/* ============================================================
   CSS SECTION: DESKTOP MEDIA QUERIES – tablet (768px+)
   ============================================================ */
@media (min-width: 768px) {
    header { flex-direction: row; justify-content: space-between; align-items: center; padding: 20px 30px; }
    .header-top { flex-direction: row; align-items: center; width: auto; text-align: left; margin-bottom: 0; }
    .logo-link { flex-direction: row; }
    header img { height: 60px; margin-bottom: 0; margin-right: 10px; }
    .site-title { font-size: 24px; text-align: left; }
    nav { width: auto; overflow-x: visible; }
    .nav-container { flex-wrap: wrap; justify-content: flex-end; min-width: auto; }
    nav a { font-size: 15px; margin-left: 10px; }
    .hero { height: 267px; padding: 20px 60px; align-items: flex-end; }
    .hero h1 { font-size: 37px; text-align: right; }
    .hero h2 { font-size: 32px; text-align: right; }
    .hero p  { font-size: 20px; text-align: right; }
    .hero a  { font-size: 21px; margin-top: 50px; align-self: center; }
    .grid3 { grid-template-columns: repeat(2, 1fr); }
    .competition-cards { grid-template-columns: repeat(2, 1fr); }
    main { padding: 20px; }
    .scrolling-wrapper a { font-size: 15px; padding: 0 30px; }
}

/* ============================================================
   CSS SECTION: DESKTOP MEDIA QUERIES – laptop (1024px+)
   ============================================================ */
@media (min-width: 1024px) {
    header { padding: 20px 40px; }
    .site-title { font-size: 28px; }
    nav a { font-size: 16px; margin-left: 15px; padding: 10px 15px; }
    .hero { height: 300px; padding: 20px 100px; align-items: flex-end; }
    .hero-content { max-width: 60%; }
    .hero h1 { font-size: 45px; }
    .hero h2 { font-size: 37px; }
    .hero p  { font-size: 21px; }
    .hero a  { margin-top: 60px; align-self: center; }
    .grid3 { grid-template-columns: repeat(3, 1fr); }
    .competition-cards { grid-template-columns: repeat(3, 1fr); }
    main { max-width: 1100px; margin: 20px auto; }
    .news-card-img { height: 200px; }
}

/* ============================================================
   CSS SECTION: DESKTOP MEDIA QUERIES – wide (1200px+)
   ============================================================ */
@media (min-width: 1200px) {
    main { max-width: 1200px; }
    .hero { padding: 20px 120px; }
    .hero-content { max-width: 55%; }
}

/* ============================================================
   CSS SECTION: MOBILNI HERO – 768px i manje
   Cover slika, tekst gore desno, gumb centriran
   ============================================================ */
@media (max-width: 768px) {
    /* -- Hero: cover, slika centrirana -- */
    .hero {
        min-height: 98px;
        background-size: cover !important;
        background-position: center center !important;
        background-attachment: scroll !important;
        padding: 12px 16px;
        align-items: flex-end;
        justify-content: space-between;
        text-align: right;
        flex-direction: column;
    }
    .hero-content {
        max-width: 90%;
        align-items: flex-end;
        text-align: right;
        margin-top: 8px;
    }
    /* -- Hero tekst: desno, manji fontovi -- */
    .hero h1 {
        font-size: 1.4rem !important;
        line-height: 1.25;
        text-align: right;
    }
    .hero h2 {
        font-size: 1.27rem !important;
        text-align: right;
    }
    .hero p {
        font-size: 0.96rem !important;
        margin-top: 5px;
        text-align: right;
    }
    /* -- Gumb: manji i centriran horizontalno -- */
    .hero .hero-content a {
        padding: 3px 8px !important;
        font-size: 0.77rem !important;
        margin-top: 80px !important;
        margin-bottom: 10px;
        display: block;
        width: fit-content;
        margin-left: auto;
        margin-right: auto;
        text-align: center;
    }

    /* -- Ostali mobilni elementi -- */
    main { padding: 12px; }
    .section-header { padding: 12px 16px; }
    .section-header h2 { font-size: 1rem; }
    .section-header a { font-size: 0.75rem; }
    .section-body { padding: 16px; }
    .grid3 { gap: 16px; }
    .news-card-img { min-height: 140px; }
    .news-body { padding: 12px; }
    .news-body h3 { font-size: 0.9rem; }
    .news-body p  { font-size: 0.8rem; margin-bottom: 8px; }
    .news-read-more { font-size: 0.75rem; }
    .card-competition-header { padding: 10px 12px; flex-wrap: wrap; }
    .card-competition h4 { font-size: 0.85rem; }
    .card-competition-status { font-size: 0.65rem; padding: 2px 8px; }
    .card-competition-body { padding: 10px 12px; }
    .card-competition-row { font-size: 0.75rem; gap: 6px; margin-bottom: 8px; }
    .card-competition-row i { width: 18px; }
    .sponzori-preview-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .sponzor-preview-card { padding: 12px; min-height: auto; }
    .sponzor-preview-card img { max-height: 45px; }
    .sponzor-preview-name { font-size: 0.7rem; }
    .sponzor-preview-badge { font-size: 0.6rem; padding: 2px 6px; }
    .scrolling-news { padding: 6px 0; margin: 8px 0; }
    .scrolling-wrapper a { font-size: 12px; padding: 0 16px; }
    footer { padding: 16px; font-size: 12px; }
    /* Touch feedback */
    .news-card:hover,
    .card-competition:hover,
    .sponzor-preview-card:hover { transform: none; }
    .news-card:active,
    .card-competition:active,
    .sponzor-preview-card:active { background-color: #f8fafc; transform: scale(0.99); transition: 0.05s; }
    /* Privacy modal */
    .privacy-modal-content { max-height: 90vh; }
    .privacy-modal-close { top: 6px; margin: 6px 12px 0 0; font-size: 24px; width: 32px; height: 32px; }
    .privacy-modal-body { padding: 0 16px 16px; font-size: 0.9rem; }
}

/* ============================================================
   CSS SECTION: MOBILNI – 480px i manje (manji telefoni)
   ============================================================ */
@media (max-width: 480px) {
    .hero { min-height: 75px; padding: 12px; }
    .hero h1 { font-size: 1.17rem !important; }
    .hero h2 { font-size: 1.07rem !important; }
    .hero p  { font-size: 0.84rem !important; }
    .site-title { font-size: 18px; }
    header img { height: 45px; }
    .section-header { padding: 10px 12px; }
    .section-header h2 { font-size: 0.9rem; }
    .section-header a { font-size: 0.7rem; }
    .section-body { padding: 12px; }
    .news-card-img { min-height: 120px; }
    .news-body h3 { font-size: 0.85rem; }
    .sponzori-preview-grid { grid-template-columns: 1fr; gap: 10px; }
    .sponzor-preview-card { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 10px; }
    .sponzor-preview-card img { max-height: 40px; }
    .sponzor-preview-name { text-align: left; flex: 1; }
    .sponzor-preview-badge { margin-left: auto; }
    .scrolling-wrapper a { font-size: 11px; padding: 0 12px; }
}

/* ============================================================
   CSS SECTION: MOBILNI – 360px i manje (najmanji ekrani)
   ============================================================ */
@media (max-width: 360px) {
    .hero { min-height: 45px; }
    .hero h1 { font-size: 1.04rem !important; }
    .hero p  { font-size: 0.77rem !important; }
    nav { margin: 0 -20px; padding: 0 20px; }
    .nav-container { padding: 5px 20px; }
}

/* ============================================================
   CSS SECTION: SPECIJALNI MEDIA QUERYJI – print, iOS, high-contrast
   ============================================================ */
@media print {
    .hero, .scrolling-news, nav, footer { display: none; }
    body { background: white; color: black; }
}
@supports (-webkit-touch-callout: none) {
    .hero { background-attachment: scroll; }
}
@media (prefers-contrast: high) {
    .hero h1, .hero p { text-shadow: 2px 2px 0 black; }
}
