/* 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;
}

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%;
}


body {
    margin: 0;
    padding: 0;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    font-family: 'YekanBakhFaNum', sans-serif;
    /* Apply the font to the body */
    direction: rtl;
    /* Set the text direction to right-to-left */
    font-size: 12pt;
    touch-action: none;
    /* Prevent all touch interactions */
    -ms-touch-action: none;
    /* For older IE versions */
    /* Global font size */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 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;
}

p {
    font-size: 14pt;
    color: white;
    font-family: 'YekanBakhFaNum', sans-serif;
}

h2 {
    font-weight: bold;
    font-size: 14pt;
    color: white;
    font-family: 'YekanBakhFaNum', sans-serif;
}

.value span {
    color: #9c9c9c;
}

.device-info div {
    display: flex;
    font-size: inherit;
    text-align: right;
    align-items: center;
    justify-content: center;
}

.main-screen-background {
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center center;
    background-attachment: fixed;
    background-image: url('assets/bg.svg');
}

.device-info {
    display: flex;
    /* justify-content: space-between; */
    align-items: center;
    /* width: 100%; */
    flex-direction: column-reverse;
}

.remove-device {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 30px;
    height: 30px;
    background-color: transparent;
    border: none;
    color: red;
    font-size: 30px;
    cursor: pointer;
    margin-left: 10px; /* Move the button closer to the left */
}

.remove-device:disabled {
    color: gray;
    cursor: not-allowed;
}

.device-text > div {
    text-align: right; /* Make sure each div is aligned right */
}

.value {
    direction: rtl; /* Ensure left-to-right for the phone number */
    margin-right: 10px;
}

.modal {
    display: flex;
    /* Enables Flexbox to center content */
    position: fixed;
    top: 0;
    left: 0;
    justify-content: center;
    /* Centers horizontally */
    align-items: center;
    /* Centers vertically */
    width: 100%;
    height: 100%;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center center;
    background-attachment: fixed;
    z-index: 1000;
    background-image: url('assets/initial-bg.svg');
}

.popup-content {
    position: relative;
    /* Ensures absolute children are positioned relative to this container */
    display: flex;
    flex-direction: column;
    /* Keeps items in a column layout */
    align-items: center;
    justify-content: center;
    width: 86%;
    height: 200px;
    padding: 20px;
    /* Adds some padding for spacing */
    background-color: #707d7f;
    /* Sets background color */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    /* Adds shadow */
    border-radius: 36px;
    /* Rounds the corners */
}

.list-content {
    width: 100%;
    min-height: 200px; /* Minimum height of 200px */
    max-height: 90vh; /* Maximum height of 90% of the viewport height */
    height: auto; /* Allow height to grow based on content */
    display: flex;
    flex-direction: column;
}

.device-list {
    max-height: 100%; /* Take up the full height of the parent */
    height: auto; /* Grow with content */
    width: 100%;
    overflow-y: auto; /* Allow vertical scrolling if overflow occurs */
    scroll-behavior: smooth;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    min-height: fit-content; /* Adjust based on content */
}

.device-list li {
	font-family: 'YekanBakhFaNum', sans-serif;
	text-align: start;
	font-weight: bold;
	font-size: 12pt;
	width: 100%;
	/* height: 50px; */
	background-color: #d2d2d2;
	border-radius: 50px;
	overflow: hidden;
	height: auto;
	border: none;
	box-sizing: border-box;
	box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
	position: relative;
	background-size: contain;
	background-repeat: no-repeat;
	background-position: center center;
	margin-top: 8px;
	margin-bottom: 8px;
	display: flex;
	justify-content: center;
	align-items: center;
	padding-top: 10px;
	padding-bottom: 10px;
	padding-left: 20px;
	padding-right: 20px;
	display: grid;
	/* flex-wrap: wrap; */
	/* align-items: center; */
	justify-content: center;
}

.halfPopup {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 88%;
    height: 340px;
    padding: 20px;
    background-color: #707d7f;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-radius: 36px;
}

.wiredZones p,
.wirelessZones p {
    text-align: center;
    margin-bottom: 5px;
}

.wiredZones,
.wirelessZones,
.g1,
.g2 {
    width: 96%;
}

.g1,
.g2 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 5px;
}

/* Style for labels in checkbox container */
.relay-label {
    /* Prevent label text from wrapping */
    color: rgb(156, 156, 156);
    /* Set text color to rgb(156, 156, 156) */
    font-weight: bold;
}

.blue-dot {
    position: absolute;
    top: 0;
    right: 0;
    transform: translate(45%, -45%);
    width: 100px;
    height: 100px;
}

.input-container {
    display: flex;
    flex-direction: column;
    /* Ensure content flows vertically */
    align-items: center;
    /* Center items horizontally */
    width: 100%;
    /* Make the input container take the full width */
    gap: 10px;
}

.textInput {
    box-sizing: border-box;
    width: 100%;
    height: 5vh;
    font-size: 16pt;
    color: #8ca0a4;
    background-color: rgb(196, 210, 213);
    text-align: center;
    background-size: cover;
    border-radius: 48px;
    -webkit-tap-highlight-color: transparent;
    display: block;
    margin: 0 auto;
    font-family: 'YekanBakhFaNum', sans-serif;
    border: none;
    /* Remove the border */
}

.textInput:focus {
    border: none;
    /* Remove the border when focused */
    outline: none;
    /* Remove the default outline */
}

.popup_buttons {
    width: 120px;
    height: 40px;
    border-radius: 48px;
    margin: 5px 0;
    -webkit-tap-highlight-color: transparent;
    background-color: #c5d2d5;
    font-family: 'YekanBakhFaNum', sans-serif;
    font-size: 12pt;
    font-weight: bold;
    color: black;
}

.buttons-container {
    width: 100%;
    display: flex;
    gap: 10px;
    /* Space between buttons */
    justify-content: space-around;
}

#nameCancel,
#phoneCancel {
    display: none;
}

#imgSound {
    width: 70px !important;
    height: 70px !important;
    display: block !important;
    margin: auto !important;
}

#mainScreen {
    display: none;
    position: relative;
    width: 100%;
    height: 100vh;
}

.top-left,
.top-right,
.bottom-right {
    position: absolute;
}

.top-left {
    top: -5px;
    left: 0px;
}

.top-right {
    top: -5px;
    right: 0px;
}

.bottom-right {
    bottom: 10px;
    right: 10px;
}

.center-buttons,
.lock-icons {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    gap: 20px;
}

#statMessage {
    width: 80vw;
    height: auto;
}

.responsive-img {
    width: 30vw;
    height: auto;
}

.small-button {
	position: absolute;
	top: 52%;
	left: 50%;
	transform: translate(-50%, -50%);
	text-align: center;
	margin-bottom: 20px;
	display: flex;
	align-items: center;
	justify-content: center;
	background-color: #d2d2d2;
	border-radius: 50%;
	overflow: hidden;
	width: 40px;
	height: 40px;
	padding: 5px;
	box-sizing: border-box;
	box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}
.small-button input[type="image"] {
	display: block;
	width: 20px;
	height: auto;
	border: none;
	padding: 0;
	margin: 0;
}

/* Swapped devices-container and addDevice positions */
.devices-container {
	width: 100%;
	display: flex;
	height: auto;
	position: absolute;
	top: calc(50% + 30px + 60px);
	left: 50%;
	transform: translateX(-50%);
	justify-content: center;
}

.add-device {
	position: absolute;
	left: 19%;
	top: 50%;
	transform: translate(-50%, -50%);
	text-align: center;
	display: flex;
	align-items: center;
	justify-content: center;
	background-color: #d2d2d2;
	border-radius: 50%;
	overflow: hidden;
	width: 45px;
	height: 45px;
	padding: 5px;
	box-sizing: border-box;
	box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}

.add-device input[type="image"] {
    display: flex;
    height: auto;
    border: none;
    padding: 40px;
    margin: 0;
    width: 100px;
    height: 100px;
    position: relative;
    object-fit: scale-down;
}

.devices {
	left: 38%;
	text-align: center;
	display: flex;
	background-color: #d2d2d2;
	border-radius: 50px;
	overflow: hidden;
	width: 60%;
	height: 45px;
	padding: 5px;
	box-sizing: border-box;
	box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
	position: relative;
	transform: translateX(-50%);
	align-items: center;
	flex-wrap: nowrap;
	cursor: pointer;
}

.devices input[type="image"] {
    width: 30px;
    /* Set a fixed width for the image */
    height: 30px;
    /* Set a fixed height for the image */
    border: none;
    margin-right: 3px;
    margin-left: auto;
    /* Ensure the image stays on the right side */
    object-fit: contain;
    /* Make sure the image scales properly */
}

.devices .hover-text {
    margin-right: 10px;
    /* Add spacing between the text and the image */
    white-space: nowrap;
    /* Prevent the text from wrapping */
    text-align: left;
    /* Align text to the left */
    flex-grow: 1;
    /* Allow text to take up available space */
    font-family: 'YekanBakhFaNum', sans-serif;
    tab-size: 16pt;
}



/* Hover text styling */
.hover-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12pt;
    pointer-events: none;
    text-align: center;
}

.center-buttons,
.lock-icons {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    gap: 10%;
    /* Set a 10% gap between the buttons */
}

.lock-icons {
    width: 100%;
    height: auto;
    display: flex;
    justify-content: center;
    top: 40%;
}

.enable-Device,
.disable-Device {
    width: 30vw;
    height: 30vw;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #d2d2d2;
    border-radius: 50%;
    overflow: hidden;
    box-sizing: border-box;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}

/* The individual button styling remains unchanged */
#enableDevice,
#disableDevice {
    width: 20vw;
    height: auto;
    padding: 5px;
    -webkit-tap-highlight-color: transparent;
}


button {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
}

button img {
    display: block;
    width: 100px;
    height: 100px;
    object-fit: cover;
}

input {
    -webkit-tap-highlight-color: transparent;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: transparent;
    overflow: hidden;
    touch-action: none;
    /* Prevent touch interactions in modal */
    -ms-touch-action: none;
    /* For older IE versions */
}

.modal-content {
    position: relative;
    background-image: url('/assets/settings-bg.svg');
    background-size: cover;
    background-position: center;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    color: transparent;
    border-radius: 20px;
    touch-action: none;
    /* Prevent touch interactions inside modal */
    -ms-touch-action: none;
    /* For older IE versions */
}

.close {
    color: white;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    right: 20px;
    top: 20px;
    cursor: pointer;
}

.close:hover {
    color: lightgray;
}

/* 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);
}

/* Time label and checkbox label styles */
.checkbox-label {
    flex: 1;
    color: #9c9c9c;
    white-space: nowrap;
    text-align: right;
    font-family: 'YekanBakhFaNum', sans-serif;
    font-weight: bold;
}

/* Checkbox styles */
.custom-checkbox {
    margin: 0 5px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #9c9c9c;
    cursor: pointer;
    appearance: none;
}

.custom-checkbox:checked {
    background-image: url('../../../assets/checked.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.closeSound,
.closeAdd,
.closePhone,
.closeHAP,
.closeList {
    color: white;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    left: 15px;
    top: 5px;
    cursor: pointer;
}

/* Landscape mode styles */
@media (orientation: landscape) {

    html,
    body {
        touch-action: none;
        overflow: hidden;
        height: 100%;
        width: 100%;
    }

    .initial-background,
    .main-screen-background {
        background-size: cover;
        background-repeat: no-repeat;
        background-position: center center;
        background-attachment: fixed;
    }

    .initial-background {
        background-image: url('assets/initial-bg.svg');
    }

    .main-screen-background {
        background-image: url('assets/bg.svg');
    }

    .modal {
        display: flex;
        position: fixed;
        justify-content: center;
        width: 50%;
        background-size: cover;
        background-repeat: no-repeat;
        background-position: center center;
        z-index: 1000;
        background-image: url('assets/initial-bg.svg');
    }

    .textInput {
        width: 90%;
        height: 40px;
        margin: auto;
        display: block;
        font-size: 16pt;
        color: white;
        background-color: rgb(196, 210, 213);
        text-align: center;
        background-size: cover;
        border-radius: 48px;
        -webkit-tap-highlight-color: transparent;
    }

    .popup-content {
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 300px;
        height: 200px;
        padding: 20px;
        background-color: #707d7f;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        border-radius: 36px;
    }

    .list-content {
        height: 80%;
        width: 400px;
    }

    .halfPopup {
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 400px;
        height: 300;
        padding: 20px;
        background-color: #707d7f;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        border-radius: 36px;
    }

    .wiredZones,
    .wirelessZones {
        width: 96%;
    }

    /* Style for labels in checkbox container */
    .relay-label {
        /* Prevent label text from wrapping */
        color: rgb(156, 156, 156);
        /* Set text color to rgb(156, 156, 156) */
        font-weight: bold;
    }

    .blue-dot {
        display: none;
    }

    .complex-element-wrapper {
        position: relative;
        width: 45%;
        height: auto;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .buttons-container {
        width: 100%;
        display: flex;
        justify-content: space-around;
    }

    .center-buttons,
    .lock-icons {
        position: absolute;
        left: 50%;
        transform: translate(-50%, -50%);
        display: flex;
        gap: 10%;
        top: 30%;
    }

    .lock-icons {
        top: 30%;
        gap: 15%;
    }

    .enable-Device,
    .disable-Device {
        width: 20vh;
        height: 20vh;
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: #d2d2d2;
        border-radius: 50%;
        overflow: hidden;
        box-sizing: border-box;
        object-fit: contain;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
    }

    /* The individual button styling remains unchanged */
    #enableDevice,
    #disableDevice {
        width: 12vh;
        height: auto;
        padding: 5px;
        -webkit-tap-highlight-color: transparent;
    }

    .small-button {
        position: fixed;
        top: 32%;
        left: 50%;
        transform: translate(-50%, -50%);
        text-align: center;
        margin-bottom: 20px;
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: #d2d2d2;
        border-radius: 50%;
        overflow: hidden;
        width: 50px;
        height: 50px;
        padding: 5px;
        box-sizing: border-box;
        box-shadow: 0 20px 30px rgba(0, 0, 0, 0.5);
    }

    .small-button input[type="image"] {
        display: block;
        width: 30px;
        height: auto;
        border: none;
        padding: 0;
        margin: 0;
    }

    .devices-container {
        position: absolute;
        top: 55%;
        left: 50%;
        transform: translateX(-50%);
        display: flex;
        justify-content: center;
    }

    .add-device {
        position: absolute;
        left: 22%;
        transform: translate(-50%, -50%);
        text-align: center;
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: #d2d2d2;
        border-radius: 50%;
        overflow: hidden;
        width: 50px;
        height: 50px;
        padding: 5px;
        box-sizing: border-box;
        box-shadow:
            0 20px 30px rgba(0, 0, 0, 0.5),
            /* Bottom shadow */
            /* 0 -10px 20px rgba(255, 255, 255, 0.6); Top glow */
    }


    .add-device input[type="image"] {
        display: block;
        width: 30px;
        height: auto;
        border: none;
        padding: 0;
        margin: 0;
    }

    .devices {
        width: 50%;
        height: 45px;
        left: 30%;
        padding: 5px;
        box-sizing: border-box;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: #d2d2d2;
        border-radius: 50px;
        overflow: hidden;
        position: relative;
        transform: translateX(-50%);
        cursor: pointer;
    }

    .devices input[type="image"] {
        width: 30px;
        height: 30px;
        border: none;
        margin-right: 3px;
        margin-left: auto;
        object-fit: contain;
    }

    .devices .hover-text {
        margin-right: 10px;
        white-space: nowrap;
        text-align: left;
        flex-grow: 1;
        font-family: 'YekanBakhFaNum', sans-serif;
        font-size: 14pt;
    }

    #statMessage {
        width: 30vw;
        height: auto;
    }

    .responsive-img {
        width: 30vw;
        height: auto;
    }

    .modal {
        display: none;
        position: fixed;
        z-index: 1000;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        background-color: transparent;
        overflow: hidden;
    }

    .modal-content {
        position: relative;
        background-image: url('/assets/settings-bg.svg');
        background-size: 100% auto;
        /* Fit the background image to the width, maintaining aspect ratio */
        background-position: top;
        /* Align the background image to the top */
        width: 100%;
        height: 100%;
        display: flex;
        flex-direction: column;
        color: transparent;
        border-radius: 20px;
    }


    .close {
        color: white;
        font-size: 28px;
        font-weight: bold;
        position: absolute;
        right: 20px;
        top: 20px;
        cursor: pointer;
    }

    .close:hover {
        color: lightgray;
    }

    .close-off-screen {
        position: fixed;
        top: -100px;
        right: -100px;
        transition: top 0.3s, right 0.3s;
    }

    .close-original {
        position: fixed;
        top: 10px;
        right: 10px;
    }

    .closeSound,
    .closeAdd,
    .closePhone,
    .closeHAP {
        color: white;
        font-size: 28px;
        font-weight: bold;
        position: absolute;
        left: 15px;
        top: 5px;
        cursor: pointer;
    }
}