/* Global Styles */
@font-face {
    font-family: 'YekanBakhFaNum';
    src: url('/assets/YekanBakhFaNum-Regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    direction: rtl;
    overflow: hidden;
    /* Prevent body from scrolling */
}

html,
body {
    overflow: hidden;
    touch-action: none;
    /* Disable all touch actions, including pinch-to-zoom */
    -ms-touch-action: none;
    /* For older IE versions */
    -webkit-user-select: none;
    /* Prevent text selection on touch devices */
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    /* Disable the default callout for links and images */
    -webkit-text-size-adjust: 100%;
    /* Prevent auto-adjustment of text size */
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* Hide scrollbars for all elements */
* {
    scrollbar-width: none;
    /* For Firefox */
    -ms-overflow-style: none;
    /* For Internet Explorer and Edge */
}

/* Hide scrollbars for WebKit browsers (Chrome, Safari) */
*::-webkit-scrollbar {
    display: none;
}

button {
    -webkit-appearance: none; /* Remove default iOS styles */
    appearance: none; /* For cross-browser support */
    color: inherit; /* Use the inherited text color */
    background-color: inherit; /* Ensure background color doesn't change */
    border: none; /* Remove any default borders */
  }
  
.settings-container {
    padding-top: 20px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    width: 90%;
    max-width: 1200px;
    height: 70%;
    overflow: hidden;
    top: 35%;
    background-color: transparent;
}

.scrollable-wrapper {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    /* Allow vertical scrolling inside this wrapper */
    overflow-x: hidden;
    /* Prevent horizontal scrolling */
    padding-top: 20px;
    padding-bottom: 50px;
    /* Optional padding */
    box-sizing: border-box;
    /* Ensure padding doesn't affect width */
    background-color: transparent;
}

.settings-item {
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 20px;
	position: relative;
}

.settings-button {
    font-family: 'YekanBakhFaNum', sans-serif;
    font-weight: bold;
    text-align: center;
    font-size: 12pt;
    width: 80%;
    color: black;
    background-color: #d2d2d2;
    border-radius: 50px;
    overflow: hidden;
    height: 45px;
    padding: 5px;
    border: none;
    box-sizing: border-box;
    box-shadow: 0 20px 30px rgba(0, 0, 0, 0.5);
    position: relative;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center center;
}

.settings-button:hover {
    transform: scale(1.05);
}

.button-image {
    position: absolute;
    left: 5px;
    top: -20px;
    width: 65px;
    height: 65px;
    z-index: 1;
    flex-shrink: 0;
}

img,
button {
    -webkit-tap-highlight-color: transparent;
}

#contactsImage,
#relayImage,
#remoteImage,
#zoneImage,
#guaranteeImage,
#additionalImage {
    width: 100px;
    height: 100px;
    display: none;
    z-index: 1010;
    position: absolute;
    top: -60px;
    right: -5px;
    cursor: pointer;
}

/* Modal styling */
.modal {
    display: none;
    /* Hide modals by default */
    position: fixed;
    /* Use fixed to cover the entire viewport */
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    backdrop-filter: blur(10px); /* Applies the blur effect */
    -webkit-backdrop-filter: blur(10px); /* Ensures compatibility with iOS Safari */
    background-color: rgba(0, 0, 0, 0.5); /* Fallback for older browsers */
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

.elementsWrapper {
    background-color: transparent;
    width: 100%;
    display: flex;
    height: auto;
    justify-content: center;
    align-items: center;
    position: relative;
    /* Set relative positioning to contain the absolute positioning of child elements */
}

.modal-content {
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
    /* margin-top: 40px; */
    /* margin-bottom: 20px; */
    margin-left: 20px;
    margin-right: 20px;
    background-color: rgb(211, 211, 211);
    border-radius: 36px;
    padding: 0px;
    border: none;
    width: 88%;
    overflow-x: hidden;
    position: relative;
    overflow-y: auto;
}

.relay {
    height: 560px;
}

.number {
    height: 90vh;
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
    margin-left: 10px;
    margin-right: 10px;
    background-color: rgb(211, 211, 211);
    border-radius: 36px;
    padding: 0px;
    border: none;
    width: 100%;
    overflow-x: hidden;
    position: relative;
    overflow-y: auto;
}

.remote {
    height: 500px;
}

.guarantee {
    height: 330px;
}

.additional {
    height: 500px;
}

.zone {
    transition: height 0.5s ease;
    height: 550px;
}

.close {
    top: -30px;
    left: 15px;
    position: absolute;
    font-size: 28px;
    color: white;
    font-weight: bold;
    z-index: 1001;
    cursor: pointer;
}

iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Position the close buttons off-screen */
.close-off-screen {
    position: fixed;
    top: -100px;
    right: -100px;
    transition: top 0.3s, right 0.3s;
}

/* Additional CSS for fading and moving the close button */
.close-original {
    position: absolute;
    top: 10px;
    right: 10px;
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
}

.close-fading {
    opacity: 0;
}

.close-off-screen {
    opacity: 0;
    transform: translateX(100vw);
}

@media screen and (orientation: landscape) {
    .settings-container {
        padding-top: 0%;
        text-align: center;
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        width: 98%;
        /* max-width: 1200px; */
        height: 100%;
        overflow: hidden;
        top: 0%;
        background-color: transparent;
    }

    .scrollable-wrapper {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(2, 1fr);
        gap: 10px;
        justify-items: center;
        align-items: center;
        width: 100%;
        max-width: 1200px;
        margin: auto;
        padding: 20px 0;
    }

    .elementsWrapper {
        background-color: transparent;
        width: auto;
        display: flex;
        height: auto;
        justify-content: center;
        align-items: center;
        position: relative;
        margin-top: 5%;
        margin-bottom: 5%;
    }

    .modal-content {
        margin-top: 5px;
        margin-bottom: 5px;
        margin-left: 0px;
        margin-right: 0px;
    }

    .settings-item {
        margin-bottom: 0;
        width: 90%;
        display: flex;
        justify-content: center;
        height: 60px;
        align-items: center;
    }

    #contactsImage,
    #relayImage,
    #remoteImage,
    #zoneImage,
    #guaranteeImage,
    #additionalImage {
        width: 70px;
        height: 70px;
        display: none;
        z-index: 1010;
        position: absolute;
        top: -20px;
        right: -25px;
        /* cursor: pointer; */
    }

    .close {
        z-index: 1010;
        top: -10px;
        left: -5px;
        font-size: 28px;
    }

    .relay,
    .zone,
    .additional,
    .remote,
    .number,
    .guarantee {
        width: 400px;
        max-height: 90%;
        height: 300px;
    }

    .settings-button {
        font-family: 'YekanBakhFaNum', sans-serif;
        font-weight: bold;
        text-align: center;
        font-size: 12pt;
        width: 90%;
        color: black;
        background-color: #d2d2d2;
        border-radius: 50px;
        overflow: hidden;
        height: 80px;
        padding: 5px;
        border: none;
        box-sizing: border-box;
        box-shadow: 0 20px 30px rgba(0, 0, 0, 0.5);
        position: relative;
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center center;
    }

    .button-image {
        position: absolute;
        left: -10px;
        top: -34px;
        width: 65px;
        height: 65px;
        z-index: 1;
        flex-shrink: 0;
    }
}

/* Disable zooming */
html,
body {
    touch-action: manipulation;
    -ms-touch-action: manipulation;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
}