*, *::before, *::after { box-sizing: border-box; }

body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    overflow: hidden;
    background-color: #000;
    font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
}

.container {
    position: relative;
    padding: 3px;
    height: 100vh;
    width: 100vw;
    display: flex;
    flex-direction: column;
}

/* ── Poster & Timer ── */
.poster-wrapper {
    position: relative;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.background-img {
    width: 100%;
    height: 100%;
    object-fit: fill;
    display: block;
}

.overlay {
    position: absolute;
    left: 0;
    width: 100%;
    top: 34%;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
}

.timer-box {
    display: flex;
    flex-direction: row;
    direction: ltr;
    gap: 8px;
    padding: 10px 10px 0px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    width: fit-content;
    max-width: 95%;
}

.unit-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
}

.number {
    color: #fff;
    font-size: 8vw;
    font-weight: bold;
    margin: 0;
    line-height: 1;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.label {
    color: #fff;
    font-size: 3.5vw;
    margin-top: 5px;
    font-weight: 500;
}

.divider {
    color: #fff;
    font-size: 5vw;
    line-height: 1.2;
    padding: 0 2px;
}

/* ── Smooth CSS Marquee ── */
.logos-marquee {
    width: 100%;
    background: rgba(0, 0, 0, 0.6);
    padding: 12px 0;
    overflow: hidden;
    flex-shrink: 0;
    z-index: 10;
}

.marquee-track {
    display: flex;
    align-items: center;
    width: max-content;
    animation: scroll-right 20s linear infinite;
    will-change: transform;
}

@keyframes scroll-right {
    0%   { transform: translateX(-50%); }
    100% { transform: translateX(0); }
}

.logo-item {
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 70px;
    margin: 0 40px;
    flex-shrink: 0;
}

.logo-item img {
    height: 100%;
    width: auto;
    max-width: 160px;
    object-fit: contain;
    opacity: 0.85;
    transition: opacity 0.25s, transform 0.2s;
    cursor: pointer;
}

.logo-item:hover img,
.logo-item:focus-visible img {
    opacity: 1;
    transform: scale(1.08);
}

/* ── Logo Modal ── */
#logo-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    justify-content: center;
    align-items: center;
}

#logo-modal.open {
    display: flex;
    animation: modal-in 0.25s ease;
}

@keyframes modal-in {
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: scale(1); }
}

#logo-modal .modal-inner {
    position: relative;
    background: rgba(15, 15, 20, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    padding: 28px 24px 24px;
    width: min(480px, 92vw);
    max-height: 88vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.8);
    direction: rtl;
}

/* Scrollbar style */
#logo-modal .modal-inner::-webkit-scrollbar { width: 4px; }
#logo-modal .modal-inner::-webkit-scrollbar-track { background: transparent; }
#logo-modal .modal-inner::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }

/* Logo image at top of modal */
#modal-logo-wrap {
    width: 110px;
    height: 110px;
    border-radius: 20px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    margin-bottom: 14px;
}

#modal-img {
    max-width: 90px;
    max-height: 90px;
    object-fit: contain;
    border-radius: 8px;
}

/* Business name */
#modal-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    text-align: center;
    margin: 0 0 20px;
    line-height: 1.3;
}

/* Divider */
.modal-divider {
    width: 100%;
    height: 1px;
    background: rgba(255,255,255,0.08);
    margin-bottom: 20px;
}

/* Info rows */
.info-list {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    text-decoration: none;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 14px;
    padding: 12px 14px;
    transition: background 0.2s, border-color 0.2s, transform 0.15s;
    cursor: pointer;
}

.info-row:hover {
    background: rgba(255,255,255,0.09);
    border-color: rgba(255,255,255,0.18);
    transform: translateY(-1px);
}

.info-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.info-icon.phone  { background: rgba(52, 199, 89, 0.18);  color: #34c759; }
.info-icon.map    { background: rgba(255, 69, 58, 0.18);  color: #ff453a; }
.info-icon.insta  { background: rgba(255, 149, 0, 0.18);  color: #ff9500; }
.info-icon.addr   { background: rgba(90, 200, 250, 0.18); color: #5ac8fa; }

.info-text-wrap {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.info-type {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.4);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.info-value {
    font-size: 0.95rem;
    color: rgba(255,255,255,0.85);
    font-weight: 500;
    word-break: break-word;
    line-height: 1.4;
}

/* No info placeholder */
.no-info {
    color: rgba(255,255,255,0.3);
    font-size: 0.9rem;
    text-align: center;
    padding: 20px 0;
}

#modal-close {
    position: absolute;
    top: 14px;
    left: 14px;         /* left side in RTL layout */
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.15);
    font-size: 16px;
    line-height: 32px;
    text-align: center;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    padding: 0;
}

#modal-close:hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.1);
}

/* Redirect overlay */
.redirect-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.7s ease;
}

.redirect-overlay.visible {
    opacity: 1;
    pointer-events: all;
}

.redirect-text {
    color: #fff;
    font-size: 6vw;
    font-weight: bold;
    direction: rtl;
    text-align: center;
    margin-bottom: 10px;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
}

.redirect-sub {
    color: rgba(255, 255, 255, 0.65);
    font-size: 3.8vw;
    direction: rtl;
    text-align: center;
    margin-bottom: 28px;
}

.redirect-bar-wrap {
    width: 220px;
    height: 5px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    overflow: hidden;
}

.redirect-bar {
    height: 100%;
    width: 0%;
    background: #FFD93D;
    border-radius: 3px;
    transition: width linear;
}

.redirect-btn {
    margin-top: 28px;
    padding: 13px 36px;
    background: #FFD93D;
    color: #000;
    border: none;
    border-radius: 50px;
    font-size: 4vw;
    font-weight: bold;
    cursor: pointer;
    direction: rtl;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 4px 20px rgba(255, 217, 61, 0.35);
}

@media (min-width: 768px) {
    .number        { font-size: 3.5rem; }
    .label         { font-size: 1rem; }
    .divider       { font-size: 3rem; }
    .unit-container{ min-width: 100px; }
    .redirect-text { font-size: 2rem; }
    .redirect-sub  { font-size: 1.1rem; }
    .redirect-btn  { font-size: 1.1rem; }
}

/* --- Additions (v2) --- */
.logos-marquee {
    direction: ltr; /* the loop animation assumes left-to-right flow */
}

/* Pause only while a mouse hovers it (not after a tap on phones) or while a keyboard user is on a logo. */
@media (hover: hover) and (pointer: fine) {
    .marquee-track:hover {
        animation-play-state: paused;
    }
}
.marquee-track:has(.logo-item:focus-visible) {
    animation-play-state: paused;
}

.logo-item:focus-visible {
    outline: 3px solid #FFD93D;
    outline-offset: 4px;
    border-radius: 8px;
}

.logos-marquee:empty,
.logos-marquee.is-empty {
    display: none;
}

.info-row,
.info-row:visited {
    color: inherit;
}

@media (prefers-reduced-motion: reduce) {
    .marquee-track {
        animation: none;
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
    }
    .marquee-track [data-clone] {
        display: none;
    }
}
