/* GLOBALNI STILOVI */
html, body { 
    font-family: Arial, sans-serif;
}
 
/* --- */

/* GLOBALNI STILOVI I POZADINA (Provjerite da je ovaj blok i dalje ovako postavljen) */
body {
    background-color: #f4f4f4;
    display: flex; /* KRITIČNO ZA CENTRIRANJE FORME */
    min-height: 100vh; 
    justify-content: center; 
    align-items: center; 
    padding: 20px 0; 
    margin: 0;
}

/* --- */

/* CENTRIRANI KONTEJNER FORME */
.form-wrapper {
    background-color: #ffffff;
    padding: 30px 40px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 500px;
    box-sizing: border-box;
    /* DODATNO: Osigurajte da je centriran u mobilnom režimu */
    margin: auto; 
}

/* STILIZIRANJE NASLOVA */
h3 {
    text-align: center;
    color: #333;
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
    margin-bottom: 30px;
}

/* --- */ 
/* STILOVI ZA NAVIGACIJU NA VRHU */
.nav-top {
position: absolute; /* Ostavite ABSOLUTE za navigaciju na VRHU stranice */
    top: 20px;
    left: 20px;
    z-index: 100;
    
    /* KRITICNO: Za 4-reservations.php da ne bude skroz u lijevom kutu */
    
    padding-bottom: 15px;
}
/* KRITICNO: Ispravlja plutanje za 4-reservations.php */
.nav-top .back-link {
    display: inline-block;
    float: none; 
    margin-left: 10px;
}


.back-link {
    display: inline-block;
    padding: 10px 15px;
    background-color: rgba(255, 255, 255, 0.9);
    color: #007bff;
    text-decoration: none;
    border: 1px solid #007bff;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s;
}

.back-link:hover {
    background-color: #007bff;
    color: white;
}

/* STILOVI ZA ELEMENTE FORME UNUTAR #resForm */
#resForm label {
    display: block;
    margin-top: 15px;
    font-weight: bold;
    color: #555;
}

#resForm input[type="text"],
#resForm input[type="email"],
#resForm input[type="date"],
#resForm select {
    width: 100%;
    padding: 10px;
    margin-top: 5px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box; 
}

#resForm input[type="submit"] {
    width: 100%;
    padding: 15px;
    margin-top: 30px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1.1em;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#resForm input[type="submit"]:hover {
    background-color: #0056b3;
}

/* Stil za kontejner u kojem je AI ikona */
.ai-asistent-container {
    position: fixed;
    bottom: 40px;
    right: 110px; /* Postavljeno lijevo od WhatsApp ikonice */
    z-index: 999999;
    display: flex;
    align-items: center;
}

/* Stil za natpis (Tooltip) */
.ai-tooltip {
    position: absolute;
    right: 70px;
    background-color: #333;
    color: #fff;
    padding: 8px 15px;
    border-radius: 5px;
    font-size: 14px;
    white-space: nowrap;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
    pointer-events: none;
}

/* Trougao koji pokazuje prema ikoni */
.ai-tooltip::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 100%;
    margin-top: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: transparent transparent transparent #333;
}

/* Prikazivanje na mouse-over */
.ai-asistent-container:hover .ai-tooltip {
    visibility: visible;
    opacity: 1;
}

/* --- STILOVI ZA PORUKE (OK/ERROR) --- */

.msg-ok { /* Naziv klase je ispravljen iz .ok u .msg-ok da odgovara PHP kodu */
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
    font-weight: bold;
    background-color: #d4edda; 
    color: #155724;
    border: 1px solid #c3e6cb;
}

.msg-err { /* Naziv klase je ispravljen iz .err u .msg-err da odgovara PHP kodu */
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
    font-weight: bold;
    background-color: #f8d7da; 
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.msg-err ul {
    margin: 10px 0 0 20px;
    padding: 0;
}
 
/* ==================================== */
/* (RESPONSIVE DIZAJN ZA MOBILNE UREĐAJE) */
/* ==================================== */

@media only screen and (max-width: 550px) {
    
    /* 1. Resetiranje tijela */
    body {
        display: block !important; 
        padding: 0 !important; 
        margin: 0 !important;
        min-height: 100%; 
        overflow-x: hidden !important; /* Sprječava skrolanje */
    }

    /* 2. Prilagodba omotača forme */
    .form-wrapper {
        padding: 20px 15px !important; 
        margin: 0 !important;
        width: 100% !important; 
        max-width: 100% !important;
        box-shadow: none !important;
        box-sizing: border-box !important; 
    }
    
    /* 3. Prilagodba navigacije na mobilnom */
    .nav-top {
        position: relative; /* Vraćamo na normalan tok */
        top: auto;
        left: auto;
        padding: 15px;
        text-align: center;
        width: 100%;
        box-sizing: border-box;
    }
    .nav-top .back-link {
        float: none;
        margin: 5px;
    }
    
    /* 4. Rješavanje Flatpickr-a */
    .flatpickr-calendar {
        max-width: 95vw !important; 
        box-sizing: border-box !important;
    }
    
    /* 5. Osigurajte da input polja ne probijaju padding forme */
    #resForm input[type="text"],
    #resForm input[type="email"],
    #resForm input[type="date"],
    #resForm select {
        width: 100% !important; 
        box-sizing: border-box !important;
    }
}

/* ==================================== */
/* (STILOVI SAMO ZA ISPIS - APSOLUTNI RESET) */
/* ==================================== */

@media print {
    
    /* 1. SAKRIJ SVE KONTROLNE ELEMENTE */
    .nav-top, 
    .back-link, 
    .print-button, 
    #action-message,
    .report-header h1,
    /* Dodajemo skrivanje svih gumba (ako ih nismo ranije uhvatili) */
    .button-action {
        display: none !important;
    }

    /* 2. OSNOVNO TIJELO */
    body {
        padding: 0 !important;
        margin: 0 !important;
        display: block !important; 
        background-color: #fff !important;
        width: 100% !important;
        min-width: 0 !important;
    }
    
    /* 3. APSOLUTNO FORSIRANJE TABELARNOG PRIKAZA */
.report-table {
    width: 100% !important;
    max-width: none !important; 
    margin: 0 !important;
    border-collapse: collapse !important;
    font-size: 8pt !important; /* Ostavimo manji font za ispis */
    box-shadow: none !important;
    /* KRITIČNO: Vratite fixed */
    table-layout: fixed !important; 
}
    
    /* Forsiranje standardne strukture tablice za SVE elemente */
    .report-table, 
    .report-table tbody, 
    .report-table thead, 
    .report-table tr {
        display: table !important;
        border: none !important; 
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .report-table thead {
        display: table-header-group !important;
    }

    /* Forsiranje ponašanja ćelije na TH i TD */
    .report-table th, .report-table td {
        display: table-cell !important;
        border: 1px solid #000 !important; 
        padding: 4px 6px !important; 
        text-align: left !important;
        vertical-align: top !important;
    }
    
    /* UKLANJANJE MOBILNIH STILOVA */
    .report-table td::before {
        content: none !important; 
        display: none !important;
    }
    
    /* Resetiranje paddinga i poravnanja */
    .report-table td {
        padding-left: 6px !important;
        text-align: left !important;
    }

    /* SPECIFIČNO CILJANJE AKCIJA I STATUSA */
    .report-table th.res-actions,
    .report-table td.action-cell {
        /* I dalje se ne smije previše stisnuti, ali sada je display: none */
        display: table-cell !important; 
        width: 150px !important;
        min-width: 120px !important;
        text-align: center !important;
        
    } 
/* SPECIFIČNE ŠIRINE ZA SVE KOLONE (Primijenjeno na TH i TD) */
/* OVO JE KLJUČNO ZA table-layout: fixed; */

/* 1. ID */
.report-table th:nth-child(1),
.report-table td:nth-child(1) { width: 30px !important; }

/* 2. Datum 1, 3. Datum 2 */
.report-table th:nth-child(2),
.report-table td:nth-child(2),
.report-table th:nth-child(3),
.report-table td:nth-child(3) { width: 75px !important; }

/* 4. Slot (Vrijeme) */
.report-table th:nth-child(4),
.report-table td:nth-child(4) { width: 100px !important; }

/* 5. Ime (Malo šire) */
.report-table th:nth-child(5),
.report-table td:nth-child(5) { width: 100px !important; }

/* 6. Email (Široka kolona) */
.report-table th:nth-child(6),
.report-table td:nth-child(6) { width: 140px !important; }

/* 7. Telefon */
.report-table th:nth-child(7),
.report-table td:nth-child(7) { width: 80px !important; }

/* 8. Napomene (Maksimalno šire) */
.report-table th:nth-child(8),
.report-table td:nth-child(8) { width: 150px !important; } 

/* 9. Osobe, 10. Djeca */
.report-table th:nth-child(9),
.report-table td:nth-child(9),
.report-table th:nth-child(10),
.report-table td:nth-child(10) { width: 60px !important; }

/* 11. Status */
.report-table th:nth-child(11),
.report-table td:nth-child(11) { width: 60px !important; }

/* 12. Akcije */
.report-table th:nth-child(12),
.report-table td:nth-child(12) { 
    width: 100px !important; 
    text-align: center !important;
}

/* Osigurajte da se dugi tekst u ćelijama lomi, a ne da prelije (za TH i TD) */
.report-table th, .report-table td {
    word-wrap: break-word;
    word-break: break-all;
}
    
}




