<?php
ini_set('session.cache_limiter', 'public');
session_cache_limiter(false);
session_start();
include("config.php");
if (!isset($_SESSION['uemail'])) {
  header("location:login.php");
}
?>
<style>
  .red label:disabled {
    cursor: not-allowed;
  }
  .red label {
    color: white;
    padding: 10px;
    font-weight: bold;
    display: block;
    cursor: not-allowed !important;
    background-color: red !important;
  }
  .yellow label:disabled {
    cursor: not-allowed;
  }
  .yellow label {
    color: black !important;
    padding: 10px;
    font-weight: bold;
    display: block;
    cursor: not-allowed !important;
    background-color: yellow !important;
  }
</style>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="description" content="Real Estate PHP">
  <meta name="keywords" content="">
  <meta name="author" content="Unicoder">
  <link rel="shortcut icon" href="images/favicon.png">
  <link href="https://fonts.googleapis.com/css?family=Muli:400,400i,500,600,700&amp;display=swap" rel="stylesheet">
  <link href="https://fonts.googleapis.com/css?family=Comfortaa:400,700" rel="stylesheet">
  <link rel="stylesheet" type="text/css" href="css/bootstrap-slider.css">
  <link rel="stylesheet" type="text/css" href="css/jquery-ui.css">
  <link rel="stylesheet" type="text/css" href="css/layerslider.css">
  <link rel="stylesheet" type="text/css" href="css/color.css" id="color-change">
  <link rel="stylesheet" type="text/css" href="css/owl.carousel.min.css">
  <link rel="stylesheet" type="text/css" href="css/font-awesome.min.css">
  <link rel="stylesheet" type="text/css" href="fonts/flaticon/flaticon.css">
  <title>Clan Homes</title>
</head>
<body>
  <div class="theatre">
    <div class="screen-side">
      <h3 class="select-text">05- MARLA TOWN HOUSES</h3>
    </div>
    <div style="display: flex; justify-content: space-between; width: 99%; margin-bottom: 10px;">
      <div>
        <a href="index.php"><button
            style="background-color: black; color: white; border: none; border-radius: 3px; padding: 10px 20px; margin-right: 10px;">Go
            Back</button></a>
      </div>
      <div>
        <button ton
          style="background-color: green; color: white; border: none; border-radius: 3px; padding: 10px 20px; margin-right: 10px;">AVAILABLE</button>
        <button
          style="background-color: yellow; color: black; border-radius: 3px; border:  none; padding: 10px 20px; margin-right: 10px;">ON
          HOLD</button>
        <button
          style="background-color: red; color: white; border: none; border-radius: 3px; padding: 10px 20px; margin-right: 10px;">SOLD</button>
        <button
          style="background-color: purple; color: white; border-radius: 3px; border: none; padding: 10px 20px;">AFFILIATE</button>
      </div>
    </div>
    <?php
    $apartmentx = [
      ['id' => 'Apartment No. 370 2nd Floor', 'label' => '2nd Floor'],
      ['id' => 'Apartment No. 371 2nd Floor', 'label' => '2nd Floor'],
      ['id' => 'Apartment No. 372 2nd Floor', 'label' => '2nd Floor'],
      ['id' => 'Apartment No. 373 2nd Floor', 'label' => '2nd Floor'],
      ['id' => 'Apartment No. 374 2nd Floor', 'label' => '2nd Floor'],
      ['id' => 'Apartment No. 375 2nd Floor', 'label' => '2nd Floor'],
      ['id' => 'Apartment No. 376 2nd Floor', 'label' => '2nd Floor'],
      ['id' => 'Apartment No. 377 2nd Floor', 'label' => '2nd Floor'],
      ['id' => 'Apartment No. 378 2nd Floor', 'label' => '2nd Floor'],
      ['id' => 'Apartment No. 379 2nd Floor', 'label' => '2nd Floor'],
      ['id' => 'Apartment No. 379-A 2nd Floor', 'label' => '2nd Floor'],
      ['id' => 'Apartment No. 379-B 2nd Floor', 'label' => '2nd Floor'],
      ['id' => 'Apartment No. 379-C 2nd Floor', 'label' => '2nd Floor'],
      ['id' => 'Apartment No. 379-D 2nd Floor', 'label' => '2nd Floor'],

    ];
    $apartmenta = [
      ['id' => 'Apartment No. 370 1st Floor', 'label' => '1st Floor'],
      ['id' => 'Apartment No. 371 1st Floor', 'label' => '1st Floor'],
      ['id' => 'Apartment No. 372 1st Floor', 'label' => '1st Floor'],
      ['id' => 'Apartment No. 373 1st Floor', 'label' => '1st Floor'],
      ['id' => 'Apartment No. 374 1st Floor', 'label' => '1st Floor'],
      ['id' => 'Apartment No. 375 1st Floor', 'label' => '1st Floor'],
      ['id' => 'Apartment No. 376 1st Floor', 'label' => '1st Floor'],
      ['id' => 'Apartment No. 377 1st Floor', 'label' => '1st Floor'],
      ['id' => 'Apartment No. 378 1st Floor', 'label' => '1st Floor'],
      ['id' => 'Apartment No. 379 1st Floor', 'label' => '1st Floor'],
      ['id' => 'Apartment No. 379-A 1st Floor', 'label' => '1st Floor'],
      ['id' => 'Apartment No. 379-B 1st Floor', 'label' => '1st Floor'],
      ['id' => 'Apartment No. 379-C 1st Floor', 'label' => '1st Floor'],
      ['id' => 'Apartment No. 379-D 1st Floor', 'label' => '1st Floor'],

    ];
    $apartmentb = [
      ['id' => 'Apartment No. 370 Ground Floor', 'label' => 'Ground Floor'],
      ['id' => 'Apartment No. 371 Ground Floor', 'label' => 'Ground Floor'],
      ['id' => 'Apartment No. 372 Ground Floor', 'label' => 'Ground Floor'],
      ['id' => 'Apartment No. 373 Ground Floor', 'label' => 'Ground Floor'],
      ['id' => 'Apartment No. 374 Ground Floor', 'label' => 'Ground Floor'],
      ['id' => 'Apartment No. 375 Ground Floor', 'label' => 'Ground Floor'],
      ['id' => 'Apartment No. 376 Ground Floor', 'label' => 'Ground Floor'],
      ['id' => 'Apartment No. 377 Ground Floor', 'label' => 'Ground Floor'],
      ['id' => 'Apartment No. 378 Ground Floor', 'label' => 'Ground Floor'],
      ['id' => 'Apartment No. 379 Ground Floor', 'label' => 'Ground Floor'],
      ['id' => 'Apartment No. 379-A Ground Floor', 'label' => 'Ground Floor'],
      ['id' => 'Apartment No. 379-B Ground Floor', 'label' => 'Ground Floor'],
      ['id' => 'Apartment No. 379-C Ground Floor', 'label' => 'Ground Floor'],
      ['id' => 'Apartment No. 379-D Ground Floor', 'label' => 'Ground Floor'],

    ];
    $apartmentc = [
      ['id' => '', 'label' => '274'],
      ['id' => 'Apartment No. 274 Ground Floor', 'label' => 'Ground Floor'],
      ['id' => 'Apartment No. 274 1st Floor', 'label' => '1st Floor'],
      ['id' => 'Apartment No. 274 2nd Floor', 'label' => '2nd Floor'],
      ['id' => 'Apartment No. 269 2nd Floor', 'label' => '2nd Floor'],
      ['id' => 'Apartment No. 269 1st Floor', 'label' => '1st Floor'],
      ['id' => 'Apartment No. 269 Ground Floor', 'label' => 'Ground Floor'],
      ['id' => '', 'label' => '269'],
    ];
    $apartmentd = [
      ['id' => '', 'label' => '273'],
      ['id' => 'Apartment No. 273 Ground Floor', 'label' => 'Ground Floor'],
      ['id' => 'Apartment No. 273 1st Floor', 'label' => '1st Floor'],
      ['id' => 'Apartment No. 273 2nd Floor', 'label' => '2nd Floor'],
      ['id' => 'Apartment No. 270 2nd Floor', 'label' => '2nd Floor'],
      ['id' => 'Apartment No. 270 1st Floor', 'label' => '1st Floor'],
      ['id' => 'Apartment No. 270 Ground Floor', 'label' => 'Ground Floor'],
      ['id' => '', 'label' => '270'],
    ];
    $apartmente = [
      ['id' => '', 'label' => '272'],
      ['id' => 'Apartment No. 272 Ground Floor', 'label' => 'Ground Floor'],
      ['id' => 'Apartment No. 272 1st Floor', 'label' => '1st Floor'],
      ['id' => 'Apartment No. 272 2nd Floor', 'label' => '2nd Floor'],
      ['id' => 'Apartment No. 271 2nd Floor', 'label' => '2nd Floor'],
      ['id' => 'Apartment No. 271 1st Floor', 'label' => '1st Floor'],
      ['id' => 'Apartment No. 271 Ground Floor', 'label' => 'Ground Floor'],
      ['id' => '', 'label' => '271'],
    ];
    $apartmentf = [
      ['id' => '', 'label' => '333'],
      ['id' => 'Apartment No. 288 2nd Floor', 'label' => '2nd Floor'],
      ['id' => 'Apartment No. 288 1st Floor', 'label' => '1st Floor'],
      ['id' => 'Apartment No. 288 Ground Floor', 'label' => 'Ground Floor'],
      ['id' => '', 'label' => '288'],
      ['id' => '', 'label' => '287-A'],
      ['id' => 'Apartment No. 287-A Ground Floor', 'label' => 'Ground Floor'],
      ['id' => 'Apartment No. 287-A 1st Floor', 'label' => '1st Floor'],
      ['id' => 'Apartment No. 287-A 2nd Floor', 'label' => '2nd Floor'],
      ['id' => 'Apartment No. 256-A 2nd Floor', 'label' => '2nd Floor'],
      ['id' => 'Apartment No. 256-A 1st Floor', 'label' => '1st Floor'],
      ['id' => 'Apartment No. 256-A Ground Floor', 'label' => 'Ground Floor'],
      ['id' => '', 'label' => '256-A'],
    ];
    $apartmentg = [
      ['id' => '', 'label' => '332'],
      ['id' => 'Apartment No. 289 2nd Floor', 'label' => '2nd Floor'],
      ['id' => 'Apartment No. 289 1st Floor', 'label' => '1st Floor'],
      ['id' => 'Apartment No. 289 Ground Floor', 'label' => 'Ground Floor'],
      ['id' => '', 'label' => '289'],
      ['id' => '', 'label' => '287'],
      ['id' => 'Apartment No. 287 Ground Floor', 'label' => 'Ground Floor'],
      ['id' => 'Apartment No. 287 1st Floor', 'label' => '1st Floor'],
      ['id' => 'Apartment No. 287 2nd Floor', 'label' => '2nd Floor'],
      ['id' => 'Apartment No. 256 2nd Floor', 'label' => '2nd Floor'],
      ['id' => 'Apartment No. 256 1st Floor', 'label' => '1st Floor'],
      ['id' => 'Apartment No. 256 Ground Floor', 'label' => 'Ground Floor'],
      ['id' => '', 'label' => '256'],
    ];
    $apartmenth = [
      ['id' => '', 'label' => '331'],
      ['id' => 'Apartment No. 290 2nd Floor', 'label' => '2nd Floor'],
      ['id' => 'Apartment No. 290 1st Floor', 'label' => '1st Floor'],
      ['id' => 'Apartment No. 290 Ground Floor', 'label' => 'Ground Floor'],
      ['id' => '', 'label' => '290'],
      ['id' => '', 'label' => '286'],
      ['id' => 'Apartment No. 286 Ground Floor', 'label' => 'Ground Floor'],
      ['id' => 'Apartment No. 286 1st Floor', 'label' => '1st Floor'],
      ['id' => 'Apartment No. 286 2nd Floor', 'label' => '2nd Floor'],
      ['id' => 'Apartment No. 257 2nd Floor', 'label' => '2nd Floor'],
      ['id' => 'Apartment No. 257 1st Floor', 'label' => '1st Floor'],
      ['id' => 'Apartment No. 257 Ground Floor', 'label' => 'Ground Floor'],
      ['id' => '', 'label' => '257'],
    ];
    $apartmenti = [
      ['id' => '', 'label' => '330'],
      ['id' => 'Apartment No. 291 2nd Floor', 'label' => '2nd Floor'],
      ['id' => 'Apartment No. 291 1st Floor', 'label' => '1st Floor'],
      ['id' => 'Apartment No. 291 Ground Floor', 'label' => 'Ground Floor'],
      ['id' => '', 'label' => '291'],
      ['id' => '', 'label' => '285'],
      ['id' => 'Apartment No. 285 Ground Floor', 'label' => 'Ground Floor'],
      ['id' => 'Apartment No. 285 1st Floor', 'label' => '1st Floor'],
      ['id' => 'Apartment No. 285 2nd Floor', 'label' => '2nd Floor'],
      ['id' => 'Apartment No. 258 2nd Floor', 'label' => '2nd Floor'],
      ['id' => 'Apartment No. 258 1st Floor', 'label' => '1st Floor'],
      ['id' => 'Apartment No. 258 Ground Floor', 'label' => 'Ground Floor'],
      ['id' => '', 'label' => '258'],
    ];
    $apartmentj = [
      ['id' => '', 'label' => '329'],
      ['id' => 'Apartment No. 292 2nd Floor', 'label' => '2nd Floor'],
      ['id' => 'Apartment No. 292 1st Floor', 'label' => '1st Floor'],
      ['id' => 'Apartment No. 292 Ground Floor', 'label' => 'Ground Floor'],
      ['id' => '', 'label' => '292'],
      ['id' => '', 'label' => '284'],
      ['id' => 'Apartment No. 284 Ground Floor', 'label' => 'Ground Floor'],
      ['id' => 'Apartment No. 284 1st Floor', 'label' => '1st Floor'],
      ['id' => 'Apartment No. 284 2nd Floor', 'label' => '2nd Floor'],
      ['id' => 'Apartment No. 259 2nd Floor', 'label' => '2nd Floor'],
      ['id' => 'Apartment No. 259 1st Floor', 'label' => '1st Floor'],
      ['id' => 'Apartment No. 259 Ground Floor', 'label' => 'Ground Floor'],
      ['id' => '', 'label' => '259'],
    ];
    $apartmentk = [
      ['id' => '', 'label' => '328'],
      ['id' => 'Apartment No. 293 2nd Floor', 'label' => '2nd Floor'],
      ['id' => 'Apartment No. 293 1st Floor', 'label' => '1st Floor'],
      ['id' => 'Apartment No. 293 Ground Floor', 'label' => 'Ground Floor'],
      ['id' => '', 'label' => '293'],
      ['id' => '', 'label' => '283'],
      ['id' => 'Apartment No. 283 Ground Floor', 'label' => 'Ground Floor'],
      ['id' => 'Apartment No. 283 1st Floor', 'label' => '1st Floor'],
      ['id' => 'Apartment No. 283 2nd Floor', 'label' => '2nd Floor'],
      ['id' => 'Apartment No. 260 2nd Floor', 'label' => '2nd Floor'],
      ['id' => 'Apartment No. 260 1st Floor', 'label' => '1st Floor'],
      ['id' => 'Apartment No. 260 Ground Floor', 'label' => 'Ground Floor'],
      ['id' => '', 'label' => '260'],
    ];
    $apartmentl = [
      ['id' => '', 'label' => '327'],
      ['id' => 'Apartment No. 294 2nd Floor', 'label' => '2nd Floor'],
      ['id' => 'Apartment No. 294 1st Floor', 'label' => '1st Floor'],
      ['id' => 'Apartment No. 294 Ground Floor', 'label' => 'Ground Floor'],
      ['id' => '', 'label' => '294'],
      ['id' => '', 'label' => '282'],
      ['id' => 'Apartment No. 282 Ground Floor', 'label' => 'Ground Floor'],
      ['id' => 'Apartment No. 282 1st Floor', 'label' => '1st Floor'],
      ['id' => 'Apartment No. 282 2nd Floor', 'label' => '2nd Floor'],
      ['id' => 'Apartment No. 261 2nd Floor', 'label' => '2nd Floor'],
      ['id' => 'Apartment No. 261 1st Floor', 'label' => '1st Floor'],
      ['id' => 'Apartment No. 261 Ground Floor', 'label' => 'Ground Floor'],
      ['id' => '', 'label' => '261'],
    ];
    $apartmentm = [
      ['id' => '', 'label' => '326'],
      ['id' => 'Apartment No. 295 2nd Floor', 'label' => '2nd Floor'],
      ['id' => 'Apartment No. 295 1st Floor', 'label' => '1st Floor'],
      ['id' => 'Apartment No. 295 Ground Floor', 'label' => 'Ground Floor'],
      ['id' => '', 'label' => '295'],
      ['id' => '', 'label' => '281'],
      ['id' => 'Apartment No. 281 Ground Floor', 'label' => 'Ground Floor'],
      ['id' => 'Apartment No. 281 1st Floor', 'label' => '1st Floor'],
      ['id' => 'Apartment No. 281 2nd Floor', 'label' => '2nd Floor'],
      ['id' => 'Apartment No. 262 2nd Floor', 'label' => '2nd Floor'],
      ['id' => 'Apartment No. 262 1st Floor', 'label' => '1st Floor'],
      ['id' => 'Apartment No. 262 Ground Floor', 'label' => 'Ground Floor'],
      ['id' => '', 'label' => '262'],
    ];
    $apartmentn = [
      ['id' => '', 'label' => '325'],
      ['id' => 'Apartment No. 296 2nd Floor', 'label' => '2nd Floor'],
      ['id' => 'Apartment No. 296 1st Floor', 'label' => '1st Floor'],
      ['id' => 'Apartment No. 296 Ground Floor', 'label' => 'Ground Floor'],
      ['id' => '', 'label' => '296'],
      ['id' => '', 'label' => '280'],
      ['id' => 'Apartment No. 280 Ground Floor', 'label' => 'Ground Floor'],
      ['id' => 'Apartment No. 280 1st Floor', 'label' => '1st Floor'],
      ['id' => 'Apartment No. 280 2nd Floor', 'label' => '2nd Floor'],
      ['id' => 'Apartment No. 263 2nd Floor', 'label' => '2nd Floor'],
      ['id' => 'Apartment No. 263 1st Floor', 'label' => '1st Floor'],
      ['id' => 'Apartment No. 263 Ground Floor', 'label' => 'Ground Floor'],
      ['id' => '', 'label' => '263'],
    ];
    $apartmento = [
      ['id' => '', 'label' => '324'],
      ['id' => 'Apartment No. 297 2nd Floor', 'label' => '2nd Floor'],
      ['id' => 'Apartment No. 297 1st Floor', 'label' => '1st Floor'],
      ['id' => 'Apartment No. 297 Ground Floor', 'label' => 'Ground Floor'],
      ['id' => '', 'label' => '297'],
      ['id' => '', 'label' => '279'],
      ['id' => 'Apartment No. 279 Ground Floor', 'label' => 'Ground Floor'],
      ['id' => 'Apartment No. 279 1st Floor', 'label' => '1st Floor'],
      ['id' => 'Apartment No. 279 2nd Floor', 'label' => '2nd Floor'],
      ['id' => 'Apartment No. 264 2nd Floor', 'label' => '2nd Floor'],
      ['id' => 'Apartment No. 264 1st Floor', 'label' => '1st Floor'],
      ['id' => 'Apartment No. 264 Ground Floor', 'label' => 'Ground Floor'],
      ['id' => '', 'label' => '264'],
    ];
    $apartmentp = [
      ['id' => '', 'label' => '323'],
      ['id' => 'Apartment No. 298 2nd Floor', 'label' => '2nd Floor'],
      ['id' => 'Apartment No. 298 1st Floor', 'label' => '1st Floor'],
      ['id' => 'Apartment No. 298 Ground Floor', 'label' => 'Ground Floor'],
      ['id' => '', 'label' => '298'],
      ['id' => '', 'label' => '278'],
      ['id' => 'Apartment No. 278 Ground Floor', 'label' => 'Ground Floor'],
      ['id' => 'Apartment No. 278 1st Floor', 'label' => '1st Floor'],
      ['id' => 'Apartment No. 278 2nd Floor', 'label' => '2nd Floor'],
      ['id' => 'Apartment No. 265 2nd Floor', 'label' => '2nd Floor'],
      ['id' => 'Apartment No. 265 1st Floor', 'label' => '1st Floor'],
      ['id' => 'Apartment No. 265 Ground Floor', 'label' => 'Ground Floor'],
      ['id' => '', 'label' => '265'],
    ];
    $apartmentq = [
      ['id' => '', 'label' => '322'],
      ['id' => 'Apartment No. 299 2nd Floor', 'label' => '2nd Floor'],
      ['id' => 'Apartment No. 299 1st Floor', 'label' => '1st Floor'],
      ['id' => 'Apartment No. 299 Ground Floor', 'label' => 'Ground Floor'],
      ['id' => '', 'label' => '299'],
      ['id' => '', 'label' => '277'],
      ['id' => 'Apartment No. 277 Ground Floor', 'label' => 'Ground Floor'],
      ['id' => 'Apartment No. 277 1st Floor', 'label' => '1st Floor'],
      ['id' => 'Apartment No. 277 2nd Floor', 'label' => '2nd Floor'],
      ['id' => 'Apartment No. 266 2nd Floor', 'label' => '2nd Floor'],
      ['id' => 'Apartment No. 266 1st Floor', 'label' => '1st Floor'],
      ['id' => 'Apartment No. 266 Ground Floor', 'label' => 'Ground Floor'],
      ['id' => '', 'label' => '266'],
    ];
    $apartmentr = [
      ['id' => '', 'label' => '321'],
      ['id' => 'Apartment No. 300 2nd Floor', 'label' => '2nd Floor'],
      ['id' => 'Apartment No. 300 1st Floor', 'label' => '1st Floor'],
      ['id' => 'Apartment No. 300 Ground Floor', 'label' => 'Ground Floor'],
      ['id' => '', 'label' => '300'],
      ['id' => '', 'label' => '276'],
      ['id' => 'Apartment No. 276 Ground Floor', 'label' => 'Ground Floor'],
      ['id' => 'Apartment No. 276 1st Floor', 'label' => '1st Floor'],
      ['id' => 'Apartment No. 276 2nd Floor', 'label' => '2nd Floor'],
      ['id' => 'Apartment No. 267 2nd Floor', 'label' => '2nd Floor'],
      ['id' => 'Apartment No. 267 1st Floor', 'label' => '1st Floor'],
      ['id' => 'Apartment No. 267 Ground Floor', 'label' => 'Ground Floor'],
      ['id' => '', 'label' => '267'],
    ];
    $apartmentt = [
      ['id' => '', 'label' => '321'],
      ['id' => 'Apartment No. 301 2nd Floor', 'label' => '2nd Floor'],
      ['id' => 'Apartment No. 301 1st Floor', 'label' => '1st Floor'],
      ['id' => 'Apartment No. 301 Ground Floor', 'label' => 'Ground Floor'],
      ['id' => '', 'label' => '301'],
      ['id' => '', 'label' => '275'],
      ['id' => 'Apartment No. 275 Ground Floor', 'label' => 'Ground Floor'],
      ['id' => 'Apartment No. 275 1st Floor', 'label' => '1st Floor'],
      ['id' => 'Apartment No. 275 2nd Floor', 'label' => '2nd Floor'],
      ['id' => 'Apartment No. 268 2nd Floor', 'label' => '2nd Floor'],
      ['id' => 'Apartment No. 268 1st Floor', 'label' => '1st Floor'],
      ['id' => 'Apartment No. 268 Ground Floor', 'label' => 'Ground Floor'],
      ['id' => '', 'label' => '268'],
    ];
    $con = mysqli_connect("localhost", "clanrqdw_homes", "hM%K(UU%M=Ns", "clanrqdw_homes");
    if (mysqli_connect_errno()) {
      echo "Failed to connect to MySQL: " . mysqli_connect_error();
    }

    $query = "SELECT title, status FROM property";
    $result = mysqli_query($con, $query);

    if (!$result) {
      die("Query failed: " . mysqli_error($con));
    }

    $apartments = [];
    while ($row = mysqli_fetch_assoc($result)) {
      $apartments[] = $row;
    }

    mysqli_close($con);
    ?>
    <ol class="cabins">
      <li class="row row--1">
        <ol class="seats" type="A">
          <?php
          foreach ($apartmentx as $apartment) {
            $status = 'Available';
            $title = $apartment['id'];
            foreach ($apartments as $db_apartment) {
              if ($db_apartment['title'] == $apartment['id']) {
                $status = $db_apartment['status'];
                break;
              }
            }
            if ($status == 'Booked') {
              $class = 'red';
              $title = 'BOOKED';
            } elseif ($status == 'Hold') {
              $class = 'yellow';
              $title = 'ON HOLD';
            } else {
              $class = 'green';
              $title = $apartment['label'];
            }
            ?>
            <li class="seate <?php echo $class; ?>">
              <?php if ($status == 'Booked' || $status == 'Hold'): ?>
                <label><?php echo $title; ?></label>
              <?php else: ?>
                <input type="checkbox" id="<?php echo $apartment['id']; ?>" />
                <label for="<?php echo $apartment['id']; ?>"><?php echo $apartment['label']; ?></label>
              <?php endif; ?>
            </li>
            <?php
          }
          ?>
        </ol>
      </li>
      <li class="row row--2">
        <ol class="seats" type="A">
          <?php
          foreach ($apartmenta as $apartment) {
            $status = 'Available';
            $title = $apartment['id'];
            foreach ($apartments as $db_apartment) {
              if ($db_apartment['title'] == $apartment['id']) {
                $status = $db_apartment['status'];
                break;
              }
            }
            if ($status == 'Booked') {
              $class = 'red';
              $title = 'BOOKED';
            } elseif ($status == 'Hold') {
              $class = 'yellow';
              $title = 'ON HOLD';
            } else {
              $class = 'green';
              $title = $apartment['label'];
            }
            ?>
            <li class="seate <?php echo $class; ?>">
              <?php if ($status == 'Booked' || $status == 'Hold'): ?>
                <label><?php echo $title; ?></label>
              <?php else: ?>
                <input type="checkbox" id="<?php echo $apartment['id']; ?>" />
                <label for="<?php echo $apartment['id']; ?>"><?php echo $apartment['label']; ?></label>
              <?php endif; ?>
            </li>
            <?php
          }
          ?>
        </ol>
      </li>
      <li class="row row--3">
        <ol class="seats" type="A">
          <?php
          foreach ($apartmentb as $apartment) {
            $status = 'Available';
            $title = $apartment['id'];
            foreach ($apartments as $db_apartment) {
              if ($db_apartment['title'] == $apartment['id']) {
                $status = $db_apartment['status'];
                break;
              }
            }
            if ($status == 'Booked') {
              $class = 'red';
              $title = 'BOOKED';
            } elseif ($status == 'Hold') {
              $class = 'yellow';
              $title = 'ON HOLD';
            } else {
              $class = 'green';
              $title = $apartment['label'];
            }
            ?>
            <li class="seate <?php echo $class; ?>">
              <?php if ($status == 'Booked' || $status == 'Hold'): ?>
                <label><?php echo $title; ?></label>
              <?php else: ?>
                <input type="checkbox" id="<?php echo $apartment['id']; ?>" />
                <label for="<?php echo $apartment['id']; ?>"><?php echo $apartment['label']; ?></label>
              <?php endif; ?>
            </li>
            <?php
          }
          ?>
        </ol>
      </li>
      <li class="row row--4">
        <ol class="seats" type="A">
          <li class="seate">
            <input type="checkbox" />
            <label style="background: #0808fe;"> 370</label>
          </li>
          <li class="seate">
            <input type="checkbox" />
            <label style="background: #0808fe;"> 371</label>
          </li>
          <li class="seate">
            <input type="checkbox" />
            <label style="background: #0808fe;"> 372</label>
          </li>
          <li class="seate">
            <input type="checkbox" />
            <label style="background: #0808fe;"> 373</label>
          </li>
          <li class="seate">
            <input type="checkbox" />
            <label style="background: #0808fe;"> 374</label>
          </li>
          <li class="seate">
            <input type="checkbox" id="4F" />
            <label for="4F" style="background: #0808fe;"> 375</label>
          </li>
          <li class="seate">
            <input type="checkbox" />
            <label style="background: #0808fe;"> 376</label>
          </li>
          <li class="seate">
            <input type="checkbox" id="5G" />
            <label for="5G" style="background: #0808fe;"> 377</label>
          </li>
          <li class="seate">
            <input type="checkbox" />
            <label style="background: #0808fe;"> 378</label>
          </li>
          <li class="seate">
            <input type="checkbox" />
            <label style="background: #0808fe;"> 379</label>
          </li>
          <li class="seate">
            <input type="checkbox" />
            <label style="background: #0808fe;"> 379-A</label>
          </li>
          <li class="seate">
            <input type="checkbox" />
            <label style="background: #0808fe;"> 379-B</label>
          </li>
          <li class="seate">
            <input type="checkbox" />
            <label style="background: #0808fe;"> 379-C</label>
          </li>
          <li class="seate">
            <input type="checkbox" />
            <label style="background: #0808fe;"> 370-D</label>
          </li>
        </ol>
      </li>
    </ol>
    <div class="screen-side">
      <h3 class="select-text">30' WIDE ROAD</h3>
    </div>
    <ol class="cabin">
      <li class="row row--1">
        <ol class="seats" type="A">
          <?php
          $baseStyle = "font-weight:bold;text-align:center;border-radius:5px;display:block;padding:15px 10px;";
          foreach ($apartmentf as $index => $apartment) {
            // Default status
            $status = 'Available';
            $title = $apartment['id'];

            // Match with DB apartments
            foreach ($apartments as $db_apartment) {
              if ($db_apartment['title'] == $apartment['id']) {
                $status = $db_apartment['status'];
                break;
              }
            }

            // Style setup
            $bgColor = "";
            $rotation = "rotate(180deg)";
            $cursor = "pointer";

            if ($index == 0) {
              $class = 'seatw';
              $rotation = "rotate(360deg)";
              $bgColor = "background:#0808fe;";
            } elseif ($index > 0 && $index <= 3) {
              $class = 'seat';
              $bgColor = ($status == 'Booked') ? "background:red;" : (($status == 'Hold') ? "background:yellow;" : "background:green;");
            } elseif ($index == 4) {
              $class = 'seat';
              $bgColor = "background:#0808fe;";
            } elseif ($index == 5) {
              $class = 'seat';
              $rotation = "rotate(360deg)";
              $bgColor = "background:#0808fe;";
            } elseif ($index >= 6 && $index <= 11) {
              $class = 'seatr';
              $rotation = "rotate(360deg)";
              $bgColor = ($status == 'Booked') ? "background:red;" : (($status == 'Hold') ? "background:yellow;" : "background:green;");
            } elseif ($index == 12) {
              $class = 'seat';
              $rotation = "rotate(180deg)";
              $bgColor = "background:#0808fe;";
            } elseif ($index == 13) {
              $class = 'seat';
              $rotation = "rotate(360deg)";
              $bgColor = "background:#0808fe;";
            }

            // Label text and color based on status
            if ($status == 'Booked') {
              $labelText = "BOOKED";
              $textColor = "color:white;";
              $cursor = "not-allowed";
            } elseif ($status == 'Hold') {
              $labelText = "ON HOLD";
              $textColor = "color:black;"; // Hold text color black
              $cursor = "not-allowed";
            } else {
              $labelText = $apartment['label'];
              $textColor = "color:white;";
              $cursor = "pointer";
            }

            // Render HTML
            if ($status == 'Booked' || $status == 'Hold') {
              echo '<li class="' . $class . '"><label style="' . $baseStyle . $textColor . $bgColor . 'transform:' . $rotation . ';cursor:' . $cursor . ';">' . $labelText . '</label></li>';
            } elseif (empty($apartment['id'])) {
              echo '<li class="' . $class . '"><label style="' . $baseStyle . $textColor . $bgColor . 'transform:' . $rotation . ';cursor:default;">' . $apartment['label'] . '</label></li>';
            } else {
              echo '<li class="' . $class . '">
                <input type="checkbox" id="' . $apartment['id'] . '" />
               <label for="' . $apartment['id'] . '" style="' . $baseStyle . $textColor . $bgColor . 'transform:' . $rotation . ';cursor:' . $cursor . ';">' . $labelText . '</label>
           </li>';
            }
          }
          ?>
        </ol>
      </li>
      <li class="row row--2">
        <ol class="seats" type="A">
          <?php
          $baseStyle = "font-weight:bold;text-align:center;border-radius:5px;display:block;padding:15px 10px;";
          foreach ($apartmentg as $index => $apartment) {
            // Default status
            $status = 'Available';
            $title = $apartment['id'];

            // Match with DB apartments (for status)
            foreach ($apartments as $db_apartment) {
              if ($db_apartment['title'] == $apartment['id']) {
                $status = $db_apartment['status'];
                break;
              }
            }

            // Default styles
            $bgColor = "";
            $rotation = "rotate(180deg)";
            $cursor = "pointer";
            $textColor = "color:white;";

            if ($index == 0) {
              $class = 'seatw';
              $rotation = "rotate(360deg)";
              $bgColor = "background:#0808fe;";
            } elseif ($index > 0 && $index <= 3) {
              $class = 'seat';
              if ($status == 'Booked') {
                $bgColor = "background:red;";
              } elseif ($status == 'Hold') {
                $bgColor = "background:yellow;";
                $textColor = "color:black;";
              } else {
                $bgColor = "background:green;";
              }
            } elseif ($index == 4) {
              $class = 'seat';
              $bgColor = "background:#0808fe;";
            } elseif ($index == 5) {
              $class = 'seat';
              $rotation = "rotate(360deg)";
              $bgColor = "background:#0808fe;";
            } elseif ($index >= 6 && $index <= 11) {
              $class = 'seatr';
              $rotation = "rotate(360deg)";
              if ($status == 'Booked') {
                $bgColor = "background:red;";
              } elseif ($status == 'Hold') {
                $bgColor = "background:yellow;";
                $textColor = "color:black;";
              } else {
                $bgColor = "background:green;";
              }
            } elseif ($index == 12) {
              $class = 'seat';
              $rotation = "rotate(180deg)";
              $bgColor = "background:#0808fe;";
            } elseif ($index == 13) {
              $class = 'seat';
              $rotation = "rotate(360deg)";
              $bgColor = "background:#0808fe;";
            }

            // Label text setup
            if ($status == 'Booked') {
              $labelText = "BOOKED";
              $cursor = "not-allowed";
            } elseif ($status == 'Hold') {
              $labelText = "ON HOLD";
              $cursor = "not-allowed";
            } else {
              $labelText = $apartment['label'];
              $cursor = "pointer";
            }

            // Render output
            if ($status == 'Booked' || $status == 'Hold') {
              echo '<li class="' . $class . '"><label style="' . $baseStyle . $textColor . $bgColor . 'transform:' . $rotation . ';cursor:' . $cursor . ';">' . $labelText . '</label></li>';
            } elseif (empty($apartment['id'])) {
              echo '<li class="' . $class . '"><label style="' . $baseStyle . $textColor . $bgColor . 'transform:' . $rotation . ';cursor:default;">' . $apartment['label'] . '</label></li>';
            } else {
              echo '<li class="' . $class . '">
            <input type="checkbox" id="' . $apartment['id'] . '" />
            <label for="' . $apartment['id'] . '" style="' . $baseStyle . $textColor . $bgColor . 'transform:' . $rotation . ';cursor:' . $cursor . ';">' . $labelText . '</label>
           </li>';
            }
          }
          ?>
        </ol>
      </li>
      <li class="row row--3">
        <ol class="seats" type="A">
          <?php
          $baseStyle = "color:white;font-weight:bold;text-align:center;border-radius:5px;display:block;padding:15px 10px;";

          foreach ($apartmenth as $index => $apartment) {
            // Default values
            $status = 'Available';
            $title = $apartment['id'];
            $bgColor = "";
            $rotation = "rotate(180deg)";
            $cursor = "pointer";
            $textColor = "color:white;"; // Default text color
          
            // Match with DB apartments to get status
            foreach ($apartments as $db_apartment) {
              if ($db_apartment['title'] == $apartment['id']) {
                $status = $db_apartment['status'];
                break;
              }
            }

            // Assign styles based on index and status
            if ($index == 0) {
              $class = 'seatw';
              $rotation = "rotate(360deg)";
              $bgColor = "background:#0808fe;";
            } elseif ($index > 0 && $index <= 3) {
              $class = 'seat';
              if ($status == 'Booked') {
                $bgColor = "background:red;";
                $textColor = "color:white;";
              } elseif ($status == 'Hold') {
                $bgColor = "background:yellow;";
                $textColor = "color:black;"; // Hold text color black
              } else {
                $bgColor = "background:green;";
                $textColor = "color:white;";
              }
            } elseif ($index == 4) {
              $class = 'seat';
              $bgColor = "background:#0808fe;";
            } elseif ($index == 5) {
              $class = 'seat';
              $rotation = "rotate(360deg)";
              $bgColor = "background:#0808fe;";
            } elseif ($index >= 6 && $index <= 11) {
              $class = 'seatr';
              $rotation = "rotate(360deg)";
              if ($status == 'Booked') {
                $bgColor = "background:red;";
                $textColor = "color:white;";
              } elseif ($status == 'Hold') {
                $bgColor = "background:yellow;";
                $textColor = "color:black;"; // Hold text color black
              } else {
                $bgColor = "background:green;";
                $textColor = "color:white;";
              }
            } elseif ($index == 12) {
              $class = 'seat';
              $rotation = "rotate(180deg)";
              $bgColor = "background:#0808fe;";
            } elseif ($index == 13) {
              $class = 'seat';
              $rotation = "rotate(360deg)";
              $bgColor = "background:#0808fe;";
            }

            // Render HTML for each apartment based on status
            if ($status == 'Booked' || $status == 'Hold') {
              echo '<li class="' . $class . '"><label style="' . $baseStyle . $textColor . $bgColor . 'transform:' . $rotation . ';cursor:not-allowed;">' . strtoupper($status) . '</label></li>';
            } elseif (empty($apartment['id'])) {
              echo '<li class="' . $class . '"><label style="' . $baseStyle . $textColor . $bgColor . 'transform:' . $rotation . ';cursor:default;">' . $apartment['label'] . '</label></li>';
            } else {
              echo '<li class="' . $class . '">
            <input type="checkbox" id="' . $apartment['id'] . '" />
            <label for="' . $apartment['id'] . '" style="' . $baseStyle . $textColor . $bgColor . 'transform:' . $rotation . ';cursor:pointer;">' . $apartment['label'] . '</label>
           </li>';
            }
          }
          ?>
        </ol>
      </li>
      <li class="row row--4">
        <ol class="seats" type="A">
          <?php
          $baseStyle = "color:white;font-weight:bold;text-align:center;border-radius:5px;display:block;padding:15px 10px;";

          foreach ($apartmenti as $index => $apartment) {
            // Default values
            $status = 'Available';
            $title = $apartment['id'];
            $bgColor = "";
            $rotation = "rotate(180deg)";
            $cursor = "pointer";
            $textColor = "color:white;"; // Default text color
          
            // Match with DB apartments to get status
            foreach ($apartments as $db_apartment) {
              if ($db_apartment['title'] == $apartment['id']) {
                $status = $db_apartment['status'];
                break;
              }
            }

            // Assign styles based on index and status
            if ($index == 0) {
              $class = 'seatw';
              $rotation = "rotate(360deg)";
              $bgColor = "background:#0808fe;";
            } elseif ($index > 0 && $index <= 3) {
              $class = 'seat';
              if ($status == 'Booked') {
                $bgColor = "background:red;";
                $textColor = "color:white;";
              } elseif ($status == 'Hold') {
                $bgColor = "background:yellow;";
                $textColor = "color:black;"; // Hold text color black
              } else {
                $bgColor = "background:green;";
                $textColor = "color:white;";
              }
            } elseif ($index == 4) {
              $class = 'seat';
              $bgColor = "background:#0808fe;";
            } elseif ($index == 5) {
              $class = 'seat';
              $rotation = "rotate(360deg)";
              $bgColor = "background:#0808fe;";
            } elseif ($index >= 6 && $index <= 11) {
              $class = 'seatr';
              $rotation = "rotate(360deg)";
              if ($status == 'Booked') {
                $bgColor = "background:red;";
                $textColor = "color:white;";
              } elseif ($status == 'Hold') {
                $bgColor = "background:yellow;";
                $textColor = "color:black;"; // Hold text color black
              } else {
                $bgColor = "background:green;";
                $textColor = "color:white;";
              }
            } elseif ($index == 12) {
              $class = 'seat';
              $rotation = "rotate(180deg)";
              $bgColor = "background:#0808fe;";
            } elseif ($index == 13) {
              $class = 'seat';
              $rotation = "rotate(360deg)";
              $bgColor = "background:#0808fe;";
            }

            // Render HTML for each apartment based on status
            if ($status == 'Booked' || $status == 'Hold') {
              echo '<li class="' . $class . '"><label style="' . $baseStyle . $textColor . $bgColor . 'transform:' . $rotation . ';cursor:not-allowed;">' . strtoupper($status) . '</label></li>';
            } elseif (empty($apartment['id'])) {
              echo '<li class="' . $class . '"><label style="' . $baseStyle . $textColor . $bgColor . 'transform:' . $rotation . ';cursor:default;">' . $apartment['label'] . '</label></li>';
            } else {
              echo '<li class="' . $class . '">
                 <input type="checkbox" id="' . $apartment['id'] . '" />
                 <label for="' . $apartment['id'] . '" style="' . $baseStyle . $textColor . $bgColor . 'transform:' . $rotation . ';cursor:pointer;">' . $apartment['label'] . '</label>
                 </li>';
            }
          }
          ?>
        </ol>
      </li>
      <li class="row row--5">
        <ol class="seats" type="A">
          <?php
          $baseStyle = "color:white;font-weight:bold;text-align:center;border-radius:5px;display:block;padding:15px 10px;";

          foreach ($apartmentj as $index => $apartment) {
            // Default values
            $status = 'Available';
            $title = $apartment['id'];
            $bgColor = "";
            $rotation = "rotate(180deg)";
            $cursor = "pointer";
            $textColor = "color:white;"; // Default text color
          
            // Match with DB apartments to get status
            foreach ($apartments as $db_apartment) {
              if ($db_apartment['title'] == $apartment['id']) {
                $status = $db_apartment['status'];
                break;
              }
            }

            // Assign styles based on index and status
            if ($index == 0) {
              $class = 'seatw';
              $rotation = "rotate(360deg)";
              $bgColor = "background:#0808fe;";
            } elseif ($index > 0 && $index <= 3) {
              $class = 'seat';
              if ($status == 'Booked') {
                $bgColor = "background:red;";
                $textColor = "color:white;";
              } elseif ($status == 'Hold') {
                $bgColor = "background:yellow;";
                $textColor = "color:black;"; // Hold text color black
              } else {
                $bgColor = "background:green;";
                $textColor = "color:white;";
              }
            } elseif ($index == 4) {
              $class = 'seat';
              $bgColor = "background:#0808fe;";
            } elseif ($index == 5) {
              $class = 'seat';
              $rotation = "rotate(360deg)";
              $bgColor = "background:#0808fe;";
            } elseif ($index >= 6 && $index <= 11) {
              $class = 'seatr';
              $rotation = "rotate(360deg)";
              if ($status == 'Booked') {
                $bgColor = "background:red;";
                $textColor = "color:white;";
              } elseif ($status == 'Hold') {
                $bgColor = "background:yellow;";
                $textColor = "color:black;"; // Hold text color black
              } else {
                $bgColor = "background:green;";
                $textColor = "color:white;";
              }
            } elseif ($index == 12) {
              $class = 'seat';
              $rotation = "rotate(180deg)";
              $bgColor = "background:#0808fe;";
            } elseif ($index == 13) {
              $class = 'seat';
              $rotation = "rotate(360deg)";
              $bgColor = "background:#0808fe;";
            }

            // Render HTML for each apartment based on status
            if ($status == 'Booked' || $status == 'Hold') {
              echo '<li class="' . $class . '"><label style="' . $baseStyle . $textColor . $bgColor . 'transform:' . $rotation . ';cursor:not-allowed;">' . strtoupper($status) . '</label></li>';
            } elseif (empty($apartment['id'])) {
              echo '<li class="' . $class . '"><label style="' . $baseStyle . $textColor . $bgColor . 'transform:' . $rotation . ';cursor:default;">' . $apartment['label'] . '</label></li>';
            } else {
              echo '<li class="' . $class . '">
                 <input type="checkbox" id="' . $apartment['id'] . '" />
                 <label for="' . $apartment['id'] . '" style="' . $baseStyle . $textColor . $bgColor . 'transform:' . $rotation . ';cursor:pointer;">' . $apartment['label'] . '</label>
                 </li>';
            }
          }
          ?>
        </ol>
      </li>
      <li class="row row--6">
        <ol class="seats" type="A">
          <?php
          $baseStyle = "color:white;font-weight:bold;text-align:center;border-radius:5px;display:block;padding:15px 10px;";

          foreach ($apartmentk as $index => $apartment) {
            // Default values
            $status = 'Available';
            $title = $apartment['id'];
            $bgColor = "";
            $rotation = "rotate(180deg)";
            $cursor = "pointer";
            $textColor = "color:white;"; // Default text color
          
            // Match with DB apartments to get status
            foreach ($apartments as $db_apartment) {
              if ($db_apartment['title'] == $apartment['id']) {
                $status = $db_apartment['status'];
                break;
              }
            }

            // Assign styles based on index and status
            if ($index == 0) {
              $class = 'seatw';
              $rotation = "rotate(360deg)";
              $bgColor = "background:#0808fe;";
            } elseif ($index > 0 && $index <= 3) {
              $class = 'seat';
              if ($status == 'Booked') {
                $bgColor = "background:red;";
                $textColor = "color:white;";
              } elseif ($status == 'Hold') {
                $bgColor = "background:yellow;";
                $textColor = "color:black;"; // Hold text color black
              } else {
                $bgColor = "background:green;";
                $textColor = "color:white;";
              }
            } elseif ($index == 4) {
              $class = 'seat';
              $bgColor = "background:#0808fe;";
            } elseif ($index == 5) {
              $class = 'seat';
              $rotation = "rotate(360deg)";
              $bgColor = "background:#0808fe;";
            } elseif ($index >= 6 && $index <= 11) {
              $class = 'seatr';
              $rotation = "rotate(360deg)";
              if ($status == 'Booked') {
                $bgColor = "background:red;";
                $textColor = "color:white;";
              } elseif ($status == 'Hold') {
                $bgColor = "background:yellow;";
                $textColor = "color:black;"; // Hold text color black
              } else {
                $bgColor = "background:green;";
                $textColor = "color:white;";
              }
            } elseif ($index == 12) {
              $class = 'seat';
              $rotation = "rotate(180deg)";
              $bgColor = "background:#0808fe;";
            } elseif ($index == 13) {
              $class = 'seat';
              $rotation = "rotate(360deg)";
              $bgColor = "background:#0808fe;";
            }

            // Render HTML for each apartment based on status
            if ($status == 'Booked' || $status == 'Hold') {
              echo '<li class="' . $class . '"><label style="' . $baseStyle . $textColor . $bgColor . 'transform:' . $rotation . ';cursor:not-allowed;">' . strtoupper($status) . '</label></li>';
            } elseif (empty($apartment['id'])) {
              echo '<li class="' . $class . '"><label style="' . $baseStyle . $textColor . $bgColor . 'transform:' . $rotation . ';cursor:default;">' . $apartment['label'] . '</label></li>';
            } else {
              echo '<li class="' . $class . '">
                 <input type="checkbox" id="' . $apartment['id'] . '" />
                 <label for="' . $apartment['id'] . '" style="' . $baseStyle . $textColor . $bgColor . 'transform:' . $rotation . ';cursor:pointer;">' . $apartment['label'] . '</label>
                 </li>';
            }
          }
          ?>
        </ol>
      </li>
      <li class="row row--7">
        <ol class="seats" type="A">
          <?php
          $baseStyle = "color:white;font-weight:bold;text-align:center;border-radius:5px;display:block;padding:15px 10px;";

          foreach ($apartmentl as $index => $apartment) {
            // Default values
            $status = 'Available';
            $title = $apartment['id'];
            $bgColor = "";
            $rotation = "rotate(180deg)";
            $cursor = "pointer";
            $textColor = "color:white;"; // Default text color
          
            // Match with DB apartments to get status
            foreach ($apartments as $db_apartment) {
              if ($db_apartment['title'] == $apartment['id']) {
                $status = $db_apartment['status'];
                break;
              }
            }

            // Assign styles based on index and status
            if ($index == 0) {
              $class = 'seatw';
              $rotation = "rotate(360deg)";
              $bgColor = "background:#0808fe;";
            } elseif ($index > 0 && $index <= 3) {
              $class = 'seat';
              if ($status == 'Booked') {
                $bgColor = "background:red;";
                $textColor = "color:white;";
              } elseif ($status == 'Hold') {
                $bgColor = "background:yellow;";
                $textColor = "color:black;"; // Hold text color black
              } else {
                $bgColor = "background:green;";
                $textColor = "color:white;";
              }
            } elseif ($index == 4) {
              $class = 'seat';
              $bgColor = "background:#0808fe;";
            } elseif ($index == 5) {
              $class = 'seat';
              $rotation = "rotate(360deg)";
              $bgColor = "background:#0808fe;";
            } elseif ($index >= 6 && $index <= 11) {
              $class = 'seatr';
              $rotation = "rotate(360deg)";
              if ($status == 'Booked') {
                $bgColor = "background:red;";
                $textColor = "color:white;";
              } elseif ($status == 'Hold') {
                $bgColor = "background:yellow;";
                $textColor = "color:black;"; // Hold text color black
              } else {
                $bgColor = "background:green;";
                $textColor = "color:white;";
              }
            } elseif ($index == 12) {
              $class = 'seat';
              $rotation = "rotate(180deg)";
              $bgColor = "background:#0808fe;";
            } elseif ($index == 13) {
              $class = 'seat';
              $rotation = "rotate(360deg)";
              $bgColor = "background:#0808fe;";
            }

            // Render HTML for each apartment based on status
            if ($status == 'Booked' || $status == 'Hold') {
              echo '<li class="' . $class . '"><label style="' . $baseStyle . $textColor . $bgColor . 'transform:' . $rotation . ';cursor:not-allowed;">' . strtoupper($status) . '</label></li>';
            } elseif (empty($apartment['id'])) {
              echo '<li class="' . $class . '"><label style="' . $baseStyle . $textColor . $bgColor . 'transform:' . $rotation . ';cursor:default;">' . $apartment['label'] . '</label></li>';
            } else {
              echo '<li class="' . $class . '">
                 <input type="checkbox" id="' . $apartment['id'] . '" />
                 <label for="' . $apartment['id'] . '" style="' . $baseStyle . $textColor . $bgColor . 'transform:' . $rotation . ';cursor:pointer;">' . $apartment['label'] . '</label>
                 </li>';
            }
          }
          ?>
        </ol>
      </li>
      <li class="row row--8">
        <ol class="seats" type="A">
          <?php
          $baseStyle = "color:white;font-weight:bold;text-align:center;border-radius:5px;display:block;padding:15px 10px;";

          foreach ($apartmentm as $index => $apartment) {
            // Default values
            $status = 'Available';
            $title = $apartment['id'];
            $bgColor = "";
            $rotation = "rotate(180deg)";
            $cursor = "pointer";
            $textColor = "color:white;"; // Default text color
          
            // Match with DB apartments to get status
            foreach ($apartments as $db_apartment) {
              if ($db_apartment['title'] == $apartment['id']) {
                $status = $db_apartment['status'];
                break;
              }
            }

            // Assign styles based on index and status
            if ($index == 0) {
              $class = 'seatw';
              $rotation = "rotate(360deg)";
              $bgColor = "background:#0808fe;";
            } elseif ($index > 0 && $index <= 3) {
              $class = 'seat';
              if ($status == 'Booked') {
                $bgColor = "background:red;";
                $textColor = "color:white;";
              } elseif ($status == 'Hold') {
                $bgColor = "background:yellow;";
                $textColor = "color:black;"; // Hold text color black
              } else {
                $bgColor = "background:green;";
                $textColor = "color:white;";
              }
            } elseif ($index == 4) {
              $class = 'seat';
              $bgColor = "background:#0808fe;";
            } elseif ($index == 5) {
              $class = 'seat';
              $rotation = "rotate(360deg)";
              $bgColor = "background:#0808fe;";
            } elseif ($index >= 6 && $index <= 11) {
              $class = 'seatr';
              $rotation = "rotate(360deg)";
              if ($status == 'Booked') {
                $bgColor = "background:red;";
                $textColor = "color:white;";
              } elseif ($status == 'Hold') {
                $bgColor = "background:yellow;";
                $textColor = "color:black;"; // Hold text color black
              } else {
                $bgColor = "background:green;";
                $textColor = "color:white;";
              }
            } elseif ($index == 12) {
              $class = 'seat';
              $rotation = "rotate(180deg)";
              $bgColor = "background:#0808fe;";
            } elseif ($index == 13) {
              $class = 'seat';
              $rotation = "rotate(360deg)";
              $bgColor = "background:#0808fe;";
            }

            // Render HTML for each apartment based on status
            if ($status == 'Booked' || $status == 'Hold') {
              echo '<li class="' . $class . '"><label style="' . $baseStyle . $textColor . $bgColor . 'transform:' . $rotation . ';cursor:not-allowed;">' . strtoupper($status) . '</label></li>';
            } elseif (empty($apartment['id'])) {
              echo '<li class="' . $class . '"><label style="' . $baseStyle . $textColor . $bgColor . 'transform:' . $rotation . ';cursor:default;">' . $apartment['label'] . '</label></li>';
            } else {
              echo '<li class="' . $class . '">
                 <input type="checkbox" id="' . $apartment['id'] . '" />
                 <label for="' . $apartment['id'] . '" style="' . $baseStyle . $textColor . $bgColor . 'transform:' . $rotation . ';cursor:pointer;">' . $apartment['label'] . '</label>
                 </li>';
            }
          }
          ?>
        </ol>
      </li>
      <li class="row row--9">
        <ol class="seats" type="A">
          <?php
          $baseStyle = "color:white;font-weight:bold;text-align:center;border-radius:5px;display:block;padding:15px 10px;";

          foreach ($apartmentn as $index => $apartment) {
            // Default values
            $status = 'Available';
            $title = $apartment['id'];
            $bgColor = "";
            $rotation = "rotate(180deg)";
            $cursor = "pointer";
            $textColor = "color:white;"; // Default text color
          
            // Match with DB apartments to get status
            foreach ($apartments as $db_apartment) {
              if ($db_apartment['title'] == $apartment['id']) {
                $status = $db_apartment['status'];
                break;
              }
            }

            // Assign styles based on index and status
            if ($index == 0) {
              $class = 'seatw';
              $rotation = "rotate(360deg)";
              $bgColor = "background:#0808fe;";
            } elseif ($index > 0 && $index <= 3) {
              $class = 'seat';
              if ($status == 'Booked') {
                $bgColor = "background:red;";
                $textColor = "color:white;";
              } elseif ($status == 'Hold') {
                $bgColor = "background:yellow;";
                $textColor = "color:black;"; // Hold text color black
              } else {
                $bgColor = "background:green;";
                $textColor = "color:white;";
              }
            } elseif ($index == 4) {
              $class = 'seat';
              $bgColor = "background:#0808fe;";
            } elseif ($index == 5) {
              $class = 'seat';
              $rotation = "rotate(360deg)";
              $bgColor = "background:#0808fe;";
            } elseif ($index >= 6 && $index <= 11) {
              $class = 'seatr';
              $rotation = "rotate(360deg)";
              if ($status == 'Booked') {
                $bgColor = "background:red;";
                $textColor = "color:white;";
              } elseif ($status == 'Hold') {
                $bgColor = "background:yellow;";
                $textColor = "color:black;"; // Hold text color black
              } else {
                $bgColor = "background:green;";
                $textColor = "color:white;";
              }
            } elseif ($index == 12) {
              $class = 'seat';
              $rotation = "rotate(180deg)";
              $bgColor = "background:#0808fe;";
            } elseif ($index == 13) {
              $class = 'seat';
              $rotation = "rotate(360deg)";
              $bgColor = "background:#0808fe;";
            }

            // Render HTML for each apartment based on status
            if ($status == 'Booked' || $status == 'Hold') {
              echo '<li class="' . $class . '"><label style="' . $baseStyle . $textColor . $bgColor . 'transform:' . $rotation . ';cursor:not-allowed;">' . strtoupper($status) . '</label></li>';
            } elseif (empty($apartment['id'])) {
              echo '<li class="' . $class . '"><label style="' . $baseStyle . $textColor . $bgColor . 'transform:' . $rotation . ';cursor:default;">' . $apartment['label'] . '</label></li>';
            } else {
              echo '<li class="' . $class . '">
                 <input type="checkbox" id="' . $apartment['id'] . '" />
                 <label for="' . $apartment['id'] . '" style="' . $baseStyle . $textColor . $bgColor . 'transform:' . $rotation . ';cursor:pointer;">' . $apartment['label'] . '</label>
                 </li>';
            }
          }
          ?>
        </ol>
      </li>
      <li class="row row--10">
        <ol class="seats" type="A">
          <?php
          $baseStyle = "color:white;font-weight:bold;text-align:center;border-radius:5px;display:block;padding:15px 10px;";

          foreach ($apartmento as $index => $apartment) {
            // Default values
            $status = 'Available';
            $title = $apartment['id'];
            $bgColor = "";
            $rotation = "rotate(180deg)";
            $cursor = "pointer";
            $textColor = "color:white;"; // Default text color
          
            // Match with DB apartments to get status
            foreach ($apartments as $db_apartment) {
              if ($db_apartment['title'] == $apartment['id']) {
                $status = $db_apartment['status'];
                break;
              }
            }

            // Assign styles based on index and status
            if ($index == 0) {
              $class = 'seatw';
              $rotation = "rotate(360deg)";
              $bgColor = "background:#0808fe;";
            } elseif ($index > 0 && $index <= 3) {
              $class = 'seat';
              if ($status == 'Booked') {
                $bgColor = "background:red;";
                $textColor = "color:white;";
              } elseif ($status == 'Hold') {
                $bgColor = "background:yellow;";
                $textColor = "color:black;"; // Hold text color black
              } else {
                $bgColor = "background:green;";
                $textColor = "color:white;";
              }
            } elseif ($index == 4) {
              $class = 'seat';
              $bgColor = "background:#0808fe;";
            } elseif ($index == 5) {
              $class = 'seat';
              $rotation = "rotate(360deg)";
              $bgColor = "background:#0808fe;";
            } elseif ($index >= 6 && $index <= 11) {
              $class = 'seatr';
              $rotation = "rotate(360deg)";
              if ($status == 'Booked') {
                $bgColor = "background:red;";
                $textColor = "color:white;";
              } elseif ($status == 'Hold') {
                $bgColor = "background:yellow;";
                $textColor = "color:black;"; // Hold text color black
              } else {
                $bgColor = "background:green;";
                $textColor = "color:white;";
              }
            } elseif ($index == 12) {
              $class = 'seat';
              $rotation = "rotate(180deg)";
              $bgColor = "background:#0808fe;";
            } elseif ($index == 13) {
              $class = 'seat';
              $rotation = "rotate(360deg)";
              $bgColor = "background:#0808fe;";
            }

            // Render HTML for each apartment based on status
            if ($status == 'Booked' || $status == 'Hold') {
              echo '<li class="' . $class . '"><label style="' . $baseStyle . $textColor . $bgColor . 'transform:' . $rotation . ';cursor:not-allowed;">' . strtoupper($status) . '</label></li>';
            } elseif (empty($apartment['id'])) {
              echo '<li class="' . $class . '"><label style="' . $baseStyle . $textColor . $bgColor . 'transform:' . $rotation . ';cursor:default;">' . $apartment['label'] . '</label></li>';
            } else {
              echo '<li class="' . $class . '">
                 <input type="checkbox" id="' . $apartment['id'] . '" />
                 <label for="' . $apartment['id'] . '" style="' . $baseStyle . $textColor . $bgColor . 'transform:' . $rotation . ';cursor:pointer;">' . $apartment['label'] . '</label>
                 </li>';
            }
          }
          ?>
        </ol>
      </li>
      <li class="row row--11">
        <ol class="seats" type="A">
          <?php
          $baseStyle = "color:white;font-weight:bold;text-align:center;border-radius:5px;display:block;padding:15px 10px;";

          foreach ($apartmentp as $index => $apartment) {
            // Default values
            $status = 'Available';
            $title = $apartment['id'];
            $bgColor = "";
            $rotation = "rotate(180deg)";
            $cursor = "pointer";
            $textColor = "color:white;"; // Default text color
          
            // Match with DB apartments to get status
            foreach ($apartments as $db_apartment) {
              if ($db_apartment['title'] == $apartment['id']) {
                $status = $db_apartment['status'];
                break;
              }
            }

            // Assign styles based on index and status
            if ($index == 0) {
              $class = 'seatw';
              $rotation = "rotate(360deg)";
              $bgColor = "background:#0808fe;";
            } elseif ($index > 0 && $index <= 3) {
              $class = 'seat';
              if ($status == 'Booked') {
                $bgColor = "background:red;";
                $textColor = "color:white;";
              } elseif ($status == 'Hold') {
                $bgColor = "background:yellow;";
                $textColor = "color:black;"; // Hold text color black
              } else {
                $bgColor = "background:green;";
                $textColor = "color:white;";
              }
            } elseif ($index == 4) {
              $class = 'seat';
              $bgColor = "background:#0808fe;";
            } elseif ($index == 5) {
              $class = 'seat';
              $rotation = "rotate(360deg)";
              $bgColor = "background:#0808fe;";
            } elseif ($index >= 6 && $index <= 11) {
              $class = 'seatr';
              $rotation = "rotate(360deg)";
              if ($status == 'Booked') {
                $bgColor = "background:red;";
                $textColor = "color:white;";
              } elseif ($status == 'Hold') {
                $bgColor = "background:yellow;";
                $textColor = "color:black;"; // Hold text color black
              } else {
                $bgColor = "background:green;";
                $textColor = "color:white;";
              }
            } elseif ($index == 12) {
              $class = 'seat';
              $rotation = "rotate(180deg)";
              $bgColor = "background:#0808fe;";
            } elseif ($index == 13) {
              $class = 'seat';
              $rotation = "rotate(360deg)";
              $bgColor = "background:#0808fe;";
            }

            // Render HTML for each apartment based on status
            if ($status == 'Booked' || $status == 'Hold') {
              echo '<li class="' . $class . '"><label style="' . $baseStyle . $textColor . $bgColor . 'transform:' . $rotation . ';cursor:not-allowed;">' . strtoupper($status) . '</label></li>';
            } elseif (empty($apartment['id'])) {
              echo '<li class="' . $class . '"><label style="' . $baseStyle . $textColor . $bgColor . 'transform:' . $rotation . ';cursor:default;">' . $apartment['label'] . '</label></li>';
            } else {
              echo '<li class="' . $class . '">
                 <input type="checkbox" id="' . $apartment['id'] . '" />
                 <label for="' . $apartment['id'] . '" style="' . $baseStyle . $textColor . $bgColor . 'transform:' . $rotation . ';cursor:pointer;">' . $apartment['label'] . '</label>
                 </li>';
            }
          }
          ?>
        </ol>
      </li>
      <li class="row row--12">
        <ol class="seats" type="A">
          <?php
          $baseStyle = "color:white;font-weight:bold;text-align:center;border-radius:5px;display:block;padding:15px 10px;";

          foreach ($apartmentq as $index => $apartment) {
            // Default values
            $status = 'Available';
            $title = $apartment['id'];
            $bgColor = "";
            $rotation = "rotate(180deg)";
            $cursor = "pointer";
            $textColor = "color:white;"; // Default text color
          
            // Match with DB apartments to get status
            foreach ($apartments as $db_apartment) {
              if ($db_apartment['title'] == $apartment['id']) {
                $status = $db_apartment['status'];
                break;
              }
            }

            // Assign styles based on index and status
            if ($index == 0) {
              $class = 'seatw';
              $rotation = "rotate(360deg)";
              $bgColor = "background:#0808fe;";
            } elseif ($index > 0 && $index <= 3) {
              $class = 'seat';
              if ($status == 'Booked') {
                $bgColor = "background:red;";
                $textColor = "color:white;";
              } elseif ($status == 'Hold') {
                $bgColor = "background:yellow;";
                $textColor = "color:black;"; // Hold text color black
              } else {
                $bgColor = "background:green;";
                $textColor = "color:white;";
              }
            } elseif ($index == 4) {
              $class = 'seat';
              $bgColor = "background:#0808fe;";
            } elseif ($index == 5) {
              $class = 'seat';
              $rotation = "rotate(360deg)";
              $bgColor = "background:#0808fe;";
            } elseif ($index >= 6 && $index <= 11) {
              $class = 'seatr';
              $rotation = "rotate(360deg)";
              if ($status == 'Booked') {
                $bgColor = "background:red;";
                $textColor = "color:white;";
              } elseif ($status == 'Hold') {
                $bgColor = "background:yellow;";
                $textColor = "color:black;"; // Hold text color black
              } else {
                $bgColor = "background:green;";
                $textColor = "color:white;";
              }
            } elseif ($index == 12) {
              $class = 'seat';
              $rotation = "rotate(180deg)";
              $bgColor = "background:#0808fe;";
            } elseif ($index == 13) {
              $class = 'seat';
              $rotation = "rotate(360deg)";
              $bgColor = "background:#0808fe;";
            }

            // Render HTML for each apartment based on status
            if ($status == 'Booked' || $status == 'Hold') {
              echo '<li class="' . $class . '"><label style="' . $baseStyle . $textColor . $bgColor . 'transform:' . $rotation . ';cursor:not-allowed;">' . strtoupper($status) . '</label></li>';
            } elseif (empty($apartment['id'])) {
              echo '<li class="' . $class . '"><label style="' . $baseStyle . $textColor . $bgColor . 'transform:' . $rotation . ';cursor:default;">' . $apartment['label'] . '</label></li>';
            } else {
              echo '<li class="' . $class . '">
                 <input type="checkbox" id="' . $apartment['id'] . '" />
                 <label for="' . $apartment['id'] . '" style="' . $baseStyle . $textColor . $bgColor . 'transform:' . $rotation . ';cursor:pointer;">' . $apartment['label'] . '</label>
                 </li>';
            }
          }
          ?>
        </ol>
      </li>
      <li class="row row--13">
        <ol class="seats" type="A">
          <?php
          $baseStyle = "color:white;font-weight:bold;text-align:center;border-radius:5px;display:block;padding:15px 10px;";

          foreach ($apartmentr as $index => $apartment) {
            // Default values
            $status = 'Available';
            $title = $apartment['id'];
            $bgColor = "";
            $rotation = "rotate(180deg)";
            $cursor = "pointer";
            $textColor = "color:white;"; // Default text color
          
            // Match with DB apartments to get status
            foreach ($apartments as $db_apartment) {
              if ($db_apartment['title'] == $apartment['id']) {
                $status = $db_apartment['status'];
                break;
              }
            }

            // Assign styles based on index and status
            if ($index == 0) {
              $class = 'seatw';
              $rotation = "rotate(360deg)";
              $bgColor = "background:#0808fe;";
            } elseif ($index > 0 && $index <= 3) {
              $class = 'seat';
              if ($status == 'Booked') {
                $bgColor = "background:red;";
                $textColor = "color:white;";
              } elseif ($status == 'Hold') {
                $bgColor = "background:yellow;";
                $textColor = "color:black;"; // Hold text color black
              } else {
                $bgColor = "background:green;";
                $textColor = "color:white;";
              }
            } elseif ($index == 4) {
              $class = 'seat';
              $bgColor = "background:#0808fe;";
            } elseif ($index == 5) {
              $class = 'seat';
              $rotation = "rotate(360deg)";
              $bgColor = "background:#0808fe;";
            } elseif ($index >= 6 && $index <= 11) {
              $class = 'seatr';
              $rotation = "rotate(360deg)";
              if ($status == 'Booked') {
                $bgColor = "background:red;";
                $textColor = "color:white;";
              } elseif ($status == 'Hold') {
                $bgColor = "background:yellow;";
                $textColor = "color:black;"; // Hold text color black
              } else {
                $bgColor = "background:green;";
                $textColor = "color:white;";
              }
            } elseif ($index == 12) {
              $class = 'seat';
              $rotation = "rotate(180deg)";
              $bgColor = "background:#0808fe;";
            } elseif ($index == 13) {
              $class = 'seat';
              $rotation = "rotate(360deg)";
              $bgColor = "background:#0808fe;";
            }

            // Render HTML for each apartment based on status
            if ($status == 'Booked' || $status == 'Hold') {
              echo '<li class="' . $class . '"><label style="' . $baseStyle . $textColor . $bgColor . 'transform:' . $rotation . ';cursor:not-allowed;">' . strtoupper($status) . '</label></li>';
            } elseif (empty($apartment['id'])) {
              echo '<li class="' . $class . '"><label style="' . $baseStyle . $textColor . $bgColor . 'transform:' . $rotation . ';cursor:default;">' . $apartment['label'] . '</label></li>';
            } else {
              echo '<li class="' . $class . '">
                 <input type="checkbox" id="' . $apartment['id'] . '" />
                 <label for="' . $apartment['id'] . '" style="' . $baseStyle . $textColor . $bgColor . 'transform:' . $rotation . ';cursor:pointer;">' . $apartment['label'] . '</label>
                 </li>';
            }
          }
          ?>
        </ol>
      </li>
      <li class="row row--14">
        <ol class="seats" type="A">
          <?php
          $baseStyle = "color:white;font-weight:bold;text-align:center;border-radius:5px;display:block;padding:15px 10px;";

          foreach ($apartmentt as $index => $apartment) {
            // Default values
            $status = 'Available';
            $title = $apartment['id'];
            $bgColor = "";
            $rotation = "rotate(180deg)";
            $cursor = "pointer";
            $textColor = "color:white;"; // Default text color
          
            // Match with DB apartments to get status
            foreach ($apartments as $db_apartment) {
              if ($db_apartment['title'] == $apartment['id']) {
                $status = $db_apartment['status'];
                break;
              }
            }

            // Assign styles based on index and status
            if ($index == 0) {
              $class = 'seatw';
              $rotation = "rotate(360deg)";
              $bgColor = "background:#0808fe;";
            } elseif ($index > 0 && $index <= 3) {
              $class = 'seat';
              if ($status == 'Booked') {
                $bgColor = "background:red;";
                $textColor = "color:white;";
              } elseif ($status == 'Hold') {
                $bgColor = "background:yellow;";
                $textColor = "color:black;"; // Hold text color black
              } else {
                $bgColor = "background:green;";
                $textColor = "color:white;";
              }
            } elseif ($index == 4) {
              $class = 'seat';
              $bgColor = "background:#0808fe;";
            } elseif ($index == 5) {
              $class = 'seat';
              $rotation = "rotate(360deg)";
              $bgColor = "background:#0808fe;";
            } elseif ($index >= 6 && $index <= 11) {
              $class = 'seatr';
              $rotation = "rotate(360deg)";
              if ($status == 'Booked') {
                $bgColor = "background:red;";
                $textColor = "color:white;";
              } elseif ($status == 'Hold') {
                $bgColor = "background:yellow;";
                $textColor = "color:black;"; // Hold text color black
              } else {
                $bgColor = "background:green;";
                $textColor = "color:white;";
              }
            } elseif ($index == 12) {
              $class = 'seat';
              $rotation = "rotate(180deg)";
              $bgColor = "background:#0808fe;";
            } elseif ($index == 13) {
              $class = 'seat';
              $rotation = "rotate(360deg)";
              $bgColor = "background:#0808fe;";
            }

            // Render HTML for each apartment based on status
            if ($status == 'Booked' || $status == 'Hold') {
              echo '<li class="' . $class . '"><label style="' . $baseStyle . $textColor . $bgColor . 'transform:' . $rotation . ';cursor:not-allowed;">' . strtoupper($status) . '</label></li>';
            } elseif (empty($apartment['id'])) {
              echo '<li class="' . $class . '"><label style="' . $baseStyle . $textColor . $bgColor . 'transform:' . $rotation . ';cursor:default;">' . $apartment['label'] . '</label></li>';
            } else {
              echo '<li class="' . $class . '">
                 <input type="checkbox" id="' . $apartment['id'] . '" />
                 <label for="' . $apartment['id'] . '" style="' . $baseStyle . $textColor . $bgColor . 'transform:' . $rotation . ';cursor:pointer;">' . $apartment['label'] . '</label>
                 </li>';
            }
          }
          ?>
        </ol>
      </li>
    </ol>
    <div style="width: 100%; display: flex;">
      <table style="width: 60%; border: 1px solid black;border-radius: 10px;">
        <tr>
          <td>
            <div class="screen-side">
              <h3 class="select-text">30' WIDE ROAD</h3>
            </div>
          </td>
        </tr>
      </table>
      <table style="width: 40%;">
        <tr>
          <td>
            <ol class="cabins">
              <li class="row row--1">
                <ol class="seats" type="A">
                  <?php
                  $total = count($apartmentc);

                  // Ensure $available_apartments is set as an array
                  if (!isset($available_apartments) || !is_array($available_apartments)) {
                    $available_apartments = []; // Set it to an empty array if it's not defined
                  }

                  foreach ($apartmentc as $index => $apartment) {
                    // Default status
                    $status = 'Available';

                    // Loop through the apartments to match the apartment 'id' with 'title' and get the status
                    foreach ($apartments as $db_apartment) {
                      if ($db_apartment['title'] == $apartment['id']) {
                        $status = $db_apartment['status']; // Set the status from the database
                        break;
                      }
                    }

                    // Check if the apartment is available
                    $is_available = in_array($apartment['id'], $available_apartments); // Check if the apartment is available
                  
                    // Assign group class based on index
                    $groupClass = (floor($index / 4) % 2 == 0) ? 'seatv' : 'seata';

                    // First or last apartment for blue
                    $isBlue = ($index == 0 || $index == $total - 1);

                    // Default text color
                    $baseStyle = "color:white";
                    $bgColor = "";
                    $rotation = ($groupClass == 'seatv') ? "rotate(360deg)" : "rotate(180deg)"; // Rotation based on group class
                  
                    // Check for Booked status
                    if ($status == 'Booked') {
                      $bgColor = "background:red;"; // Red for booked apartments
                      echo '<li class="' . $groupClass . '"><label style="' . $baseStyle . 'writing-mode:vertical-rl;transform:' . $rotation . ';' . $bgColor . 'cursor:not-allowed;">BOOKED</label></li>';
                    }
                    // Check for Hold status
                    elseif ($status == 'Hold') {
                      $bgColor = "background:yellow;"; // Yellow for hold apartments
                      echo '<li class="' . $groupClass . '"><label style="' . $baseStyle . 'writing-mode:vertical-rl;transform:' . $rotation . ';' . $bgColor . 'color:black !important;cursor:not-allowed;">ON HOLD</label></li>';
                    }
                    // Check for Blue apartments (first and last)
                    elseif ($isBlue) {
                      $bgColor = "background:#0808fe;"; // Blue background for first and last apartments
                      echo '<li class="' . $groupClass . '"><label style="' . $baseStyle . 'writing-mode:vertical-rl;transform:' . $rotation . ';' . $bgColor . 'cursor:default;">' . $apartment['label'] . '</label></li>';
                    }
                    // Available apartments
                    else {
                      $bgColor = "background:green;"; // Green for available apartments
                      echo '<li class="' . $groupClass . '">
          <input type="checkbox" id="' . $apartment['id'] . '" />
          <label for="' . $apartment['id'] . '" style="' . $baseStyle . 'writing-mode:vertical-rl;transform:' . $rotation . ';' . $bgColor . 'cursor:pointer;">' . $apartment['label'] . '</label>
        </li>';
                    }
                  }
                  ?>
                </ol>
              </li>

              <li class="row row--2">
                <ol class="seats" type="A">
                  <?php
                  $total = count($apartmentd);
                  foreach ($apartmentd as $index => $apartment) {
                    $status = 'Available'; // Default status
                  
                    // Loop through the apartments to match the apartment 'id' with 'title' and get the status
                    foreach ($apartments as $db_apartment) {
                      if ($db_apartment['title'] == $apartment['id']) {
                        $status = $db_apartment['status']; // Set the status from the database
                        break;
                      }
                    }

                    $is_available = in_array($apartment['id'], $available_apartments); // Check if the apartment is available
                    $groupClass = (floor($index / 4) % 2 == 0) ? 'seatv' : 'seata'; // Assign group class based on index
                    $isBlue = ($index == 0 || $index == $total - 1); // First or last apartment for blue
                    $baseStyle = "color:white"; // Default text color
                    $bgColor = "";
                    $rotation = ($groupClass == 'seatv') ? "rotate(360deg)" : "rotate(180deg)"; // Rotation based on group class
                  
                    // Check for Booked status
                    if ($status == 'Booked') {
                      $bgColor = "background:red;"; // Red for booked apartments
                      echo '<li class="' . $groupClass . '"><label style="' . $baseStyle . 'writing-mode:vertical-rl;transform:' . $rotation . ';' . $bgColor . 'cursor:not-allowed;">BOOKED</label></li>';
                    }
                    // Check for Hold status
                    elseif ($status == 'Hold') {
                      $bgColor = "background:yellow;"; // Yellow for hold apartments
                      echo '<li class="' . $groupClass . '"><label style="' . $baseStyle . 'writing-mode:vertical-rl;transform:' . $rotation . ';' . $bgColor . 'color:black !important;cursor:not-allowed;">ON HOLD</label></li>';
                    }
                    // Check for Blue apartments (first and last)
                    elseif ($isBlue) {
                      $bgColor = "background:#0808fe;";
                      echo '<li class="' . $groupClass . '"><label style="' . $baseStyle . 'writing-mode:vertical-rl;transform:' . $rotation . ';' . $bgColor . 'cursor:default;">' . $apartment['label'] . '</label></li>';
                    }
                    else {
                      $bgColor = "background:green;"; 
                      echo '<li class="' . $groupClass . '">
          <input type="checkbox" id="' . $apartment['id'] . '" />
          <label for="' . $apartment['id'] . '" style="' . $baseStyle . 'writing-mode:vertical-rl;transform:' . $rotation . ';' . $bgColor . 'cursor:pointer;">' . $apartment['label'] . '</label>
        </li>';
                    }
                  }
                  ?>
                </ol>
              </li>
              <li class="row row--3">
                <ol class="seats" type="A">
                  <?php
                  $total = count($apartmente); 
                  foreach ($apartmente as $index => $apartment) {
                    $status = 'Available';
                    foreach ($apartments as $db_apartment) {
                      if ($db_apartment['title'] == $apartment['id']) {
                        $status = $db_apartment['status']; 
                        break;
                      }
                    }
                    $is_available = in_array($apartment['id'], $available_apartments); 
                    $groupClass = (floor($index / 4) % 2 == 0) ? 'seatv' : 'seata'; 
                    $isBlue = ($index == 0 || $index == $total - 1);
                    $baseStyle = "color:white"; 
                    $bgColor = "";
                    $rotation = ($groupClass == 'seatv') ? "rotate(360deg)" : "rotate(180deg)"; 
                    if ($status == 'Booked') {
                      $bgColor = "background:red;";
                      echo '<li class="' . $groupClass . '"><label style="' . $baseStyle . 'writing-mode:vertical-rl;transform:' . $rotation . ';' . $bgColor . 'cursor:not-allowed;">BOOKED</label></li>';
                    }
                    elseif ($status == 'Hold') {
                      $bgColor = "background:yellow;"; 
                      $textColor = "color:black !important;"; 
                      echo '<li class="' . $groupClass . '"><label style="' . $baseStyle . $textColor . 'writing-mode:vertical-rl;transform:' . $rotation . ';' . $bgColor . 'cursor:not-allowed;">ON HOLD</label></li>';
                    }
                    elseif ($isBlue) {
                      $bgColor = "background:#0808fe;";
                      echo '<li class="' . $groupClass . '"><label style="' . $baseStyle . 'writing-mode:vertical-rl;transform:' . $rotation . ';' . $bgColor . 'cursor:default;">' . $apartment['label'] . '</label></li>';
                    }
                    else {
                      $bgColor = "background:green;";
                      echo '<li class="' . $groupClass . '">
          <input type="checkbox" id="' . $apartment['id'] . '" />
          <label for="' . $apartment['id'] . '" style="' . $baseStyle . 'writing-mode:vertical-rl;transform:' . $rotation . ';' . $bgColor . 'cursor:pointer;">' . $apartment['label'] . '</label>
        </li>';
                    }
                  }
                  ?>
                </ol>
              </li>
            </ol>
          </td>
        </tr>
      </table>
    </div>
    <div class="exit exit--back">
    </div>
<div class="side-road-wrapper">
  <div class="road-box"></div>
  <div class="road-label">ROAD</div>
  <div class="road-box"></div>
  <div class="road-angle"></div>
</div>
  </div>
</body>
</html>
<div id="popup" class="popup">
  <div class="popup-content">
    <span class="close-btn" onclick="closePopup()">&times;</span>
    <h1>You Are selected</h1>
    <h2><span id="selectedFloor"></span></h2>
    <h4>Limited Time Offer!</h4>
    <h6>Hurry up! Offer ends in:</h6>
    <h6>00d : 23h : 59m</h6>
    <div class="button-container">
      <button onclick="closePopup()" style="background-color: #000;">Close</button>
      <button onclick="continueSelection()">Continue</button>
    </div>
  </div>
</div>
<style>
  .popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
  }
  .popup-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    width: 500px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    position: relative;
  }
  .button-container {
    display: flex;
    justify-content: center;
    gap: 10px;
  }
  button {
    padding: 13px 20px;
    background-color: #008300;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    width: 130px;
  }
  button:hover {
    background-color: #00796b;
  }
  .close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 20px;
    cursor: pointer;
  }
  .seate label {
    display: block;
    text-align: center;
    font-weight: bold;
    padding: 15px;
    border-radius: 5px;
    background: #008300;
    color: white;
    cursor: pointer;
    transition: 0.3s;
  }
  .seate input[type="checkbox"]:checked+label {
    background: #f9f903;
    color: black;
    animation: rubberBand 300ms both;
  }
  @keyframes rubberBand {
    0% {
      transform: scale3d(1, 1, 1);
    }

    30% {
      transform: scale3d(1.25, 0.75, 1);
    }

    40% {
      transform: scale3d(0.75, 1.25, 1);
    }

    50% {
      transform: scale3d(1.15, 0.85, 1);
    }

    65% {
      transform: scale3d(0.95, 1.05, 1);
    }

    75% {
      transform: scale3d(1.05, 0.95, 1);
    }

    100% {
      transform: scale3d(1, 1, 1);
    }
  }
</style>
<script>
  let selectedInput = null;

  document.querySelectorAll('.seate input').forEach(input => {
    input.addEventListener('click', function () {
      selectedInput = this;
      const selectedId = this.id;
      document.getElementById('selectedFloor').textContent = selectedId;
      showPopup();
    });
  });
  document.querySelectorAll('.seat input').forEach(input => {
    input.addEventListener('click', function () {
      selectedInput = this;
      const selectedId = this.id;
      document.getElementById('selectedFloor').textContent = selectedId;
      showPopup();
    });
  });
  document.querySelectorAll('.seatr input').forEach(input => {
    input.addEventListener('click', function () {
      selectedInput = this;
      const selectedId = this.id;
      document.getElementById('selectedFloor').textContent = selectedId;
      showPopup();
    });
  });
  document.querySelectorAll('.seata input').forEach(input => {
    input.addEventListener('click', function () {
      selectedInput = this;
      const selectedId = this.id;
      document.getElementById('selectedFloor').textContent = selectedId;
      showPopup();
    });
  });
    document.querySelectorAll('.seatv input').forEach(input => {
    input.addEventListener('click', function () {
      selectedInput = this;
      const selectedId = this.id;
      document.getElementById('selectedFloor').textContent = selectedId;
      showPopup();
    });
  });
  function showPopup() {
    document.getElementById('popup').style.display = 'flex';
  }
  function closePopup() {
    document.getElementById('popup').style.display = 'none';
    if (selectedInput) {
      selectedInput.checked = false;
      const label = document.querySelector(`label[for="${selectedInput.id}"]`);
      if (label) label.style.backgroundColor = '#008300'; // revert to green
    }
  }
  function continueSelection() {
    const selectedId = document.getElementById('selectedFloor').textContent;
    const url = `submitproperty.php?apartment_id=${encodeURIComponent(selectedId)}`;
    window.location.href = url;
  }
</script>
<style>
  *,
  *:before,
  *:after {
    box-sizing: border-box;
  }
  ::selection {
    background-color: #eee;
  }
  ::-moz-selection {
    background-color: #eee;
  }
  body {
    font-size: 16px;
    background-color: #269686;
  }
  .theatre {
    margin: 20px auto;
    width: 100%;
    max-width: 100%;
    border-radius: 5px;
    background-color: #fff;
    padding: 20px 80px 10px 10px;
    box-shadow: 0px 0px 17px -4px #000;
  }
  @media screen and (max-width:768px) {
    .theatre {
      margin: 20px auto;
      width: 990px !important;
      max-width: 990px !important;
      border-radius: 5px;
      background-color: #fff;
      padding: 20px 10px;
      box-shadow: 0px 0px 17px -4px #000;
    }
  }
  .screen-side {
    text-align: center;
  }
  .screen-side .screen {
    height: 25px;
    margin: 0 20px;
    border-radius: 50%;
    box-shadow: 0px -3px 0px 1px #ccc;
    color: #ccc;
  }
  .screen-side .select-text {
    font-size: 20px;
    color: #000000;
  }
  .exit {
    position: relative;
    height: 50px;
  }
  .exit:before,
  .exit:after {
    content: "EXIT";
    font-size: 14px;
    line-height: 18px;
    padding: 0px 5px;
    font-family: "Arial Narrow", Arial, sans-serif;
    display: block;
    position: absolute;
    background: #81c784;
    color: white;
    top: 50%;
    transform: translate(0, -50%);
  }
  .exit:before {
    left: 0;
  }
  .exit:after {
    right: 0;
  }
  ol {
    list-style: none;
    padding: 0;
    margin: 0;
  }
  .seats {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: flex-start;
  }
  .seat {
    display: flex;
    flex: 0 0 4.9%;
    padding: 2px;
    position: relative;
  }
  .seat:nth-child(5) {
    margin-right: 26.28571%;

  }
  .seat input[type="checkbox"] {
    position: absolute;
    opacity: 0;
  }
  .seat input[type="checkbox"]:checked+label {
    background: #f9f903;
    color: black;
    -webkit-animation-name: rubberBand;
    animation-name: rubberBand;
    animation-duration: 300ms;
    animation-fill-mode: both;
  }
  .seat label {
    display: block;
    position: relative;
    width: 100%;
    text-align: center;
    font-size: 14px;
    font-weight: bold;
    line-height: 1.5rem;
    padding: 15px 9px;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    color: #fff;
    background: #008300;
    border-radius: 2px;
    animation-duration: 300ms;
    animation-fill-mode: both;
    transition-duration: 300ms;
  }
  @media screen and (max-width: 768px) {
    .seat label {
      padding: 15px 10px;
    }
  }
  .seat label:hover {
    cursor: pointer;
    box-shadow: 0px 0 7px 3px #ccc;
  }
  /* seate */
  .seates {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: flex-start;
  }
  .seate {
    display: flex;
    flex: 0 0 7.1%;
    padding: 2px;
    position: relative;
  }
  .seate:nth-child(14) {
    margin-right: 14.28571%;
  }
  .seate input[type="checkbox"] {
    position: absolute;
    opacity: 0;
  }
  .seate input[type="checkbox"]:checked+label {
    background: #f9f903;
    color: black;
    -webkit-animation-name: rubberBand;
    animation-name: rubberBand;
    animation-duration: 300ms;
    animation-fill-mode: both;
  }
  .seate label {
    display: block;
    position: relative;
    width: 100%;
    text-align: center;
    font-size: 14px;
    font-weight: bold;
    line-height: 1.5rem;
    padding: 8px 0;
    color: #fff;
    background: #008300;
    border-radius: 2px;
    animation-duration: 300ms;
    animation-fill-mode: both;
    transition-duration: 300ms;
  }
  .seate label:hover {
    cursor: pointer;
    box-shadow: 0px 0 7px 3px #ccc;
  }
  @media screen and (max-width: 768px) {
    .seate label {
      font-size: 6px;
    }

  }
  /* seatw */
  .seates {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: flex-start;
  }
  .seatw {
    display: flex;
    flex: 0 0 14.1%;
    padding: 2px;
    position: relative;
  }
  .seatw:nth-child(14) {
    margin-right: 14.28571%;
  }
  .seatw input[type="checkbox"] {
    position: absolute;
    opacity: 0;
  }
  .seatw input[type="checkbox"]:checked+label {
    background: #f9f903;
    color: black;
    -webkit-animation-name: rubberBand;
    animation-name: rubberBand;
    animation-duration: 300ms;
    animation-fill-mode: both;
  }
  .seatw label {
    display: block;
    position: relative;
    width: 100%;
    text-align: center;
    font-size: 15px;
    font-weight: bold;
    line-height: 5.5rem;
    padding: 4px 0;
    color: #fff;
    background: #008300;
    border-radius: 2px;
    animation-duration: 300ms;
    animation-fill-mode: both;
    transition-duration: 300ms;
  }

  .seatw label:hover {
    cursor: pointer;
    box-shadow: 0px 0 7px 3px #ccc;
  }

  /* seata */

  .seates {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: flex-start;
  }

  .seata {
    display: flex;
    flex: 0 0 12.3%;
    padding: 2px;
    position: relative;
  }

  .seata:nth-child(14) {
    margin-right: 14.28571%;
  }

  .seata input[type="checkbox"] {
    position: absolute;
    opacity: 0;
  }

  .seata input[type="checkbox"]:checked+label {
    background: #f9f903;
    color: black;
    -webkit-animation-name: rubberBand;
    animation-name: rubberBand;
    animation-duration: 300ms;
    animation-fill-mode: both;
  }

  .seata label {
    display: block;
    position: relative;
    width: 100%;
    text-align: center;
    font-size: 14px;
    font-weight: bold;
    line-height: 1.5rem;
    padding: 15px 10px;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    color: #fff;
    background: #008300;
    border-radius: 2px;
    animation-duration: 300ms;
    animation-fill-mode: both;
    transition-duration: 300ms;
  }

  @media screen and (max-width: 768px) {
    .seata label {
      padding: 15px 10px !important;
    }
  }

  .seata label:hover {
    cursor: pointer;
    box-shadow: 0px 0 7px 3px #ccc;
  }




    /* seata */

  .seates {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: flex-start;
  }

  .seatv {
    display: flex;
    flex: 0 0 12.3%;
    padding: 2px;
    position: relative;
  }

  .seatv:nth-child(14) {
    margin-right: 14.28571%;
  }

  .seatv input[type="checkbox"] {
    position: absolute;
    opacity: 0;
  }

  .seatv input[type="checkbox"]:checked+label {
    background: #f9f903;
    color: black;
    -webkit-animation-name: rubberBand;
    animation-name: rubberBand;
    animation-duration: 300ms;
    animation-fill-mode: both;
  }

  .seatv label {
    display: block;
    position: relative;
    width: 100%;
    text-align: center;
    font-size: 14px;
    font-weight: bold;
    line-height: 1.5rem;
    padding: 15px 10px;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    color: #fff;
    background: #008300;
    border-radius: 2px;
    animation-duration: 300ms;
    animation-fill-mode: both;
    transition-duration: 300ms;
  }

  @media screen and (max-width: 768px) {
    .seatv label {
      padding: 15px 10px !important;
    }
  }

  .seatv label:hover {
    cursor: pointer;
    box-shadow: 0px 0 7px 3px #ccc;
  }

  /* seatr */

  .seatr {
    display: flex;
    flex: 0 0 4.9%;
    padding: 2px;
    position: relative;
  }
  .seat:nth-child(5) {
    margin-right: 26.28571%;

  }
  .seatr input[type="checkbox"] {
    position: absolute;
    opacity: 0;
  }
  .seatr input[type="checkbox"]:checked+label {
    background: #f9f903;
    color: black;
    -webkit-animation-name: rubberBand;
    animation-name: rubberBand;
    animation-duration: 300ms;
    animation-fill-mode: both;
  }
  .seatr label {
    display: block;
    position: relative;
    width: 100%;
    text-align: center;
    font-size: 14px;
    font-weight: bold;
    line-height: 1.9rem;
    padding: 15px 15px;
    writing-mode: vertical-rl;
    transform: rotate(360deg);
    color: #fff;
    background: #008300;
    border-radius: 2px;
    animation-duration: 300ms;
    animation-fill-mode: both;
    transition-duration: 300ms;
  }
  @media screen and (max-width: 768px) {
    .seatr label {
      padding: 15px 5px;
    }
  }
  .seatr label:hover {
    cursor: pointer;
    box-shadow: 0px 0 7px 3px #ccc;
  }


  
  .seates {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: flex-start;
  }
  .seatx {
    display: flex;
    flex: 0 0 10%;
    padding: 5px;
    position: relative;
  }
  .seatx:nth-child(14) {
    margin-right: 14.28571%;
  }
  .seatx input[type="checkbox"] {
    position: absolute;
    opacity: 0;
  }
  .seatx input[type="checkbox"]:checked+label {
    background: #f9f903;
    color: black;
    -webkit-animation-name: rubberBand;
    animation-name: rubberBand;
    animation-duration: 300ms;
    animation-fill-mode: both;
  }
  .seatx label {
    display: block;
    position: relative;
    width: 100%;
    text-align: center;
    font-size: 15px;
    font-weight: bold;
    line-height: 6.5rem;
    padding: 4px 0;
    color: #fff;
    background: #008300;
    border-radius: 2px;
    animation-duration: 300ms;
    animation-fill-mode: both;
    transition-duration: 300ms;
  }
  .seatx label:hover {
    cursor: pointer;
    box-shadow: 0px 0 7px 3px #ccc;
  }
  @-webkit-keyframes rubberBand {
    0% {
      -webkit-transform: scale3d(1, 1, 1);
      transform: scale3d(1, 1, 1);
    }
    30% {
      -webkit-transform: scale3d(1.25, 0.75, 1);
      transform: scale3d(1.25, 0.75, 1);
    }
    40% {
      -webkit-transform: scale3d(0.75, 1.25, 1);
      transform: scale3d(0.75, 1.25, 1);
    }
    50% {
      -webkit-transform: scale3d(1.15, 0.85, 1);
      transform: scale3d(1.15, 0.85, 1);
    }
    65% {
      -webkit-transform: scale3d(0.95, 1.05, 1);
      transform: scale3d(0.95, 1.05, 1);
    }
    75% {
      -webkit-transform: scale3d(1.05, 0.95, 1);
      transform: scale3d(1.05, 0.95, 1);
    }
    100% {
      -webkit-transform: scale3d(1, 1, 1);
      transform: scale3d(1, 1, 1);
    }
  }
  @keyframes rubberBand {
    0% {
      -webkit-transform: scale3d(1, 1, 1);
      transform: scale3d(1, 1, 1);
    }

    30% {
      -webkit-transform: scale3d(1.25, 0.75, 1);
      transform: scale3d(1.25, 0.75, 1);
    }

    40% {
      -webkit-transform: scale3d(0.75, 1.25, 1);
      transform: scale3d(0.75, 1.25, 1);
    }

    50% {
      -webkit-transform: scale3d(1.15, 0.85, 1);
      transform: scale3d(1.15, 0.85, 1);
    }

    65% {
      -webkit-transform: scale3d(0.95, 1.05, 1);
      transform: scale3d(0.95, 1.05, 1);
    }

    75% {
      -webkit-transform: scale3d(1.05, 0.95, 1);
      transform: scale3d(1.05, 0.95, 1);
    }

    100% {
      -webkit-transform: scale3d(1, 1, 1);
      transform: scale3d(1, 1, 1);
    }
  }
  .rubberBand {
    -webkit-animation-name: rubberBand;
    animation-name: rubberBand;
  }
</style>
<style>
.cabin {
  position: relative;
}
.cabin::after {
  content: "PARK AREA";
  position: absolute;
  left: 47%;
  transform: translateX(-50%) rotate(180deg);
  top: 0px;
  bottom: 0px;
  width: 25%;
  background: #3cb371;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 28px;
  letter-spacing: 6px;
  color: white;
  border-radius: 5px;
  writing-mode: vertical-rl;
  pointer-events: none;
  z-index: 0;
}
.cabin::before {
  content: "";
  position: absolute;
  left: 47%;
  transform: translateX(-50%);
  top: 20px;
  bottom: 20px;
  width: 22%;
  border: 2px dashed rgba(255,255,255,0.7);
  border-radius: 20px;
  pointer-events: none;
  z-index: 1;
}

.seat,
.seatr,
.seata,
.seate,
.seatv,
.seatw {
  position: relative;
  z-index: 5;
}

</style>
<style>
.theatre {
  position: relative;
}
.theatre::before {
  content: "SIDE PARK";
  position: absolute;
  right: 4;
  top: 130px;
  bottom: 80px;
  width: 78px;
  height : 600px;
  background: #2ecc71;
  display: flex;
  align-items: center;
  justify-content: center;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  color: white;
  font-weight: bold;
  letter-spacing: 3px;
  font-size: 14px;
  border-radius: 3px;
  pointer-events: none;
  z-index: 0;
}
.theatre::after {
  content: "";
  position: absolute;
  right: 20px;
  top: 150px;
  bottom: 200px;
  height: 550px;
  width: 44px;
  border: 2px dashed rgba(255,255,255,0.6);
  border-radius: 5px;
  pointer-events: none;
  z-index: 1;
}

/* =========================
   SIDE ROAD STRUCTURE
   ========================= */

.side-road-wrapper {
  position: absolute;
  right: 4px;
  top: 735px;     
  width: 78px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  z-index: 2;
}

/* rectangular road blocks */
.road-box {
  width: 70px;
  height: 785px;
  background: #ffffff;
  border: 1.5px solid #bdbdbd;
  border-radius: 5px;
  position: relative;
}

/* inner grid lines */
.road-box::before,
.road-box::after {
  content: "";
  position: absolute;
  background: #cfcfcf;
}

.road-box::before {
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
}

.road-box::after {
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
}

/* ROAD text */
.road-label {
  font-weight: bold;
  font-size: 14px;
  color: #000;
  letter-spacing: 1px;
}

/* angled road at bottom */
.road-angle {
  width: 80px;
  height: 60px;
  border-left: 1.5px solid #bdbdbd;
  border-bottom: 1.5px solid #bdbdbd;
  border-radius: 0 0 0 12px;
  transform: skewX(-20deg);
  margin-left: 20px;
  background: transparent;
}

</style>