/* Sky Training Bookings — My Training (My Account Tab) */

/* ═══════════════════════════════════════════════════════
   Stats Bar
   ═══════════════════════════════════════════════════════ */

.stb-mt-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 28px;
}

.stb-mt-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    text-align: center;
}

.stb-mt-stat-number {
    font-size: 1.8rem;
    font-weight: 800;
    color: #233d7b;
    line-height: 1;
}

.stb-mt-stat-label {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ═══════════════════════════════════════════════════════
   Section Titles
   ═══════════════════════════════════════════════════════ */

.stb-mt-section {
    margin-bottom: 32px;
}

.stb-mt-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
}

.stb-mt-section-title svg {
    color: #233d7b;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════
   Booking Card
   ═══════════════════════════════════════════════════════ */

.stb-mt-card {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    margin-bottom: 14px;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.stb-mt-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.stb-mt-card-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
}

.stb-mt-card-date-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 64px;
    padding: 10px 8px;
    background: #233d7b;
    border-radius: 10px;
    color: #fff;
    text-align: center;
    flex-shrink: 0;
}

.stb-mt-badge-day {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1;
}

.stb-mt-badge-month {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.stb-mt-badge-year {
    font-size: 10px;
    opacity: 0.8;
    margin-top: 1px;
}

.stb-mt-card-info {
    flex: 1;
    min-width: 0;
}

.stb-mt-card-title {
    margin: 0 0 8px;
    font-size: 1.05rem;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.3;
}

.stb-mt-card-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.stb-mt-card-title a:hover {
    color: #233d7b;
}

.stb-mt-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
}

.stb-mt-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: #64748b;
}

.stb-mt-meta-item svg {
    flex-shrink: 0;
    opacity: 0.6;
}

.stb-mt-card-status {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
}

.stb-mt-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.stb-mt-status-confirmed {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.stb-mt-status-cancelled {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.stb-mt-order-link {
    font-size: 12px;
    color: #64748b;
    text-decoration: none;
}

.stb-mt-order-link:hover {
    color: #233d7b;
    text-decoration: underline;
}

/* ═══════════════════════════════════════════════════════
   Card Actions
   ═══════════════════════════════════════════════════════ */

.stb-mt-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 20px 16px;
}

.stb-mt-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    line-height: 1.4;
}

.stb-mt-btn svg {
    flex-shrink: 0;
}

.stb-mt-btn-primary {
    background: #233d7b;
    color: #fff;
}

.stb-mt-btn-primary:hover {
    background: #1a2e5e;
    color: #fff;
}

.stb-mt-btn-cert {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.stb-mt-btn-cert:hover {
    background: #d1fae5;
    color: #065f46;
}

.stb-mt-btn-message {
    background: #f0f3fa;
    color: #233d7b;
    border: 1px solid #c7d2e8;
}

.stb-mt-btn-message:hover {
    background: #dde4f3;
}

.stb-mt-btn-view {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #e2e8f0;
}

.stb-mt-btn-view:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.stb-mt-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ═══════════════════════════════════════════════════════
   Messages Section — Unified Chat
   ═══════════════════════════════════════════════════════ */

.stb-mt-messages-section {
    margin-top: 8px;
    padding-top: 8px;
}

.stb-mt-messages-header {
    margin-bottom: 16px;
}

.stb-mt-messages-header .stb-mt-section-title {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

/* Chat Box Container */
.stb-mt-chat-box {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    display: flex;
    flex-direction: column;
}

/* Scrollable messages area */
.stb-mt-chat-messages {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #fafbfc;
    max-height: 480px;
    overflow-y: auto;
    min-height: 200px;
}

/* Date divider */
.stb-mt-chat-date-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 10px 0 6px;
}

.stb-mt-chat-date-divider::before,
.stb-mt-chat-date-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

.stb-mt-chat-date-divider span {
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* Empty state inside chat */
.stb-mt-chat-empty {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
}

.stb-mt-chat-empty svg {
    opacity: 0.35;
    margin-bottom: 10px;
}

.stb-mt-chat-empty p {
    margin: 0;
    font-size: 14px;
    color: #64748b;
}

/* Message Bubbles */
.stb-mt-msg {
    display: flex;
    gap: 10px;
    max-width: 80%;
}

.stb-mt-msg-customer {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.stb-mt-msg-admin {
    align-self: flex-start;
}

.stb-mt-msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
    background: #233d7b;
    color: #fff;
}

.stb-mt-avatar-admin {
    background: #059669;
}

.stb-mt-msg-content {
    flex: 1;
    min-width: 0;
}

.stb-mt-msg-customer .stb-mt-msg-content {
    padding: 10px 14px;
    background: #233d7b;
    color: #fff;
    border-radius: 16px 16px 4px 16px;
}

.stb-mt-msg-customer .stb-mt-msg-meta strong,
.stb-mt-msg-customer .stb-mt-msg-meta span {
    color: rgba(255, 255, 255, 0.7);
}

.stb-mt-msg-customer .stb-mt-msg-body {
    color: #fff;
}

.stb-mt-msg-admin .stb-mt-msg-content {
    padding: 10px 14px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px 16px 16px 4px;
}

.stb-mt-msg-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 3px;
    font-size: 11px;
    color: #64748b;
}

.stb-mt-msg-meta strong {
    color: #1e293b;
    font-weight: 600;
    font-size: 12px;
}

.stb-mt-msg-admin-tag {
    padding: 1px 5px;
    background: #059669;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.stb-mt-msg-body {
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.stb-mt-msg-admin .stb-mt-msg-body {
    color: #334155;
}

/* Chat Input Bar */
.stb-mt-chat-input {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 14px 16px;
    border-top: 1px solid #e2e8f0;
    background: #fff;
}

.stb-mt-chat-textarea {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 22px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    min-height: 42px;
    max-height: 120px;
    line-height: 1.4;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    overflow-y: auto;
}

.stb-mt-chat-textarea:focus {
    border-color: #233d7b;
    outline: none;
    box-shadow: 0 0 0 3px rgba(35, 61, 123, 0.1);
}

.stb-mt-chat-send-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: #233d7b;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s, transform 0.1s;
}

.stb-mt-chat-send-btn:hover {
    background: #1a2e5e;
    transform: scale(1.05);
}

.stb-mt-chat-send-btn:active {
    transform: scale(0.95);
}

.stb-mt-chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.stb-mt-chat-send-btn svg {
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════
   Empty State
   ═══════════════════════════════════════════════════════ */

.stb-mt-empty {
    text-align: center;
    padding: 48px 20px;
}

.stb-mt-empty-icon {
    color: #94a3b8;
    margin-bottom: 16px;
    opacity: 0.5;
}

.stb-mt-empty h3 {
    margin: 0 0 8px;
    font-size: 1.2rem;
    color: #1e293b;
}

.stb-mt-empty p {
    margin: 0 0 20px;
    color: #64748b;
    font-size: 14px;
}

/* ═══════════════════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .stb-mt-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .stb-mt-card-header {
        flex-direction: column;
        gap: 12px;
    }

    .stb-mt-card-date-badge {
        flex-direction: row;
        gap: 6px;
        min-width: auto;
        padding: 8px 14px;
        border-radius: 8px;
        width: fit-content;
    }

    .stb-mt-badge-day {
        font-size: 1.2rem;
    }

    .stb-mt-badge-month,
    .stb-mt-badge-year {
        font-size: 12px;
    }

    .stb-mt-card-status {
        flex-direction: row;
        align-items: center;
    }

    .stb-mt-card-meta {
        flex-direction: column;
        gap: 4px;
    }

    .stb-mt-card-actions {
        flex-direction: column;
    }

    .stb-mt-btn {
        width: 100%;
        justify-content: center;
    }

    .stb-mt-msg {
        max-width: 95%;
    }

    .stb-mt-chat-messages {
        padding: 14px;
        max-height: 400px;
    }

    .stb-mt-chat-input {
        padding: 10px 12px;
    }
}
