/**
 * UCFC Portal Modern Stylesheet (Version 4.3.4)
 */
.ucfc-portal-container {
    max-width: 1100px;
    margin: 30px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: #1e293b;
}

.ucfc-portal-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    border-bottom: 2px solid #e2e8f0;
}

.ucfc-tab-btn {
    background: transparent;
    border: none;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
}

.ucfc-tab-btn.active {
    color: #0f172a;
    border-bottom-color: #2563eb;
}

.ucfc-tab-content {
    display: none;
}

.ucfc-tab-content.active {
    display: block;
}

/* Card Container */
.ucfc-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    padding: 32px;
    margin-bottom: 25px;
    border: 1px solid #f1f5f9;
}

.ucfc-card-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #0f172a;
}

.ucfc-card-subtitle {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 24px;
}

/* Alerts */
.ucfc-alert {
    padding: 14px 18px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 20px;
}

.ucfc-alert-info { background: #eff6ff; color: #1e40af; border-left: 4px solid #3b82f6; }
.ucfc-alert-success { background: #f0fdf4; color: #166534; border-left: 4px solid #22c55e; }
.ucfc-alert-warning { background: #fffbeb; color: #92400e; border-left: 4px solid #f59e0b; }
.ucfc-alert-danger { background: #fef2f2; color: #991b1b; border-left: 4px solid #ef4444; }

/* Forms */
.ucfc-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.ucfc-col-full {
    grid-column: span 2;
}

.ucfc-form-group {
    display: flex;
    flex-direction: column;
}

.ucfc-form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}

.ucfc-req { color: #dc2626; }

.ucfc-form-group input,
.ucfc-form-group select,
.ucfc-form-group textarea {
    padding: 11px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    background: #f8fafc;
    transition: border-color 0.2s ease;
}

.ucfc-form-group input:focus,
.ucfc-form-group select:focus,
.ucfc-form-group textarea:focus {
    outline: none;
    border-color: #2563eb;
    background: #ffffff;
}

.ucfc-help-text {
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
}

.ucfc-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #334155;
    cursor: pointer;
}

.ucfc-form-actions {
    margin-top: 24px;
}

.ucfc-form-actions-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}

.ucfc-btn {
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background 0.2s ease;
}

.ucfc-btn-primary { background: #2563eb; color: #ffffff; }
.ucfc-btn-primary:hover { background: #1d4ed8; }
.ucfc-btn-secondary { background: #e2e8f0; color: #334155; }
.ucfc-btn-secondary:hover { background: #cbd5e1; }

/* Status Cards (Pending, Rejected, Correction) */
.ucfc-status-card {
    text-align: center;
    padding: 48px 32px;
}

.ucfc-status-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.ucfc-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.ucfc-badge-warning { background: #fef3c7; color: #92400e; }
.ucfc-badge-danger { background: #fee2e2; color: #991b1b; }
.ucfc-badge-success { background: #dcfce7; color: #166534; }
.ucfc-badge-info { background: #dbeafe; color: #1e40af; }

.ucfc-status-desc {
    font-size: 15px;
    color: #475569;
    max-width: 600px;
    margin: 20px auto;
}

.ucfc-status-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
}

/* Dashboard Layout */
.ucfc-dashboard-wrapper {
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.ucfc-dash-header {
    background: #0f172a;
    color: #ffffff;
    padding: 24px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ucfc-dash-user-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.ucfc-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    background: #334155;
    border: 2px solid #38bdf8;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ucfc-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ucfc-avatar-placeholder {
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
}

.ucfc-user-name {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 6px 0;
}

.ucfc-badge-row {
    display: flex;
    gap: 8px;
}

.ucfc-dash-body {
    display: flex;
    min-height: 500px;
}

.ucfc-sidebar {
    width: 240px;
    background: #ffffff;
    border-right: 1px solid #e2e8f0;
}

.ucfc-sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ucfc-sidebar-menu li {
    padding: 14px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    border-left: 4px solid transparent;
    transition: all 0.2s ease;
}

.ucfc-sidebar-menu li:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.ucfc-sidebar-menu li.active {
    background: #eff6ff;
    color: #2563eb;
    border-left-color: #2563eb;
}

.ucfc-dash-content {
    flex: 1;
    padding: 32px;
    background: #ffffff;
}

.ucfc-panel {
    display: none;
}

.ucfc-panel.active {
    display: block;
}

/* Metrics Grid */
.ucfc-metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-top: 20px;
}

.ucfc-metric-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.ucfc-metric-val {
    font-size: 32px;
    font-weight: 800;
    color: #0f172a;
}

.ucfc-metric-lbl {
    font-size: 13px;
    color: #64748b;
    margin-top: 4px;
}

/* Two Batch Support */
.ucfc-two-batch-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.ucfc-batch-card {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 20px;
}

@media (max-width: 768px) {
    .ucfc-form-grid, .ucfc-metrics-grid, .ucfc-two-batch-grid {
        grid-template-columns: 1fr;
    }
    .ucfc-col-full { grid-column: span 1; }
    .ucfc-dash-body { flex-direction: column; }
    .ucfc-sidebar { width: 100%; border-right: none; border-bottom: 1px solid #e2e8f0; }
}


/* UCFC 4.2.0 dashboard and image compatibility fixes */
.ucfc-player-dashboard .ucfc-avatar,
.ucfc-player-dashboard .ucfc-avatar img,
.ucfc-player-dashboard .ucfc-avatar-placeholder {
    width: 96px;
    height: 96px;
    min-width: 96px;
    border-radius: 50%;
}
.ucfc-player-dashboard .ucfc-avatar { overflow: hidden; border: 4px solid rgba(255,255,255,.9); background: #fff; }
.ucfc-player-dashboard .ucfc-avatar img { display: block; object-fit: cover; object-position: center top; }
.ucfc-record-list { display: grid; gap: 12px; margin-top: 18px; }
.ucfc-record-card { display: grid; gap: 6px; padding: 16px; border: 1px solid #dfe8e2; border-radius: 10px; background: #fff; }
.ucfc-record-card.is-unread { border-left: 4px solid #087443; background: #f4fbf7; }
.ucfc-gallery-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.ucfc-gallery-grid figure { margin: 0; overflow: hidden; border-radius: 12px; background: #f4f7f5; }
.ucfc-gallery-grid img { width: 100%; aspect-ratio: 4 / 3; display: block; object-fit: cover; }
.ucfc-gallery-grid figcaption { padding: 10px; font-size: 13px; }
@media (max-width: 768px) {
    .ucfc-player-dashboard .ucfc-avatar,
    .ucfc-player-dashboard .ucfc-avatar img,
    .ucfc-player-dashboard .ucfc-avatar-placeholder { width: 72px; height: 72px; min-width: 72px; }
    .ucfc-gallery-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) { .ucfc-gallery-grid { grid-template-columns: 1fr; } }


/* UCFC 4.3.0 academy assessment, achievement and QR payment layouts */
.ucfc-payment-layout{display:grid;grid-template-columns:minmax(260px,420px) minmax(0,1fr);gap:28px;align-items:start;margin-top:22px}
.ucfc-qr-panel{padding:18px;border:1px solid #dfe8e2;border-radius:14px;background:#fff;text-align:center}
.ucfc-payment-qr{display:block;width:100%;max-width:380px;height:auto;margin:0 auto 14px;border-radius:10px}
.ucfc-payment-form-panel{min-width:0}
.ucfc-record-heading{display:flex;justify-content:space-between;gap:16px;align-items:center;flex-wrap:wrap}
.ucfc-score-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:12px 0}
.ucfc-score-grid>div{display:flex;justify-content:space-between;gap:10px;padding:10px 12px;border-radius:8px;background:#f4f7f5}
.ucfc-achievement-category{display:inline-flex;width:max-content;padding:5px 10px;border-radius:999px;background:#e7f4ed;color:#087443;font-size:12px;font-weight:800}
@media(max-width:780px){.ucfc-payment-layout{grid-template-columns:1fr}.ucfc-payment-qr{max-width:320px}.ucfc-score-grid{grid-template-columns:1fr}}
@media(max-width:480px){.ucfc-qr-panel{padding:12px}.ucfc-record-heading{align-items:flex-start}.ucfc-payment-card{padding:16px}}


/* UCFC 4.3.3 responsive hardening for phones, tablets, and wide layouts */
.ucfc-portal-container,
.ucfc-dashboard-wrapper,
.ucfc-controller-wrapper {
    min-width: 0;
    box-sizing: border-box;
}
.ucfc-portal-container {
    width: calc(100% - 32px);
}
.ucfc-portal-container *,
.ucfc-dashboard-wrapper *,
.ucfc-controller-wrapper * {
    box-sizing: border-box;
}
.ucfc-portal-container img,
.ucfc-dashboard-wrapper img,
.ucfc-controller-wrapper img {
    max-width: 100%;
}
.ucfc-portal-tabs {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}
.ucfc-tab-btn {
    flex: 0 0 auto;
    white-space: nowrap;
}
.ucfc-form-grid > *,
.ucfc-dash-body > *,
.ucfc-dash-content,
.ucfc-user-details,
.ucfc-dash-quick-meta,
.ucfc-record-card,
.ucfc-score-grid > div,
.ucfc-batch-card,
.ucfc-metric-card {
    min-width: 0;
}
.ucfc-form-group input,
.ucfc-form-group select,
.ucfc-form-group textarea {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}
.ucfc-checkbox-label {
    align-items: flex-start;
    flex-wrap: wrap;
}
.ucfc-checkbox-label input {
    flex: 0 0 auto;
    margin-top: 3px;
}
.ucfc-status-actions,
.ucfc-badge-row,
.ucfc-dash-header {
    flex-wrap: wrap;
}
.ucfc-dash-header {
    gap: 20px;
}
.ucfc-dash-user-info {
    min-width: 0;
}
.ucfc-user-name,
.ucfc-dash-quick-meta,
.ucfc-profile-details-grid > div,
.ucfc-record-card,
.ucfc-score-grid strong {
    overflow-wrap: anywhere;
    word-break: break-word;
}
.ucfc-dash-quick-meta {
    display: grid;
    gap: 6px;
    max-width: 100%;
    text-align: right;
    font-size: 13px;
}
.ucfc-profile-details-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.ucfc-profile-details-grid > div {
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}
.ucfc-score-grid > div {
    align-items: flex-start;
}
.ucfc-score-grid > div > span {
    flex: 0 1 45%;
    min-width: 0;
    overflow-wrap: normal;
    word-break: normal;
}
.ucfc-score-grid > div > strong {
    flex: 0 1 auto;
    text-align: right;
}
.ucfc-achievement-image {
    display: block;
    width: 100%;
    max-height: 420px;
    margin: 8px 0 12px;
    border-radius: 10px;
    object-fit: cover;
}
.ucfc-certificate-link {
    width: max-content;
    max-width: 100%;
    text-align: center;
}
.ucfc-controller-wrapper {
    width: calc(100% - 32px);
    max-width: 1100px;
    margin: 30px auto;
    padding: 24px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
}

@media (max-width: 1024px) {
    .ucfc-portal-container,
    .ucfc-controller-wrapper {
        width: calc(100% - 24px);
        margin-top: 20px;
        margin-bottom: 20px;
    }
    .ucfc-card,
    .ucfc-dash-content {
        padding: 24px;
    }
}

@media (max-width: 768px) {
    .ucfc-dash-header {
        align-items: flex-start;
        padding: 20px;
    }
    .ucfc-dash-user-info,
    .ucfc-dash-quick-meta {
        width: 100%;
    }
    .ucfc-dash-quick-meta {
        text-align: left;
    }
    .ucfc-sidebar {
        overflow: hidden;
    }
    .ucfc-sidebar-menu {
        display: flex;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
    .ucfc-sidebar-menu li {
        flex: 0 0 auto;
        border-left: 0;
        border-bottom: 4px solid transparent;
        white-space: nowrap;
    }
    .ucfc-sidebar-menu li.active {
        border-left-color: transparent;
        border-bottom-color: #2563eb;
    }
    .ucfc-profile-details-grid {
        grid-template-columns: 1fr;
    }
    .ucfc-status-actions,
    .ucfc-form-actions-row {
        flex-wrap: wrap;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .ucfc-portal-container,
    .ucfc-controller-wrapper {
        width: calc(100% - 16px);
        margin-top: 12px;
        margin-bottom: 12px;
    }
    .ucfc-card,
    .ucfc-dash-content,
    .ucfc-controller-wrapper {
        padding: 16px;
    }
    .ucfc-card-title {
        font-size: 21px;
    }
    .ucfc-tab-btn {
        padding: 10px 14px;
        font-size: 14px;
    }
    .ucfc-dash-header {
        padding: 16px;
    }
    .ucfc-dash-user-info {
        align-items: flex-start;
        gap: 12px;
    }
    .ucfc-badge-row {
        gap: 6px;
    }
    .ucfc-status-actions,
    .ucfc-form-actions-row {
        align-items: stretch;
        flex-direction: column;
    }
    .ucfc-status-actions .ucfc-btn,
    .ucfc-form-actions-row .ucfc-btn,
    .ucfc-form-actions .ucfc-btn,
    .ucfc-certificate-link {
        width: 100%;
    }
    .ucfc-score-grid > div {
        gap: 8px;
    }
    .ucfc-achievement-card .ucfc-score-grid > div {
        align-items: stretch;
        flex-direction: column;
    }
    .ucfc-achievement-card .ucfc-score-grid > div > span,
    .ucfc-achievement-card .ucfc-score-grid > div > strong {
        width: 100%;
        max-width: none;
        text-align: left;
    }
}

@media (max-width: 360px) {
    .ucfc-player-dashboard .ucfc-avatar,
    .ucfc-player-dashboard .ucfc-avatar img,
    .ucfc-player-dashboard .ucfc-avatar-placeholder {
        width: 60px;
        height: 60px;
        min-width: 60px;
    }
    .ucfc-user-name {
        font-size: 18px;
    }
    .ucfc-badge {
        padding: 5px 9px;
        font-size: 11px;
    }
}

/* UCFC 4.3.4 assessment and achievement history pagination */
.ucfc-panel-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}
.ucfc-panel-toolbar h3 {
    margin-bottom: 4px;
}
.ucfc-panel-note {
    margin: 0;
    color: #64748b;
    font-size: 13px;
}
.ucfc-record-card.is-latest {
    border-color: #86b89b;
    box-shadow: 0 0 0 1px rgba(8, 116, 67, 0.08);
}
.ucfc-record-date {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #475569;
}
.ucfc-record-date em {
    display: inline-flex;
    padding: 3px 7px;
    border-radius: 999px;
    background: #e7f4ed;
    color: #087443;
    font-size: 10px;
    font-style: normal;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.ucfc-pagination {
    margin-top: 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.ucfc-pagination ul.page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: max-content;
    min-width: 100%;
    margin: 0;
    padding: 2px;
    list-style: none;
}
.ucfc-pagination ul.page-numbers > li {
    margin: 0;
}
.ucfc-pagination a.page-numbers,
.ucfc-pagination span.page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid #dbe4de;
    border-radius: 8px;
    background: #ffffff;
    color: #334155;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
}
.ucfc-pagination a.page-numbers:hover,
.ucfc-pagination a.page-numbers:focus-visible,
.ucfc-pagination span.page-numbers.current {
    border-color: #087443;
    background: #087443;
    color: #ffffff;
}
.ucfc-pagination span.page-numbers.dots {
    min-width: 28px;
    border-color: transparent;
    background: transparent;
    color: #64748b;
}

@media (max-width: 600px) {
    .ucfc-panel-toolbar {
        align-items: stretch;
        flex-direction: column;
    }
    .ucfc-panel-toolbar .ucfc-btn {
        width: 100%;
    }
    .ucfc-pagination ul.page-numbers {
        justify-content: flex-start;
        min-width: max-content;
    }
}
