/* ============================================================
   indexStyle.css — Restaurant Selection Landing Page
   Design: Icon-only cards · Two-row grid · Bottom dock
   Video background · Fully responsive (mobile-first)
   ============================================================ */

@import url('colors.css');

/* ── Reset ──────────────────────────────────────────────────── */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ── Body ───────────────────────────────────────────────────── */
body {
    height: 100vh;
    width: 100%;
    overflow: hidden;
    font-family: 'Cairo', 'Noto Sans Arabic', sans-serif;
    background-color: #0f0e0c;
    position: relative;
}

/* ── Video Background ───────────────────────────────────────── */
.video-background {
    position: fixed;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover;
    z-index: 0;
}

@media (max-aspect-ratio: 16/9) {
    .video-background { width: auto; height: 100%; }
}
@media (min-aspect-ratio: 16/9) {
    .video-background { width: 100%; height: auto; }
}

/* ── Bottom gradient fade ───────────────────────────────────── */
.bottom-fade {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 55%;
    background: linear-gradient(
        to top,
        rgba(5, 4, 3, 0.95) 0%,
        rgba(5, 4, 3, 0.65) 40%,
        rgba(5, 4, 3, 0.18) 75%,
        transparent 100%
    );
    z-index: 1;
    pointer-events: none;
}

/* ── Restaurant Dock — fixed to bottom ─────────────────────── */
.restaurant-dock {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 2;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding-bottom: 44px;
}

/* ── Cards Grid Wrapper ─────────────────────────────────────── */
/*
   Two-row grid layout:
   Row 1: 2 square cards (equal width)
   Row 2: 1 wide card (spans full width of row 1)
   
   We use CSS Grid with 2 columns.
   The wide card uses grid-column: 1 / -1 to span both columns.
*/
.cards-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: clamp(10px, 2.5vw, 20px);
    padding: 0 clamp(16px, 5vw, 40px);
    width: 100%;
    max-width: 320px;
}

/* ── Individual Card — base styles ─────────────────────────── */
.rest-card {
    text-decoration: none;
    display: block;
    position: relative;
    overflow: hidden;
    cursor: pointer;

    background: rgba(18, 16, 13, 0.62);
    border: 1.5px solid rgba(240, 236, 228, 0.14);
    border-radius: clamp(14px, 2.5vw, 22px);
    backdrop-filter: blur(18px) saturate(1.2);
    -webkit-backdrop-filter: blur(18px) saturate(1.2);

    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.55),
        0 1px 0 rgba(240, 236, 228, 0.06) inset;

    animation: cardRise 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both;

    transition:
        transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
        border-color 0.3s ease,
        box-shadow 0.35s ease;
}

/* ── Square cards (rows 1 — first two items) ────────────────── */
/*
   Each square card fills its grid cell.
   aspect-ratio: 1 / 1 ensures a perfect square.
*/
.rest-card.card-square {
    aspect-ratio: 1 / 1;
    width: 100%;
}

/* ── Wide card (row 2 — third item) ────────────────────────── */
/*
   Spans both columns. Height adapts automatically to the image's
   natural dimensions — no cropping, no forced ratio.
*/
.rest-card.card-wide {
    grid-column: 1 / -1;         /* span both columns */
    width: 100%;
    aspect-ratio: auto;          /* follow the image's natural ratio */
    height: auto;
}

/* ── Hover states ───────────────────────────────────────────── */
.rest-card:hover {
    transform: translateY(-8px) scale(1.04);
    border-color: rgba(240, 236, 228, 0.42);
    box-shadow:
        0 22px 50px rgba(0, 0, 0, 0.70),
        0 0 38px rgba(240, 236, 228, 0.09),
        0 1px 0 rgba(240, 236, 228, 0.14) inset;
}

.rest-card:active {
    transform: translateY(-2px) scale(0.97);
    transition-duration: 0.1s;
}

/* ── Logo fills card completely ─────────────────────────────── */
.card-logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.rest-card:hover .card-logo {
    transform: scale(1.07);
}

/* ── Wide card logo — natural dimensions, no cropping ───────── */
.rest-card.card-wide .card-logo {
    object-fit: fill;
    width: 100%;
    height: auto;
    display: block;
}

/* ── Fallback icon when no logo ─────────────────────────────── */
.card-logo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    color: rgba(240, 236, 228, 0.40);
}

/* ── Shine sweep on hover ───────────────────────────────────── */
.card-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(
        105deg,
        transparent 40%,
        rgba(255, 255, 255, 0.16) 50%,
        transparent 60%
    );
    pointer-events: none;
}

.rest-card:hover .card-shine {
    left: 160%;
    transition: left 0.55s ease;
}

/* ── No restaurants message ─────────────────────────────────── */
.no-rest {
    color: rgba(240, 236, 228, 0.65);
    font-size: 1rem;
    text-align: center;
    direction: rtl;
    grid-column: 1 / -1;
}

/* ── Entrance Animation ─────────────────────────────────────── */
@keyframes cardRise {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.88);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ── Responsive fine-tuning ─────────────────────────────────── */

/* Large desktop */
@media (min-width: 1200px) {
    .cards-row {
        max-width: 380px;
        gap: 22px;
    }
    .restaurant-dock {
        padding-bottom: 50px;
    }
}

/* Desktop / large tablet */
@media (min-width: 769px) and (max-width: 1199px) {
    .cards-row {
        max-width: 340px;
        gap: 18px;
    }
    .restaurant-dock {
        padding-bottom: 48px;
    }
}

/* Tablet */
@media (max-width: 768px) {
    .restaurant-dock {
        padding-bottom: 36px;
    }
    .cards-row {
        max-width: 300px;
        gap: clamp(10px, 2.5vw, 16px);
    }
}

/* Mobile */
@media (max-width: 480px) {
    .restaurant-dock {
        padding-bottom: 28px;
    }
    .cards-row {
        max-width: min(280px, calc(100vw - 48px));
        gap: 10px;
        padding: 0 24px;
    }
}

/* Small mobile */
@media (max-width: 360px) {
    .restaurant-dock {
        padding-bottom: 20px;
    }
    .cards-row {
        max-width: calc(100vw - 36px);
        gap: 8px;
        padding: 0 18px;
    }
}