/* === Cookie Consent Modal === */
.cookie-consent-modal {
    position: fixed; /* fiksirano za viewport */
    bottom: 20px;
    right: calc((100vw - 1040px)/2 + 20px); /* 20px od desnog ruba .main */
    max-width: 420px;
    background: #fff;
    box-shadow: 0 0 12px rgba(0,0,0,0.45);
    border-radius: 8px;
    padding: 20px;
    font-family: Arial, sans-serif;
    color: #333;
    text-align: justify;
    animation: slideInUp 0.4s ease;
    z-index: 9999;
}

.modal-text {
    Font-size: 20px;
    font-weight: 600;
}

    .modal-text p {
        Font-size: 14px;
        font-weight: 400;
    }

@keyframes slideInUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Top Section */
.modal-top-section {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
    justify-content: center;
}

.modal-icon img {
    width: 48px;
    height: 48px;
    margin-right: 12px;
}

.modal-title {
    margin: 0 0 8px;
    font-size: 1.2rem;
    font-weight: 600;
}

.modal-description {
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Bottom Section */
.modal-bottom-section {
    display: flex;
    flex-direction: row;
    justify-content: center;
    text-align: center;
    flex-wrap: wrap;
}

.manage-link {
    font-size: 15px;
    color: #009245;
    text-decoration: none;
}

    .manage-link:hover {
        text-decoration: underline;
    }

.modal-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.btn-accept-modal {
    background-color: #009245;
    border: none;
    color: #fff;
    padding: 6px 12px;
    border-radius: 4px;
}

 .btn-accept-modal:hover {
     background-color: #015426; /* Slightly darker on hover */
     border-color: #007d38;
     color: #fff;
 }

 .btn-reject-modal {
     background-color: #ccc;
     border: none;
     color: #333;
     padding: 6px 12px;
     border-radius: 4px;
 }

/* === Preferences Modal === */
.cookie-modal-overlay {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    overflow: auto; /* scroll if modal is taller than viewport */
    padding: 10px;
}

/* === Preferences Modal Content === */
.cookie-modal {
    background: #fff;
    width: 90%;
    max-width: 800px;
    max-height: 100%; /* modal never exceeds 90% of viewport height */
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0px 0px 12px rgba(0,0,0,0.45);
    overflow-y: auto; /* scrollable if content exceeds max-height */
    animation: fadeIn 0.3s ease;
    box-sizing: border-box;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header h3 {
    margin: 0 0 10px;
}

.modal-header a {
    color: #009245;
}

.modal-body {
    margin-top: 10px;
}

.cookie-category {
    border-bottom: 1px solid #eee;
    padding: 10px 0;
}

.category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.always-active {
    font-size: 15px;
    color: #999;
    margin-left: 10px;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 40px;
    height: 20px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    border-radius: 20px;
    transition: 0.3s;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    border-radius: 50%;
    transition: 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #009245;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.modal-footer {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-top: 15px;
    border: none;
}

.cookies-policy-link {
    font-size: 15px;
    color: #009245;
}

.footer-buttons .btn {
    margin-left: 10px;
}

.footer-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
}

.footer-buttons .btn {
    padding: 10px 22px;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    border: 2px solid #009245;
    background-color: transparent;
    color: #009245;
}

 .footer-buttons .btn:hover {
     background-color: #009245;
     color: #fff;
 }

.footer-buttons .btn-cancel {
    background-color: transparent;
    color: #009245;
}

.footer-buttons .btn-save {
    background-color: #009245;
    color: #fff;
}

 .footer-buttons .btn-save:hover {
     background-color: #015426; /* Slightly darker on hover */
     border-color: #007d38;
 }

/* === Responsive Styles === */

/* TABLETI (max 992px) */
@media (max-width: 992px) {

    /*.cookie-consent-modal {
        right: 10px;
        left: 10px;
        bottom: 10px;
        max-width: 100%;
        padding: 16px;
        font-size: 15px;
    }*/

    .modal-text {
        font-size: 18px;
    }

        .modal-text p {
            font-size: 13px;
        }

    .modal-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .btn-accept-modal,
    .btn-reject-modal {
        width: 100%;
        padding: 10px;
        font-size: 14px;
    }

    .cookie-modal {
        width: 95%;
        max-width: 600px;
        padding: 20px;
    }

    .modal-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .footer-buttons {
        width: 100%;
        justify-content: flex-end;
        flex-wrap: wrap;
    }

        .footer-buttons .btn {
            width: auto;
            min-width: 120px;
            font-size: 14px;
        }
}

/* MOBITELI (max 600px) */
@media (max-width: 600px) {

   /* .cookie-consent-modal {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        max-width: none;
        border-radius: 8px;
        padding: 15px;
        box-shadow: 0px 0px 12px rgba(0,0,0,0.45);
        text-align: left;
        margin: 10%;
    }*/

    .modal-top-section {
        flex-direction: column;
        align-items: flex-start;
    }

    .modal-text {
        font-size: 16px;
    }

        .modal-text p {
            font-size: 13px;
        }

    .modal-actions {
        flex-direction: column;
        gap: 8px;
        margin-top: 12px;
    }

    .btn-accept-modal,
    .btn-reject-modal {
        width: 100%;
        font-size: 14px;
        padding: 10px;
    }

    .cookie-modal {
        width: 100%;
        height: 100%;
        max-width: none;
        max-height: none;
        border-radius: 0;
        padding: 20px 15px;
        overflow-y: auto;
        margin: 5%;
    }

    .modal-footer {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .cookies-policy-link {
        font-size: 14px;
        text-align: center;
    }

    .footer-buttons {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

        .footer-buttons .btn {
            width: 100%;
            font-size: 14px;
            padding: 10px;
        }
}


/* === SMALL LAPTOPS / TABLETS LANDSCAPE (1024x600 and similar) === */
@media (max-width: 1200px) and (min-width: 992px) {

    /* Adjust cookie consent modal position and size */
    .cookie-consent-modal {
        right: calc((100vw - 1040px) / 2 + 50px);
    }

    .modal-text {
        font-size: 18px;
    }

        .modal-text p {
            font-size: 14px;
        }

    .modal-actions {
        flex-direction: row;
        justify-content: center;
        gap: 10px;
    }

    .btn-accept-modal,
    .btn-reject-modal {
        padding: 8px 14px;
        font-size: 14px;
    }

    /* Preferences modal */
    .cookie-modal {
        width: 85%;
        max-width: 700px;
        padding: 22px;
    }

    .modal-header h3 {
        font-size: 20px;
    }

    .cookie-category h4 {
        font-size: 16px;
    }

    .cookie-category p {
        font-size: 14px;
    }

    .footer-buttons {
        justify-content: flex-end;
        flex-wrap: wrap;
        gap: 10px;
    }

        .footer-buttons .btn {
            font-size: 14px;
            padding: 8px 18px;
        }
}
@media (max-width: 1024px) {
    .cookie-modal {
        max-height: 85vh;
        width: 95%;
        padding: 20px;
    }
}

@media (max-width: 600px) {
    .cookie-modal {
        max-height: 100vh;
        width: 100%;
        padding: 15px;
        border-radius: 8px;
    }
}

@media (max-width: 992px) and (min-width: 769px) {

    /* Adjust cookie consent modal position and size */
    .cookie-consent-modal {
        right: calc((100vw - 1040px) / 2 + 160px);
    }
}

@media (max-width: 769px) {

    /* Adjust cookie consent modal position and size */
    .cookie-consent-modal {
        left: 0;
        right: 0;
        max-width: none;
        bottom: 10px;
        margin: 0 10px;
    }
}