/* --- Reset --- */
*{
    margin:0;
    padding:0;
    box-sizing:border-box;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

:root{
    --primary:#4682B4;
    --primary-dark:#1e3a5f;
    --page-bg:#0f172a;
    --text:#e5e7eb;
    --card-bg:#1e293b;
    --hover-bg:#60a5fa;
    --green:#22c55e;
}

/* --- Body --- */
body{
    background: #0f172a; /* background sajta */
    color: #e5e7eb;
}

/* --- Header --- */
header{
    color:white;
    padding:20px 30px;
    text-align:center;
    position:relative;
    z-index:10;
    background: #020617; /* tvoja boja */
    border-bottom: 1px solid rgba(255,255,255,0.05);
    box-shadow: 0 6px 20px rgba(0,0,0,0.5);
}

header h1{
    font-size:28px;
    margin-bottom:10px;
}

/* logo */
.header-inner{
    display:flex;
    align-items:center;
    gap:6px;
    justify-content:center;
    margin-bottom:10px;
    flex-direction: column;
}

.logo{
    height:60px;
    width:auto;
}

.subtitle{
    font-size: 14px;
    color: #cbd5f5;
}

/* --- NAV --- */
nav{
    display:flex;
    justify-content:center;
    gap:25px;
    flex-wrap:wrap;
    margin-top:5px;
}

nav a{
    color:#e2e8f0;
    text-decoration:none;
    font-weight:bold;
    font-size:18px;
    padding:8px 15px;
    border-radius:10px;
    transition:.3s;
}

nav a:hover{
    background:#1e293b;
    color:#4682B4;
    box-shadow:0 3px 8px rgba(0,0,0,0.2);
}

/* --- MAIN --- */
.main{
    padding:30px 20px;
    margin:auto;
    text-align:center;
    max-width: 100%;
}

.main h2{
    margin-bottom:25px;
    font-size:26px;
    color:#4682B4;
}

/* --- TABLE WRAPPER --- */
.tables-wrapper{
    display:flex;
    justify-content:center;
    gap:30px;
    flex-wrap:wrap;
    margin-bottom:40px;
}

.tables-wrapper h3 {
    margin-bottom: 12px;
    border-bottom: 1px solid #ccc;
    padding-bottom: 5px;
}

/* Table containers */
.table-container-league, .table-container-strelci {
    position: relative;
    min-width: 300px;
    max-width: 100%;       /* ne prelazi viewport */
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 8px 22px rgba(0,0,0,0.08);
    transition: 0.2s;
    overflow-x:auto;       /* scroll samo ako tabela šira od container-a */
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    border:1px solid #334155;
}

/* Transparent dark overlay preko slike */
.table-container-league{
    background-image: linear-gradient(rgba(15,23,42,0.7), rgba(15,23,42,0.7)), url('../pastazi-league-background.jpg');
    flex:3;
}

.table-container-strelci{
    background-image: linear-gradient(rgba(15,23,42,0.7), rgba(15,23,42,0.7)), url('../pastazi-strelci-background.jpg');
    flex:1;
}

/* --- TABLE --- */
table{
    width:100%;
    max-width:100%;      /* ne prelazi container */
    min-width:auto;      /* fleksibilno, ne pravi horizontal scroll */
    border-collapse:collapse;
    text-align:center;
    font-size:16px;
    background:transparent; /* uklanja belu pozadinu tabele */
}

th,td{
    padding:12px 8px;
    border-bottom:1px solid #e5e7eb;
    background:transparent; /* uklanja belu pozadinu ćelija */
}

th{
    background:#020617;
    color:#f0f0f0;
}

.short {
    display: none;
}

.club-cell {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Ćelije sa logom */
td.clubcell {
    display:flex;
    align-items: center;
    gap: 6px;
    padding: 12px 8px;
    box-sizing: border-box;
    line-height: 24px;
    background:transparent;
}

td.clubcell img, .club-cell img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    display: inline-block;
    vertical-align: middle;
}

table.league tr, table.strelci tr { height:48px; }
table.league td { color:#f0f0f0; }
table.strelci td { color:#f0f0f0; }

table.league td.gd-positive, .club-page .gd-positive {
    color: #28a745;
    font-weight: 700;
}

table.league td.gd-negative, .club-page .gd-negative {
    color: #ff4d4f;
    font-weight: 700;
}

.club-cell a {
    text-decoration: none;   /* skida underline */
    color: inherit;          /* uzima boju kao običan tekst */
    font-weight: inherit;    /* isti font kao ostatak */
}

.club-cell a:hover {
    text-decoration: none;   /* nema underline ni na hover */
    color: inherit;          /* nema promene boje */
}

tbody tr{ transition:background .35s ease; }
tbody tr:hover
{ 
    background:#60a5fa !important;
    color:#0f172a;
}

/* League table classes */
table.league tr.prolaz { 
    background-color: rgba(3, 138, 255, 0.25); /* tamnija, soft plava */
}
table.league tr.playoff { 
    background-color: rgba(8, 14, 175, 0.25); /* srednje tamna plava */
}
table.league tr.doigravanje { 
    background-color: rgba(0, 30, 96, 0.25); /* tamna plava */
    color: #e2e8f0;
}
table.league tr.ispad { 
    background-color: rgba(100, 100, 100,0.4); color: white;
    
}
table.league tr.greska {
    background-color: rgba(255,99,71,0.4);
    
}

/* --- MATCHES --- */
.match-date {
    font-size: 22px;
    font-weight: bold;
    color: var(--green);
    margin: 35px auto 12px auto; /* centriranje */
    padding-bottom: 6px;
    border-bottom: 1px solid #dbeafe;
    max-width: 700px; /* limitira širinu linije */
    text-align: center; /* centriranje teksta */
}

.match-card{
    display:flex;
    justify-content:center;
    margin:12px 0;
}

.match-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.match-card-inner{
    width:100%;
    max-width:650px;
    background:var(--light-blue);
    padding:12px 20px;
    border-radius:10px;
    border-left:4px solid var(--primary);
    border-right:4px solid var(--primary);
    box-shadow:0 8px 20px rgba(0,0,0,0.06);
    display:flex;
    align-items:center;
    justify-content:space-between;
    flex-wrap:wrap;
    transition:.2s;
}

.match-card-inner:hover{
    transform:translateY(-2px);
    box-shadow:0 12px 28px rgba(0,0,0,0.10);
    border-left:4px solid var(--primary-dark);
    border-right:4px solid var(--primary-dark);
}

/* Teams */
.team {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.team-left { justify-content: flex-end; text-align:right; padding-right:15px; width:40%; }
.team-right{ justify-content: flex-start; text-align:left; padding-left:15px; width:40%; }

.team-logo { width: 35px; height:35px; object-fit:contain; }
.winner { font-weight:700; color: var(--text-dark); }
.score{
    min-width:65px;
    text-align:center;
    font-weight:700;
    font-size:17px;
    background:linear-gradient(135deg,var(--primary),var(--primary-dark));
    color:white;
    padding:6px 14px;
    border-radius:20px;
    letter-spacing:1px;
    box-shadow:0 3px 8px rgba(0,0,0,0.15);
    transition:transform .15s ease, box-shadow .15s ease;
}
.score:hover{
    transform:scale(1.08);
    box-shadow:0 6px 14px rgba(0,0,0,0.2);
}

/* --- SEARCH --- */
.search-form{
    display:flex;
    justify-content:center;
    align-items:center;
    margin:20px 0;
    flex-wrap:wrap;
}

.search-form select,
.search-form input,
.search-form button{
    padding:10px 14px;
    font-size:16px;
    border:1px solid #ccc;
    height:42px;
}

.search-form select{ border-radius:6px 0 0 6px; border-right:none; background:var(--light-blue); }
.search-form input{ border-radius:6px 0 0 6px; width:220px; }
.search-form button{ border-radius:0 6px 6px 0; height:42px; padding:0 16px; background:var(--primary); color:white; border:1px solid var(--primary); cursor:pointer; }
.search-form button:hover{ background:var(--primary-dark); }

/* --- FOOTER --- */
footer{
    text-align:center;
    padding:20px;
    color:white;
    margin-top:40px;
    font-size:16px;
    background:#020617;
    border-top:1px solid rgba(255,255,255,0.05);
}

/* --- CONTACT --- */
.contact-page{
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:20px;
    padding:20px;
}
.contact-info{
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:12px;
    width:100%;
    max-width:500px;
    margin-bottom:30px;
}
.contact-item{
    display:flex;
    align-items:center;
    gap:10px;
    background:#1e293b;
    padding:10px 16px;
    border-radius:6px;
    font-size:16px;
    box-shadow:0 6px 16px rgba(0,0,0,0.08);
    transition:.2s;
    width:100%;
    max-width:400px;
    justify-content:center;
}
.contact-item i{ font-size:20px; color:var(--primary); }
.contact-item:hover{ transform:translateY(-2px); box-shadow:0 10px 22px rgba(0,0,0,0.12); }
.contact-item a {
    color: inherit;           /* koristi istu boju teksta kao parent */
    text-decoration: none;    /* uklanja podvlačenje */
    font-weight: 500;
    transition: color 0.3s;
}

.contact-item a:hover {
    color: #22c55e;           /* ista boja kao .main h2 ili zelena highlight */
}
.map-container{
    width:100%;
    max-width:800px;
    border-radius:8px;
    overflow:hidden;
    box-shadow:0 8px 20px rgba(0,0,0,0.1);
    margin-top:30px;
}

/* --- ISTORIJA.PHP --- */
.main-history {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    padding: 30px 20px;
    max-width: 95%;
    margin: auto;
    text-align: center;
}

.main-history h2 { 
    margin-bottom: 25px; 
    font-size: 26px; 
    color: #4682B4; 
}

/* --- WRAPPER ZA SVE KARTICE --- */
.history-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    padding: 20px;
    width:100%;
}

/* --- KARTICA --- */
.history-card {
    display: flex;
    flex-direction: column;
    align-items: center;   
    gap: 16px;
    padding: 20px;
    background: #1e293b;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    width: 100%;
    max-width:450px;
    flex: 1 1 350px;        /* responsive */
    transition:transform .15s ease, box-shadow .15s ease;
}

.history-card:hover {
    transform:translateY(-6px);
}

/* --- NASLOV SEZONE --- */
.season-title {
    font-weight: 600;
    color: #4682B4;
    font-size: 22px;
    margin-bottom: 12px;
    letter-spacing: 1px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.15);
    text-align: center;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(255,255,255,0.45);
}

/* --- PLACE WRAPPER --- */
.place-wrapper {
    display: flex;
    flex-direction: column; /* redovi jedan ispod drugog */
    align-items: center;
    gap: 15px;
}

/* --- JEDAN RED: medalja + klub --- */
.place-line {
    display: flex;
    align-items: center;       /* medalja i klub vertikalno centrirani */
    justify-content: flex-start;   /* centrirano u kartici */
    gap: 20px;
    width: 100%;
}

/* Medalja */
.medal {
    font-size: 36px;
    width: 50px;
    text-align: center;
    line-height: 36px;
}

/* Klub */
.club-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.club-logo {
    width: 36px;
    height: 36px;
}

.club-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.club-name {
    font-weight: 600;
    line-height: 36px; /* vertikalno poravnanje sa medaljom */
}

/* --- NAJBOLJI IGRAČI --- */
.best-players {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 16px;
    color: #f0f0f0;
    align-items: flex-start;
}

.best-player {
    display: flex;
    align-items: center;
    gap: 8px;
}

.best-player span.emoji {
    font-size: 20px;
}

.best-player span.label {
    color: #4682B4;
}

.best-player span.name {
    color: white;
}

/* Logo kluba najboljeg igrača */
.player-club-logo {
    width: 24px;
    height: 24px;
    margin-left: 6px;
    vertical-align: middle;
    border-radius: 4px;
}

/* --- KLUB.PHP --- */
.club-page {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: #0f172a;
    color: #e5e7eb;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

/* Naslov kluba */
.club-page h1 {
    font-size: 36px; /* px umesto em */
    margin-bottom: 15px;
    color: #60a5fa;
    text-align: center;
}

/* Logo */
.club-page img {
    width: 120px;
    height: auto;
    object-fit: contain;
    margin-bottom: 25px;
    border: 2px solid #334155;
    border-radius: 8px;
    background: #020617;
}

/* Sekcije */
.club-page h2 {
    font-size: 24px;
    margin-top: 30px;
    margin-bottom: 15px;
    color: #4682B4;
    text-align: center;
}

/* Lista statistike */
.club-page ul {
    list-style: none;
    padding: 20px;
    max-width: 400px;
    width: 100%;
    background: rgba(2,6,23,0.8);
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.5);
    margin-bottom: 30px;
}

.club-page ul li {
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-weight: 500;
    font-size: 16px;
}

.club-page ul li:last-child {
    border-bottom: none;
}

/* Tabela igrača */
.club-page table {
    width: 100%;
    max-width: 500px;
    border-collapse: collapse;
    background: rgba(2,6,23,0.8);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0,0,0,0.5);
    margin-bottom: 30px;
}

.club-page table th,
.club-page table td {
    padding: 12px 15px;
    text-align: left;
    color: #e5e7eb;
    font-size: 16px;
    border: none;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.club-page table th {
    background-color: #020617;
    font-weight: 600;
}

.club-page table tr:nth-child(even) {
    background-color: rgba(3, 138, 255, 0.1);
}

.club-page table tr:nth-child(odd) {
    background-color: rgba(0,0,0,0.2);
}

/* Poruka “nema podataka” */
.club-page p {
    font-style: italic;
    color: #cbd5f5;
    text-align: center;
    font-size: 16px;
}

/* Dugme nazad */
.club-page a {
    display: inline-block;
    text-decoration: none;
    background-color: #1e293b;
    color: #60a5fa;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 16px;
    transition: 0.3s;
}

.club-page a:hover {
    background-color: #334155;
    color: #ffffff;
    box-shadow: 0 3px 8px rgba(0,0,0,0.4);
}
/* ---- UTAKMICA.PHP ---- */
.match-page {
    background: #0f172a;
    min-height: 100vh;
    padding: 20px 0;
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: #e5e7eb;
}

.match-page .container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* HEADER */
.match-page .match-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 10px;
    flex-wrap: nowrap; /* NE dozvoljava prelazak u novi red */
}

.match-page .host-name,
.match-page .guest-name {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;           /* sakrije prelazak */
    white-space: nowrap;        /* ne dozvoljava wrap */
    text-overflow: ellipsis;    /* dodaje ... ako je predugačko */
}

/* Logo posle imena (host) */
.match-page .host-name img.team-logo {
    margin-left: 8px;
    flex-shrink: 0;
}

/* Logo pre imena (guest) */
.match-page .guest-name img.team-logo {
    margin-right: 8px;
    flex-shrink: 0;
}

/* Rezultat u sredini */
.match-page .match-score {
    flex: 0;
    min-width: 80px;
    text-align: center;
    color: #22c55e;
    white-space: nowrap;  /* sprečava wrap rezultata */
}

/* Logo dimenzije */
.match-page .team-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    vertical-align: middle;
}

/* Info */
.match-page .match-info {
    text-align: center;
    color: #9ca3af;
    margin-bottom: 10px;
}

.match-page .fouls {
    text-align: center;
    margin-bottom: 20px;
}

/* Golovi kartica */
.match-page .goals-card {
    background-color: #020617;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
}

.match-page .goals-card h3 {
    text-align: center;
    margin-bottom: 15px;
}

/* Timeline */
.match-page .timeline {
    margin-top: 10px;
}

.match-page .timeline-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #334155;
}

.match-page .tl-left {
    text-align: right;
    padding-right: 10px;
    word-break: break-word;
}

.match-page .tl-score {
    font-weight: bold;
    color: #22c55e;
    min-width: 60px;
    text-align: center;
}

.match-page .tl-right {
    text-align: left;
    padding-left: 10px;
    word-break: break-word;
}

.match-page .no-goals {
    text-align: center;
    color: #9ca3af;
}

/* Dugme nazad */
.match-page .back-container {
    text-align: center;
    margin-top: 20px;
}

.match-page .back-container a {
    display: inline-block;
    text-decoration: none;
    background-color: #1e293b;
    color: #60a5fa;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 16px;
    transition: 0.3s;
}

.match-page .back-container a:hover {
    background-color: #334155;
    color: #ffffff;
    box-shadow: 0 3px 8px rgba(0,0,0,0.4);
}

/* ---------- RESPONSIVE ---------- */
@media screen and (max-width: 600px) {

    /* Header ide vertikalno */
    .match-page .match-header {
        flex-direction: column;
        font-size: 20px;
        gap: 10px;
    }

    .match-page .host-name,
    .match-page .guest-name {
        justify-content: center;
    }

    .match-page .match-score {
        min-width: auto;
        font-size: 18px;
        margin: 5px 0;
    }

    /* Timeline - probaj da se ne lomi */
    .match-page .timeline-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 4px 0;
        border-bottom: 1px solid #334155;
    }

    .match-page .tl-left {
        text-align: left;
        flex: 1;
    }

    .match-page .tl-score {
        text-align: center;
        flex: 0;
        min-width: 50px;
    }

    .match-page .tl-right {
        text-align: right;
        flex: 1;
    }
    
    .match-page .host-name img.team-logo,
    .match-page .guest-name img.team-logo {
        width: 30px;   /* smanji logo */
        height: 30px;
    }
}

/* Responsive za mobilni - fino smanjeno */
@media screen and (max-width: 600px) {
    .club-page h1 { font-size: 32px; }      /* naslov kluba */
    .club-page h2 { font-size: 22px; }      /* podnaslovi */
    .club-page img { width: 120px; }        /* logo */
    .club-page ul li { padding: 12px 0; font-size: 16px; } /* statistika lista */
    .club-page table th, 
    .club-page table td { padding: 12px 10px; font-size: 16px; } /* tabela igrača */
    .club-page a { padding: 12px 24px; font-size: 16px; }       /* dugme nazad */
}
/* --- RESPONSIVE --- */
@media(max-width:1024px){ .tables-wrapper{ flex-direction:column; align-items:center; } }

@media(max-width:768px) {
    header h1{ font-size:24px; }
    nav a{ font-size:16px; padding:6px 12px; }
    .place-wrapper {
        flex-direction: column; /* svaki red medalja+klub jedan ispod drugog */
        gap: 12px;
    }

    .place-line {
        justify-content: flex-start; /* levo poravnanje medalja + klub */
        gap: 12px; /* razmak između medalje i kluba */
    }

    .medal {
        font-size: 32px; /* možeš prilagoditi za mobilni */
        width: 40px;
        line-height: 32px;
    }

    .club-name {
        font-size: 14px;
    }
    
    td:nth-child(2) {
        text-align: left;
        padding-left: 8px;
    }
    
    .main-history {
        padding: 15px 0px;
    }
    
    .history-card {
        gap: 12px;
        padding: 16px;
        border-radius: 8px;
        box-shadow: 0 4px 10px rgba(0,0,0,0.08);
        width: 100%;
        flex: 1 1 350px;        /* responsive */
        transition:transform .15s ease, box-shadow .15s ease;
    }
    
    .best-players {
        font-size:14px;
        gap: 4px;
    }
    
    .best-player span.emoji {
        font-size:14px;
    }
    
    .player-club-logo {
        width: 18px;
        height: 18px;
        margin-left: 4px;
        vertical-align: middle;
        border-radius: 2px;
    }
}

@media(max-width:768px) and (orientation: portrait) {
    table,th,td { font-size:14px; }
    
    .full {
        display: none;
    }
    .short {
        display: inline;
    }
    
    th:nth-child(4),
    th:nth-child(5),
    th:nth-child(6),
    th:nth-child(7),
    th:nth-child(8),
    td:nth-child(4),
    td:nth-child(5),
    td:nth-child(6),
    td:nth-child(7),
    td:nth-child(8) {
        display: none;
    }
}

@media (max-width: 768px) and (orientation: landscape) {
    table,th,td { font-size:12px; }
    .full { display: inline; }
    .short { display: none; }
    table th,
    table td {
        padding: 4px 6px;
    }
}

@media(max-width:600px){
    td.club-cell img {
        width: 24px;
        height: 24px;
    }

    td.club-cell{
        gap:8px;
        line-height: 20px;
        text-align: left;
    }
    
    table, th, td{
        font-size:13px;
    }

    th, td{
        padding:8px 4px;
        border-bottom:1px solid #e5e7eb;
    }
    
    table{
        border-collapse:collapse;
    }

    
    .table-container-league,
    .table-container-strelci{
        padding:5px;
    }
    
    header{
        padding:15px 10px;
    }

    .header-inner{
        gap:10px;
    }

    header h1{
        font-size:20px;
    }

    .main h2{
        font-size:20px;
    }
    
    .score{
        font-size:14px;
        padding:8px 10px;
    }

    .match-card-inner{
        padding:6px 6px;
        max-width:400px;
    }

    .team{
        font-size:14px;
    }
    
    nav{
        gap:10px;
    }

    nav a{
        font-size:14px;
        padding:6px 10px;
    }
}