/* Course Schedule & Search Manager - Frontend Styles */
:root {
    --csm-primary: #0875b7;
    --csm-header-bg: #0875b7;
    --csm-btn-bg: #0875b7;
    --csm-btn-hover: #065b8e;
    --csm-yellow-btn: #f5a623;
    --csm-yellow-hover: #e09418;
    --csm-green-btn: #2e7d32;
    --csm-green-hover: #256628;
    --csm-border-color: #cbd5e1;
    --csm-table-border: #e2e8f0;
    --csm-text-dark: #1f2937;
    --csm-text-muted: #4b5563;
    --csm-bg-light: #f8fafc;
}

.csm-schedule-container {
    width: 100%;
    max-width: 1200px;
    margin: 40px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: var(--csm-text-dark);
    box-sizing: border-box;
}

.csm-schedule-container *,
.csm-schedule-container *::before,
.csm-schedule-container *::after {
    box-sizing: border-box;
}

/* Section Title */
.csm-section-title {
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 30px;
    color: #1a202c;
    letter-spacing: -0.5px;
}

/* Filter Bar */
.csm-filter-bar {
    margin-bottom: 25px;
}

.csm-filter-form {
    display: grid;
    grid-template-columns: 1.2fr 1.5fr 1fr auto;
    gap: 12px;
    align-items: center;
}

.csm-filter-group {
    position: relative;
    width: 100%;
}

.csm-select {
    width: 100%;
    height: 44px;
    padding: 8px 36px 8px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 2px;
    background-color: #ffffff;
    font-size: 14px;
    color: #334155;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.csm-select:focus {
    border-color: var(--csm-primary);
    box-shadow: 0 0 0 2px rgba(8, 117, 183, 0.15);
}

.csm-select-caret {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #64748b;
    pointer-events: none;
}

/* Buttons */
.csm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
    border: none;
    border-radius: 2px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    text-decoration: none !important;
}

.csm-btn-search {
    height: 44px;
    padding: 0 24px;
    background-color: var(--csm-btn-bg);
    color: #ffffff !important;
    font-size: 13px;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.csm-btn-search:hover {
    background-color: var(--csm-btn-hover);
}

.csm-btn-book {
    padding: 6px 14px;
    background-color: var(--csm-btn-bg);
    color: #ffffff !important;
    font-size: 12px;
    letter-spacing: 0.5px;
    font-weight: 700;
}

.csm-btn-book:hover {
    background-color: var(--csm-btn-hover);
}

/* Table Styles */
.csm-table-responsive {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.csm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    text-align: left;
}

.csm-table th {
    background-color: var(--csm-header-bg);
    color: #ffffff;
    font-weight: 700;
    padding: 14px 16px;
    border-right: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 14px;
    letter-spacing: 0.2px;
}

.csm-table th:last-child {
    border-right: none;
}

.csm-table td {
    padding: 16px;
    border-bottom: 1px solid #edf2f7;
    border-right: 1px solid #edf2f7;
    color: #334155;
    vertical-align: middle;
}

.csm-table td:last-child {
    border-right: none;
}

.csm-row:hover td {
    background-color: #f8fafc;
}

.csm-cell-head {
    width: 18%;
    font-weight: 500;
}

.csm-cell-name {
    width: 34%;
    color: #0f172a;
    font-size: 14.5px;
}

.csm-cell-type {
    width: 10%;
}

.csm-cell-location {
    width: 10%;
}

.csm-cell-price {
    width: 8%;
    font-weight: 600;
    color: #1e293b;
}

.csm-cell-batch {
    width: 20%;
}

.csm-batch-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.csm-batch-date {
    font-size: 13px;
    color: #334155;
    white-space: nowrap;
}

.csm-empty-row td {
    text-align: center;
    padding: 30px;
    color: #64748b;
    font-style: italic;
}

/* ========================================================= */
/* BOOKING VIEW - MATCHING USER SCREENSHOT EXACTLY           */
/* ========================================================= */

.csm-booking-view-container {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    animation: csmFadeIn 0.3s ease-in-out;
}

@keyframes csmFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.csm-booking-top-nav {
    margin-bottom: 25px;
}

.csm-back-link {
    background: transparent;
    border: none;
    color: var(--csm-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
}

.csm-back-link:hover {
    color: var(--csm-btn-hover);
    text-decoration: underline;
}

.csm-booking-box {
    background: #ffffff;
    padding: 10px 0;
}

/* Course Metadata Summary Section */
.csm-course-summary-list {
    margin-bottom: 25px;
}

.csm-summary-row {
    margin-bottom: 12px;
    font-size: 15px;
    line-height: 1.5;
    color: #111827;
}

.csm-summary-row .csm-label {
    font-weight: 700;
    margin-right: 6px;
}

.csm-summary-row .csm-value {
    font-weight: 400;
    color: #1f2937;
}

/* Form Inputs */
.csm-booking-form-wrap {
    width: 100%;
}

.csm-field-group {
    margin-bottom: 20px;
}

.csm-input-label {
    display: block;
    font-weight: 700;
    font-size: 15px;
    color: #111827;
    margin-bottom: 8px;
}

.csm-custom-input {
    width: 100%;
    height: 44px;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 3px;
    font-size: 14px;
    color: #1f2937;
    background-color: #fafbfc;
    outline: none;
    transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
}

.csm-custom-input::placeholder {
    color: #94a3b8;
}

.csm-custom-input:focus {
    border-color: #94a3b8;
    background-color: #ffffff;
    box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.2);
}

/* Radio Group */
.csm-radio-container {
    margin-top: 15px;
    margin-bottom: 25px;
}

.csm-radio-options {
    display: inline-flex;
    align-items: center;
    gap: 20px;
    margin-top: 4px;
}

.csm-radio-opt {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14.5px;
    cursor: pointer;
    font-weight: 400;
    color: #374151;
}

.csm-radio-opt input[type="radio"] {
    margin: 0;
    cursor: pointer;
    accent-color: #0875b7;
    width: 16px;
    height: 16px;
}

/* Action Buttons (PREVIEW Yellow & CONFIRM Green) */
.csm-action-buttons-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 30px;
}

.csm-btn-custom {
    height: 52px;
    border: none;
    border-radius: 2px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: #ffffff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, filter 0.2s, transform 0.1s;
    outline: none;
}

.csm-btn-preview-yellow {
    background-color: var(--csm-yellow-btn);
}

.csm-btn-preview-yellow:hover {
    background-color: var(--csm-yellow-hover);
}

.csm-btn-confirm-green {
    background-color: var(--csm-green-btn);
}

.csm-btn-confirm-green:hover {
    background-color: var(--csm-green-hover);
}

/* Feedback message */
.csm-feedback-message {
    margin-top: 15px;
    margin-bottom: 15px;
    padding: 12px 16px;
    border-radius: 4px;
    font-size: 14px;
    display: none;
}

.csm-feedback-message.csm-success {
    display: block;
    background-color: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.csm-feedback-message.csm-error {
    display: block;
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Preview Modal Dialog */
.csm-preview-popup-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(3px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.csm-preview-inner-box {
    background: #ffffff;
    width: 100%;
    max-width: 580px;
    border-radius: 6px;
    padding: 30px;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.3);
}

.csm-preview-inner-box h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 20px;
    color: #0f172a;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 12px;
}

.csm-preview-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 25px;
    font-size: 14px;
}

.csm-preview-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #f1f5f9;
}

.csm-preview-table td:first-child {
    width: 40%;
    color: #64748b;
}

.csm-preview-modal-btns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* Success Card */
.csm-success-card-view {
    text-align: center;
    padding: 50px 20px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}

.csm-success-icon {
    width: 64px;
    height: 64px;
    background: #2e7d32;
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: bold;
    margin: 0 auto 20px;
}

.csm-success-card-view h3 {
    font-size: 24px;
    margin-bottom: 10px;
    color: #0f172a;
}

.csm-success-card-view p {
    font-size: 15px;
    color: #475569;
    margin-bottom: 30px;
}

/* Spinner */
.csm-spinner {
    display: none;
    width: 18px;
    height: 18px;
    margin-left: 10px;
    border: 2px solid #ffffff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: csmSpin 0.7s linear infinite;
}

.is-loading .csm-spinner {
    display: inline-block;
}

@keyframes csmSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 992px) {
    .csm-filter-form {
        grid-template-columns: 1fr 1fr;
    }
    .csm-col-btn {
        grid-column: span 2;
    }
    .csm-btn-search {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .csm-filter-form {
        grid-template-columns: 1fr;
    }
    .csm-col-btn {
        grid-column: span 1;
    }
    .csm-action-buttons-grid,
    .csm-preview-modal-btns {
        grid-template-columns: 1fr;
    }
    .csm-batch-wrap {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .csm-btn-book {
        width: 100%;
    }
}
