/* ===========================================================
📄 TCN SINGLE PAGE STYLES (Trip / Request only)
Table styles, white box layout, image gallery
=========================================================== */

/* White Box Layout */
.tcn-single {
  background: #ffffff;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
  margin-bottom: 30px;
}

.tcn-single p,
.tcn-single li {
  font-size: 15px;
  margin: 6px 0;
}

.tcn-single ul {
  margin: 10px 0 0;
  padding-left: 1.4rem;
}

/* Table Container */
.tcn-table-container {
  overflow-x: auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  padding: 1rem;
  margin: 32px auto;
  max-width: 1000px;
}

.tcn-table-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #1a202c;
}

/* Table Core */
.tcn-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 700px;
  font-size: 15px;
  color: #4b5563;
}

.tcn-table th,
.tcn-table td {
  padding: 12px;
  border-bottom: 1px solid #e5e7eb;
  vertical-align: middle;
}

.tcn-table thead th {
  font-weight: 600;
  background-color: #f9fafb;
  border-bottom: 2px solid #e5e7eb;
  color: #4b5563;
}

.tcn-table td.center,
.tcn-table th.center {
  text-align: center;
}

.tcn-table tbody tr:hover {
  background-color: #f7fafc;
}

/* Image Gallery (Optional) */
.tcn-gallery-featured {
  width: 100%;
  max-width: 600px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #ddd;
  margin-bottom: 20px;
}

.tcn-gallery-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 15px;
}

.tcn-thumb {
  width: 90px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border 0.2s ease;
}

.tcn-thumb.active {
  border-color: #3182ce;
}

/* Responsive */
@media screen and (max-width: 768px) {
  .tcn-table {
    font-size: 14px;
  }

  .tcn-table th,
  .tcn-table td {
    padding: 10px;
  }

  .tcn-gallery-featured {
    aspect-ratio: auto;
    height: auto;
  }

  .tcn-thumb {
    width: 70px;
    height: 50px;
  }
}
/*important css*/

    .tcn-edit-container {
        max-width: 800px;
        margin: 40px auto;
        background: #fff;
        padding: 25px 30px;
        border-radius: 8px;
        box-shadow: 0 0 15px rgba(0,0,0,0.1);
        font-family: Arial, sans-serif;
        direction: <?php echo (get_locale() === 'ar') ? 'rtl' : 'ltr'; ?>;
    }

    .tcn-edit-container h1 {
        text-align: center;
        margin-bottom: 30px;
        font-size: 28px;
        color: #333;
    }

    .tcn-edit-container label {
        font-weight: bold;
        display: block;
        margin-bottom: 6px;
        color: #222;
    }

    .tcn-edit-container input[type="text"],
    .tcn-edit-container input[type="date"],
    .tcn-edit-container input[type="number"],
    .tcn-edit-container input[type="file"],
    .tcn-edit-container input[type="email"],
    .tcn-edit-container select,
    .tcn-edit-container textarea {
        width: 100%;
        padding: 10px;
        margin-bottom: 15px;
        border: 1px solid #ccc;
        border-radius: 4px;
        font-size: 15px;
        box-sizing: border-box;
    }

    .tcn-edit-container textarea {
        resize: vertical;
        min-height: 80px;
    }

    .tcn-edit-container input[type="checkbox"],
    .tcn-edit-container input[type="radio"] {
        transform: scale(1.1);
        margin-right: 6px;
    }

    .tcn-edit-container button[type="submit"] {
        background-color: #0073aa;
        color: white;
        padding: 12px;
        border: none;
        border-radius: 4px;
        width: 100%;
        font-size: 16px;
        cursor: pointer;
    }

    .tcn-edit-container button[type="submit"]:hover {
        background-color: #005f8d;
    }

    .tcn-edit-container .tcn-captcha img {
        max-width: 180px;
        display: block;
        margin-top: 10px;
    }

    .tcn-edit-container .image-gallery {
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
        margin-bottom: 20px;
    }

    .tcn-edit-container .image-gallery div {
        border: 1px solid #ddd;
        padding: 10px;
        border-radius: 6px;
        text-align: center;
        width: 120px;
    }

    .tcn-edit-container .image-gallery img {
        width: 100px;
        height: auto;
        border-radius: 4px;
        margin-bottom: 6px;
    }

/* ==== MOBILE FIXES: keep chat usable inside Trip/Request pages ==== */
@media (max-width: 768px) {
  /* 1) Let the chat use full width inside white box */
  .tcn-single .chat-container {
    width: 100%;
    max-width: 100%;
  }

  /* 2) Reduce inner padding so controls don’t get squeezed */
  .tcn-single {
    padding: 14px;
  }

  /* 3) Make sure flex children can actually shrink */
  .tcn-single .chat-main { min-width: 0; }
  .tcn-single #chat-input-box { min-width: 0; }

  /* 4) Keep the input row pinned and above anything else in the card */
  .tcn-single .chat-input {
    position: sticky;
    bottom: 0;
    z-index: 5;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  }

  /* 5) Ensure the Send button never collapses */
  .tcn-single #send-chat-btn {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 10px 14px;
  }

  /* 6) Give the textarea room but allow shrink */
  .tcn-single #chat-input-box {
    flex: 1 1 auto;
    width: 100%;
    min-height: 44px;
    font-size: 15px;
  }

  /* 7) If the chat sits next to big tables, stop horizontal pressure */
  .tcn-single .tcn-table-container { max-width: 100%; }
  .tcn-single .tcn-table { min-width: 600px; } /* was 700px; reduces horizontal scroll pressure */
}

/* Extra safety: if any parent uses overflow hidden, keep the footer above it */
.tcn-single .chat-container,
.tcn-single .chat-main,
.tcn-single .chat-messages,
.tcn-single .chat-input {
  box-sizing: border-box;
  max-width: 100%;
  overflow-x: hidden;
}
