/* Apply global box-sizing */
*, *::before, *::after {
    box-sizing: border-box;
}

/* ===== COOKIE CONSENT MODAL ===== */
.lb-cookie-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #f1faee;
    padding: 30px;
    box-shadow: 0 0 10px rgba(0,0,0,0.2);
    display: none;
    border-radius: 8px;
    text-align: center;
    min-width: 420px;
    max-width: 600px;
    z-index: 1000;
    overflow: auto;
}

/* Modal Content */
.lb-cookie-modal-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    width: 100%;
}

/* Heading Styling for Popups */
.lb-cookie-title {
    color: #457b9d !important;
    font-size: 26px;
    font-weight: bold;
    margin: 0;
    width: 100%;
    font-family: 'ethnocentric', sans-serif;
}

/* Subheading / Explanation Text */
.lb-cookie-text {
    color: #1d3557;
    font-size: 16px;
    font-weight: bold;
    margin: 0;
    line-height: 1.4;
    width: 100%;
}

/* Ensure links within popup text are colored correctly */
.lb-cookie-modal .lb-cookie-text a {
    color: #e63946;
    font-weight: bold;
    text-decoration: underline;
}

/* General Privacy Policy Link */
.lb-cookie-link {
    color: #457b9d;
    font-weight: bold;
    text-decoration: underline;
    margin-top: 5px;
    display: inline-block;
}
.lb-cookie-link:hover {
    color: #1d3557;
}

/* Footer Button (Manage Cookie Settings) */
.lb-footer-button {
    background: none !important;
    border: none !important;
    font-size: 16px !important;
    font-weight: bold !important;
    color: #a8dadc !important;
    cursor: pointer !important;
    text-decoration: none !important;
    display: inline-block !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
}
.lb-footer-button:hover {
    text-decoration: underline !important;
    color: #a8dadc !important;
}
.lb-footer-button:focus,
.lb-footer-button:active {
    outline: none !important;
    box-shadow: none !important;
}

/* Footer Banner */
.lb-cookie-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: black;
    color: white;
    text-align: center;
    padding: 2px 0 5px 0;  /* 2px top, 5px bottom */
    font-size: 14px;
    display: block;
}
.lb-cookie-footer p {
    margin: 0;
}
.lb-cookie-footer a {
    color: #00ffcc;
    text-decoration: none;
    font-weight: bold;
    display: inline-block;
    margin-right: 10px;
}
.lb-cookie-footer a:hover {
    text-decoration: underline;
}

/* Button Container */
.lb-cookie-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    width: 100%;
}
.lb-cookie-buttons button {
    flex: 1;
    min-width: 160px;
    max-width: 220px;
}

/* Accept Cookies Button */
#lb-accept-cookies {
    background-color: #457b9d;
    color: white;
    border: 2px solid #a8dadc;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 5px;
    transition: 0.3s ease;
}
#lb-accept-cookies:hover {
    background-color: #a8dadc;
    color: #1d3557;
}

/* Manage Cookie Settings Button (in initial modal) */
#lb-manage-cookies {
    background-color: #fdfdfc;
    color: black;
    border: 2px solid #1d3557;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 5px;
    transition: 0.3s ease;
}
#lb-manage-cookies:hover {
    background-color: #1d3557;
    color: white;
}

/* Save and Continue Button */
#lb-save-cookies {
    background: #222;
    color: white;
    padding: 12px 24px;
    border: none;
    cursor: pointer;
    border-radius: 5px;
    font-weight: bold;
    margin-top: 15px;
}
#lb-save-cookies:hover {
    background: #00ffcc;
    color: black;
}

/* ===== TOGGLE SWITCH STYLING ===== */
.lb-toggle-container {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
    vertical-align: middle;
}
.lb-toggle-container input {
    opacity: 0;
    width: 0;
    height: 0;
}
.lb-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 20px;
}
.lb-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}
.lb-toggle-container input:checked + .lb-slider {
    background-color: #457b9d;
}
.lb-toggle-container input:checked + .lb-slider:before {
    transform: translateX(20px);
}
.lb-slider {
    border-radius: 20px;
}
.lb-slider:before {
    border-radius: 50%;
}

/* Styling for toggle option labels in the detailed settings popup */
.lb-cookie-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 10px 0;
    color: #1d3557;
    font-size: 16px;
    gap: 20px;
}

/* ===== RESPONSIVE STYLES FOR MOBILE DEVICES (Portrait) ===== */
@media screen and (max-width: 768px) and (orientation: portrait) {
    .lb-cookie-modal {
        width: 95%;
        max-width: 95%;
        min-width: 0;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        max-height: 90vh;
        overflow-y: auto;
        padding: 15px;
    }
    .lb-cookie-modal-content {
        gap: 15px;
    }
    .lb-cookie-buttons {
        flex-direction: column;
        gap: 10px;
    }
    .lb-cookie-buttons button {
        min-width: 0;
        max-width: 100%;
        padding: 10px;
        font-size: 14px;
    }
    #lb-save-cookies {
        padding: 10px;
        font-size: 14px;
    }
}

/* ===== RESPONSIVE STYLES FOR MOBILE DEVICES (Landscape) ===== */
@media screen and (max-width: 768px) and (orientation: landscape) {
    /* Detailed Popup Adjustments (Manage Cookie Settings Popup) */
    #lb-cookie-modal {
        width: 80%;
        max-width: 80%;
        min-width: 0;
        top: 3%;
        left: 50%;
        transform: translateX(-50%);
        max-height: calc(100vh - 30px);
        overflow-y: auto;
        padding: 2px 5px 2px 5px;
    }
    #lb-cookie-modal .lb-cookie-modal-content {
        gap: 4px;
    }
    #lb-cookie-modal .lb-cookie-title {
        font-size: 16px;
        margin-top: 0;
        margin-bottom: 2px;
    }
    #lb-cookie-modal .lb-cookie-text {
        font-size: 10px;
        margin-top: 0;
        margin-bottom: 2px;
    }
    #lb-cookie-modal .lb-cookie-options {
        margin-bottom: 2px;
    }
    #lb-cookie-modal .lb-cookie-buttons {
        gap: 4px;
        margin-top: 2px;
    }
    #lb-cookie-modal .lb-cookie-buttons button {
        padding: 6px 12px;
        font-size: 10px;
    }
    #lb-cookie-modal #lb-save-cookies {
        padding: 10px 20px;
        font-size: 12px;
        margin-top: 2px;
    }
    
    /* Initial Popup Adjustments: Widen the initial popup and keep Manage Cookie Settings button at full size */
    #lb-initial-cookie-modal {
         width: 95%;
         max-width: 95%;
         transform: translate(-50%, -50%);
    }
    #lb-initial-cookie-modal #lb-manage-cookies {
         padding: 12px 24px;
         font-size: 16px;
         white-space: nowrap;
    }
}
