/* ============================================================
   1. GLOBAL & HEADER
   ============================================================ */
html, body {
    margin: 0; padding: 0;
    width: 100vw; height: 100vh;
    overflow: hidden;
    background: url("../images/main.jpg") no-repeat center center fixed;
    background-size: cover;
    background-color: #000;
}

/* Generic RTL support trigger */
.rtl-mode {
    direction: rtl !important;
}

/* ============================================================
   2. HEADER ELEMENTS (Positioning & RTL Fixes)
   ============================================================ */
#header-left, #header-right, #greeting {
    position: absolute; 
    z-index: 100; 
    color: white;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.8);
}

/* LTR DEFAULT POSITIONS */
#header-left { 
    top: 3vh; 
    left: 5vw; 
    right: auto; /* Reset for LTR */
    text-align: left;
    font-weight: 500;
}

#header-right { 
    top: 3vh; 
    right: 5vw; 
    left: auto; /* Reset for LTR */
    text-align: right; 
    font-weight: 500;
}

/* RTL HEADER SWAP LOGIC */
body.rtl-mode #header-left { 
    left: auto !important; 
    right: 5vw !important; 
    text-align: right !important; 
}

body.rtl-mode #header-right { 
    right: auto !important; 
    left: 5vw !important; 
    text-align: left !important; 
}

/* Ensure data inside headers stays readable LTR */
#time, #date, #temp, #room {
    direction: ltr !important;
    unicode-bidi: isolate;
    display: inline-block;
}

#time { font-size: 3vw; font-weight: 500; display: block; }
#room { font-size: 3vw; font-weight: 500; display: block; }
#date { font-size: 2.2vw; margin-top: 5px; font-weight: 500; }
#temp { font-size: 2.2vw; margin-top: 5px; font-weight: 500; }


#greeting { 
    top: 13vh; 
    width: 100%; 
    text-align: center; 
    font-size: 2.2vw; 
    font-weight: 500;
    direction: rtl; /* Corrects name order for Urdu/Hebrew */
}

/* Fix for Room/Temp stacking in RTL */
body.rtl-mode #temp {
    display: block; 
}

/* ============================================================
   3. CAROUSEL & CONTAINER
   ============================================================ */
.menu-container {
    position: absolute;
    bottom: 2vh; 
    width: 100vw;
    height: 35vh; 
    overflow: hidden;
    z-index: 50;
    /* Mask for LTR */
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

/* Flip the mask for RTL mode to ensure correct edge fading */
body.rtl-mode .menu-container {
    -webkit-mask-image: linear-gradient(to left, transparent, black 10%, black 90%, transparent);
}

#menuTrack {
    display: flex;
    flex-direction: row !important; 
    align-items: center;
    height: 100%;
    position: relative;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.icon-item {
    width: 11.5vw;
    margin: 0 1.39vw;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    outline: none;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.icon-item:focus {
    opacity: 1.0;
    transform: scale(1.1);
}

.icon-img {
    width: 100%;
    height: auto;
    border-radius: 50%;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

.icon-label {
    margin-top: 12px;
    font-size: 1.8vw;
    color: white;
    text-align: center;
    white-space: nowrap;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.8);
}

.icon-item:focus .icon-label {
    color: #f5e985;
    font-weight: 600;
}

/* ============================================================
   4. BOUNCE ANIMATION
   ============================================================ */
.icon-item:focus .icon-img,
.icon-img.bounce { 
    animation: macBounce 0.5s ease; 
}

@keyframes macBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}