/* ============================================================
   TQM Itinerary Template Engine — CSS
   ============================================================ */

/* ── ADMIN: Edit Grid ──────────────────────────────────────── */
.tqm-itin-edit-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 20px;
    align-items: start;
    margin-top: 16px;
}
.tqm-itin-meta-box,
.tqm-itin-days-box {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}
.tqm-itin-meta-inner { padding: 20px 22px; }
.tqm-box-title {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    gap: 8px;
}
#tqm-day-count-badge {
    background: #eff6ff;
    color: #1a56db;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 50px;
    margin-left: auto;
}
.tqm-form-row { margin-bottom: 16px; }
.tqm-form-row label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: .4px;
}
.tqm-form-row label .req { color: #e53e3e; }
.tqm-form-row select,
.tqm-form-row input[type="text"],
.tqm-form-row input[type="url"] {
    width: 100%;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    box-sizing: border-box;
    transition: border-color .2s;
}
.tqm-form-row select:focus,
.tqm-form-row input:focus {
    outline: none;
    border-color: #1a56db;
    box-shadow: 0 0 0 3px rgba(26,86,219,.08);
}
.tqm-dur-info {
    display: flex;
    gap: 12px;
    padding: 10px 14px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #64748b;
}
.tqm-dur-info span { display: flex; align-items: center; gap: 5px; }
.tqm-dur-info strong { color: #0f172a; font-size: 18px; }
.tqm-form-actions { display: flex; gap: 8px; margin-top: 20px; }

/* ── ADMIN: Day Repeater ───────────────────────────────────── */
.tqm-day-row {
    background: #fafbfc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 12px;
    overflow: hidden;
    transition: border-color .2s;
}
.tqm-day-row:hover { border-color: #93c5fd; }
.tqm-day-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
}
.tqm-day-num {
    font-size: 12px;
    font-weight: 800;
    color: #1a56db;
    background: #eff6ff;
    padding: 3px 10px;
    border-radius: 50px;
    white-space: nowrap;
    flex-shrink: 0;
}
.tqm-day-title {
    flex: 1;
    border: 1.5px solid #e2e8f0;
    border-radius: 7px;
    padding: 7px 10px;
    font-size: 13px;
    font-weight: 600;
    transition: border-color .2s;
}
.tqm-day-title:focus {
    outline: none;
    border-color: #1a56db;
    box-shadow: 0 0 0 3px rgba(26,86,219,.08);
}
.tqm-remove-day {
    background: none;
    border: 1.5px solid #e2e8f0;
    color: #94a3b8;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all .2s;
}
.tqm-remove-day:hover { background: #fef2f2; border-color: #e53e3e; color: #e53e3e; }
.tqm-day-desc {
    width: 100%;
    border: none;
    padding: 12px 14px;
    font-size: 13px;
    line-height: 1.6;
    resize: vertical;
    background: transparent;
    box-sizing: border-box;
    color: #334155;
    font-family: inherit;
}
.tqm-day-desc:focus { outline: 2px solid #93c5fd; outline-offset: -2px; }
.tqm-repeater-actions { margin-top: 8px; display: flex; align-items: center; }

/* ── ADMIN: List Table ─────────────────────────────────────── */
.tqm-dur-pill {
    background: #eff6ff;
    color: #1a56db;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 50px;
    display: inline-block;
}
.tqm-actions { display: flex; gap: 5px; flex-wrap: wrap; }
.tqm-itin-table td, .tqm-itin-table th { vertical-align: middle; }

/* ── ADMIN: Preview Modal ──────────────────────────────────── */
.tqm-preview-itinerary .tqm-pi-day {
    border-left: 3px solid #1a56db;
    margin-bottom: 18px;
    padding-left: 16px;
}
.tqm-pi-day-num {
    font-size: 11px;
    font-weight: 800;
    color: #1a56db;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 4px;
}
.tqm-pi-day-title { font-size: 15px; font-weight: 700; color: #0f172a; margin-bottom: 6px; }
.tqm-pi-day-desc { font-size: 13px; color: #475569; line-height: 1.65; }

/* ── PUBLIC: Destination Select ────────────────────────────── */
#tqm-destination-select-wrap,
#tqm-duration-wrap {
    margin-bottom: 20px;
}
.tqm-select-label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 8px;
}
.tqm-select-label .req { color: #e53e3e; }
.tqm-select-styled {
    width: 100%;
    padding: 13px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    font-family: inherit;
    color: #334155;
    background: #fff;
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 38px;
}
.tqm-select-styled:focus {
    outline: none;
    border-color: #1a56db;
    box-shadow: 0 0 0 4px rgba(26,86,219,.1);
}
.tqm-loading .tqm-select-styled { opacity: .6; }

/* ── PUBLIC: Itinerary Preview ─────────────────────────────── */
#tqm-itinerary-preview {
    margin-top: 16px;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    animation: tqm-fadein .3s ease;
}
.tqm-itin-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 24px;
    color: #94a3b8;
    font-size: 13px;
}
.tqm-itin-spin {
    width: 18px;
    height: 18px;
    border: 2px solid #e2e8f0;
    border-top-color: #1a56db;
    border-radius: 50%;
    animation: tqm-spin .6s linear infinite;
    flex-shrink: 0;
}
@keyframes tqm-spin { to { transform: rotate(360deg); } }
.tqm-itin-header {
    background: linear-gradient(135deg, #0f172a, #1e3a8a);
    color: #fff;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
}
.tqm-itin-title { font-size: 14px; font-weight: 700; }
.tqm-itin-sub { font-size: 12px; color: rgba(255,255,255,.65); }
.tqm-itin-empty { padding: 20px; color: #94a3b8; font-size: 13px; text-align: center; }

/* ── PUBLIC: Accordion ─────────────────────────────────────── */
.tqm-itin-accordion { background: #fff; }
.tqm-acc-item {
    border-bottom: 1px solid #f1f5f9;
}
.tqm-acc-item:last-child { border-bottom: none; }
.tqm-acc-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background .15s;
    user-select: none;
}
.tqm-acc-header:hover { background: #f8fafc; }
.tqm-acc-item.open .tqm-acc-header { background: #f0f9ff; }
.tqm-acc-day {
    font-size: 11px;
    font-weight: 800;
    color: #1a56db;
    background: #eff6ff;
    padding: 2px 9px;
    border-radius: 50px;
    flex-shrink: 0;
    white-space: nowrap;
}
.tqm-acc-title {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
}
.tqm-acc-arrow {
    color: #94a3b8;
    font-size: 10px;
    flex-shrink: 0;
}
.tqm-acc-body {
    padding: 0 16px 14px 16px;
    font-size: 13px;
    color: #475569;
    line-height: 1.7;
    background: #fafcff;
}
.tqm-acc-body p { margin: 0; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 782px) {
    .tqm-itin-edit-grid { grid-template-columns: 1fr; }
}
