/* =============================================================
   Cruise Schedule CGH – Frontend Styles
   ============================================================= */

/* ---- Base --------------------------------------------------- */
.csc-wrap {
    font-family: inherit;
    color: inherit;
    margin: 0 0 2rem;
}

.csc-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
}

.csc-subtitle {
    color: #666;
    font-size: 0.95rem;
    margin: 0 0 1.25rem;
}

.csc-empty {
    background: #f8f9fa;
    border: 1px solid #e2e6ea;
    border-radius: 6px;
    padding: 1.5rem;
    text-align: center;
    color: #666;
    font-style: italic;
}

.csc-count {
    font-size: 0.85rem;
    color: #888;
    margin: 0.5rem 0 0;
}

/* ---- Table -------------------------------------------------- */
.csc-table-wrap {
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.csc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    background: #fff;
}

.csc-table thead tr {
    background: #1a3a5c;
    color: #fff;
}

.csc-table thead th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
    border: none;
}

.csc-table tbody tr {
    border-bottom: 1px solid #eef0f2;
    transition: background 0.15s;
}

.csc-table tbody tr:hover {
    background: #f0f6ff;
}

.csc-table tbody tr:last-child {
    border-bottom: none;
}

.csc-table td {
    padding: 0.7rem 1rem;
    vertical-align: middle;
    border: none;
}

.csc-ship-name {
    font-weight: 600;
    color: #1a3a5c;
}

.csc-datetime {
    white-space: nowrap;
}

.csc-datetime .csc-date {
    display: block;
    font-size: 0.85rem;
    color: #555;
}

.csc-datetime .csc-time {
    font-weight: 600;
    font-size: 1rem;
}

.csc-no-results {
    text-align: center;
    padding: 2rem !important;
    color: #888;
    font-style: italic;
}

/* ---- Terminal Badges ---------------------------------------- */
.csc-terminal-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

.terminal-cc1 { background: #dbeafe; color: #1e40af; }
.terminal-cc2 { background: #dcfce7; color: #166534; }
.terminal-cc3 { background: #fef9c3; color: #854d0e; }
.terminal-ccb { background: #fce7f3; color: #9d174d; }
.terminal-sw  { background: #ede9fe; color: #5b21b6; }
.terminal-other { background: #f1f5f9; color: #475569; }

/* ---- Terminal title badge ---------------------------------- */
.csc-title-badge {
    font-size: 0.75rem;
    vertical-align: middle;
    margin-right: 0.4rem;
    position: relative;
    top: -2px;
}
.csc-day-group {
    margin-bottom: 2rem;
}

.csc-day-heading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a3a5c;
    margin: 0 0 0.5rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid #1a3a5c;
}

.csc-day-count {
    background: #1a3a5c;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
}

/* ---- Filter Bar (All View) --------------------------------- */
.csc-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}

.csc-filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 140px;
    flex: 1;
}

.csc-filter-search {
    flex: 2;
    min-width: 200px;
}

.csc-filter-group label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.csc-filter-group input[type="text"],
.csc-filter-group input[type="date"],
.csc-filter-group select {
    padding: 0.5rem 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.9rem;
    background: #fff;
    color: #1e293b;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.csc-filter-group input:focus,
.csc-filter-group select:focus {
    outline: none;
    border-color: #1a3a5c;
    box-shadow: 0 0 0 3px rgba(26,58,92,0.12);
}

.csc-filter-reset {
    flex: 0;
    min-width: unset;
}

/* ---- Buttons ----------------------------------------------- */
.csc-btn {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.2s, transform 0.1s;
    white-space: nowrap;
}

.csc-btn:active { transform: scale(0.97); }

.csc-btn-primary {
    background: #1a3a5c;
    color: #fff;
}
.csc-btn-primary:hover { background: #0f2540; }

.csc-btn-secondary {
    background: #e2e8f0;
    color: #475569;
}
.csc-btn-secondary:hover { background: #cbd5e1; }

/* ---- Results Info ----------------------------------------- */
.csc-results-info {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 0.5rem;
}

/* ---- Pagination ------------------------------------------- */
.csc-pagination {
    margin-top: 1rem;
}

.csc-pager {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    justify-content: center;
}

.csc-page-btn {
    padding: 0.4rem 0.85rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    color: #1a3a5c;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.csc-page-btn:hover {
    background: #f0f6ff;
    border-color: #1a3a5c;
}

.csc-page-btn.active {
    background: #1a3a5c;
    color: #fff;
    border-color: #1a3a5c;
}

/* ---- Loading Overlay -------------------------------------- */
.csc-loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #64748b;
    font-size: 0.9rem;
    padding: 0.5rem 0;
}

.csc-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #cbd5e1;
    border-top-color: #1a3a5c;
    border-radius: 50%;
    display: inline-block;
    animation: csc-spin 0.6s linear infinite;
}

@keyframes csc-spin {
    to { transform: rotate(360deg); }
}

/* ---- Responsive ------------------------------------------- */
@media (max-width: 768px) {
    .csc-table thead { display: none; }

    .csc-table tbody tr {
        display: block;
        margin-bottom: 0.75rem;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        padding: 0.5rem;
    }

    .csc-table td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        padding: 0.4rem 0.5rem;
        border-bottom: 1px solid #f1f5f9;
        font-size: 0.88rem;
    }

    .csc-table td:last-child { border-bottom: none; }

    .csc-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #64748b;
        font-size: 0.78rem;
        min-width: 90px;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        padding-top: 2px;
    }

    .csc-filter-bar { flex-direction: column; }
    .csc-filter-group { min-width: 100%; }
    .csc-filter-search { min-width: 100%; }
}
