@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&display=swap');

:root {
    --ups-primary: #2575fc;
    --ups-primary-hover: #1a56c5;
    --ups-teal: #14b8a6;
    --ups-bg: #f8fafc;
    --ups-card: #ffffff;
    --ups-text: #1e293b;
    --ups-muted: #64748b;
    --ups-sidebar: #000000;
    --ups-border: #e2e8f0;
    --ups-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Base resets */
.upschool-lms-container * {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

.upschool-lms-container {
    display: flex;
    flex-direction: column;
    font-family: 'Outfit', sans-serif;
    background: var(--ups-bg);
    color: var(--ups-text);
    border-radius: 20px;
    overflow: hidden;
    min-height: 85vh;
    box-shadow: var(--ups-shadow);
    margin: 20px auto;
    max-width: 1400px;
}

@media (min-width: 1025px) {
    .upschool-lms-container {
        flex-direction: row;
    }
}

/* Enrollment Gate Overlay */
.upschool-enroll-gate {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #fff;
    z-index: 1000;
    padding: 30px;
    text-align: center;
}

.gate-content {
    max-width: 480px;
    width: 100%;
}

.gate-icon {
    font-size: 3.5rem;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.gate-content h2 {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--ups-sidebar);
    margin: 0 0 15px 0;
}

.gate-content p {
    color: var(--ups-muted);
    line-height: 1.6;
    margin-bottom: 30px;
}

/* Sidebar - Responsive */
.upschool-sidebar {
    width: 100%;
    background: var(--ups-sidebar);
    color: #fff;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

@media (min-width: 1025px) {
    .upschool-sidebar {
        width: 340px;
    }
}

.upschool-sidebar-header {
    padding: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.upschool-sidebar-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #fff;
    font-weight: 700;
}

#instructor_label {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-top: 5px;
    display: block;
}

.curriculum-list {
    flex-grow: 1;
    padding: 10px 0;
    overflow-y: auto;
    max-height: 400px;
    /* On mobile, limit height */
}

@media (min-width: 1025px) {
    .curriculum-list {
        max-height: none;
    }
}

.section-label {
    padding: 20px 25px 10px;
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--ups-primary);
    letter-spacing: 0.5px;
}

.curriculum-item {
    display: flex;
    align-items: center;
    padding: 14px 25px;
    text-decoration: none !important;
    color: #94a3b8;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.curriculum-item:hover {
    background: rgba(255, 255, 255, 0.03);
    color: #fff;
}

.curriculum-item.active {
    background: linear-gradient(90deg, rgba(79, 70, 229, 0.15) 0%, rgba(79, 70, 229, 0) 100%);
    color: #fff !important;
    border-left-color: var(--ups-primary);
}

.module-number {
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    margin-right: 15px;
    flex-shrink: 0;
}

.curriculum-item.active .module-number {
    background: var(--ups-primary);
}

/* Main Content Area */
.upschool-main {
    flex-grow: 1;
    background: #fff;
    display: flex;
    flex-direction: column;
}

.stage-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--ups-border);
    display: flex;
    flex-direction: column;
}

@media (min-width: 768px) {
    .stage-header {
        padding: 30px 40px;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.lesson-info small {
    color: var(--ups-primary);
    text-transform: uppercase;
    font-weight: 700;
    font-size: 0.65rem;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    display: block;
}

.stage-header h2 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--ups-sidebar);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-controls {
    display: flex;
    gap: 8px;
    margin-top: 15px;
    flex-wrap: wrap;
}

@media (min-width: 768px) {
    .nav-controls {
        margin-top: 0;
        flex-wrap: nowrap;
    }
}

.nav-btn {
    flex: 1;
    min-width: 80px;
    padding: 10px 8px;
    border-radius: 10px;
    border: 1px solid var(--ups-border);
    background: #fff;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.75rem;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.nav-btn.primary {
    background: var(--ups-primary);
    color: #fff;
    border-color: var(--ups-primary);
}

.nav-btn.small {
    color: var(--ups-muted);
    background: var(--ups-bg);
}

/* Video Stage */
.video-portal {
    background: #000;
    position: relative;
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
}

.video-mask {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    background-size: cover;
    background-position: center;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.play-icon {
    width: 60px;
    height: 60px;
    background: var(--ups-primary);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    color: #fff;
    box-shadow: 0 0 30px rgba(79, 70, 229, 0.5);
}

/* Tabs - Mobile Scrollable */
.course-tabs-wrapper {
    padding: 25px;
}

.tabs-nav {
    display: flex;
    gap: 20px;
    border-bottom: 1px solid var(--ups-border);
    margin-bottom: 25px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tabs-nav::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    padding: 10px 0 15px;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
    color: var(--ups-muted);
    white-space: nowrap;
    position: relative;
}

.tab-btn.active {
    color: var(--ups-primary);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--ups-primary);
}

.tab-content {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #475569;
}

.tab-content h5 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--ups-sidebar);
    margin: 0 0 20px 0;
}

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

/* UI Indicators */
#upschool-help-section {
    display: none;
    border-left: 4px solid #fbbf24;
    background: #fffbeb;
}

.player-helper {
    padding: 20px 25px;
    font-size: 0.85rem;
    color: #92400e;
    line-height: 1.5;
}

.player-helper a {
    font-weight: 700;
    text-decoration: underline;
    color: var(--ups-primary);
}

.access-troubleshooter {
    padding: 25px;
    border-top: 1px solid rgba(251, 191, 36, 0.2);
}

.access-troubleshooter h5 {
    font-size: 0.95rem;
    margin-bottom: 10px;
}

.troubleshoot-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.enroll-mini-btn {
    background: var(--ups-sidebar);
    color: #fff !important;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.8rem;
    text-decoration: none !important;
}

/* Mobile Specific Buttons */
.curriculum-toggle-mobile {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 15px;
    background: #f1f5f9;
    border: none;
    font-weight: 700;
    color: var(--ups-sidebar);
    cursor: pointer;
}

@media (min-width: 1025px) {
    .curriculum-toggle-mobile {
        display: none;
    }
}

/* Sidebar Footer & Progress */
.sidebar-footer {
    padding: 25px;
    background: rgba(0, 0, 0, 0.15);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.upschool-progress-card {
    margin-bottom: 5px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: #94a3b8;
}

.progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--ups-teal), #0d9488);
    width: 0%;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px rgba(20, 184, 166, 0.3);
}

/* Modal System */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-content {
    background: #fff;
    width: 100%;
    max-width: 650px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 24px;
    position: relative;
    padding: 30px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: modalPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Scrollbar for modal */
.modal-content::-webkit-scrollbar {
    width: 6px;
}

.modal-content::-webkit-scrollbar-track {
    background: transparent;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 10px;
}

@media (max-width: 640px) {
    .modal-content {
        padding: 20px;
        border-radius: 16px;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .review-title {
        font-size: 1.4rem;
    }
}

@keyframes modalPop {
    from {
        transform: scale(0.9) translateY(20px);
        opacity: 0;
    }

    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #f1f5f9;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #e2e8f0;
    color: #1e293b;
    transform: rotate(90deg);
}

/* Project Form */
.modal-header h3 {
    margin: 0 0 5px 0;
    font-size: 1.5rem;
    color: #0f172a;
}

.modal-header p {
    margin: 0 0 30px 0;
    color: #64748b;
    font-size: 0.95rem;
}

/* Job Board Styles */
/* Job Board Styles */
.jobs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    padding: 20px 0;
}

.job-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.job-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--ups-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.job-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: #cbd5e1;
}

.job-card:hover::before {
    opacity: 1;
}

.job-header {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    align-items: center;
}

.job-logo {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    object-fit: contain;
    background: #f1f5f9;
    padding: 8px;
    border: 1px solid #f8fafc;
    flex-shrink: 0;
}

.job-title {
    margin: 0 0 4px 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.3;
}

.job-company {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 500;
    display: block;
}

.job-meta {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
}

.badge.remote {
    background: #eff6ff;
    color: #3b82f6;
}

.badge.type {
    background: #f0fdf4;
    color: #16a34a;
}

.job-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    font-size: 0.8rem;
    color: #94a3b8;
}

.apply-btn {
    padding: 8px 16px;
    background: var(--ups-sidebar);
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    transition: opacity 0.2s;
}

.apply-btn:hover {
    opacity: 0.9;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: #334155;
    margin-bottom: 8px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1.5px solid #e2e8f0;
    font-family: inherit;
    font-size: 0.95rem;
    color: #1e293b;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--ups-primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
    outline: none;
}

.file-upload-wrapper {
    background: #f8fafc;
    border: 2px dashed #e2e8f0;
    padding: 20px;
    border-radius: 16px;
    text-align: center;
}

.file-upload-wrapper input {
    border: none !important;
    padding: 0 !important;
}

/* Reviewing Spinner Animation */
.spinner-container {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 30px;
}

.review-spinner {
    width: 100px;
    height: 100px;
    border: 4px solid #f1f5f9;
    border-top: 4px solid var(--ups-primary);
    border-radius: 50%;
    animation: spin 1s infinite linear;
}

.spinner-pulse {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 80px;
    height: 80px;
    background: rgba(79, 70, 229, 0.1);
    border-radius: 50%;
    animation: pulse 1.5s infinite ease-in-out;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(0.8);
        opacity: 0.5;
    }
}

.review-title {
    font-size: 1.8rem;
    margin: 0 0 10px 0;
    color: #0f172a;
}

.review-subtitle {
    color: #64748b;
    margin-bottom: 40px;
    line-height: 1.5;
}

/* Anticipation Timer */
.timer-container {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.timer-bar {
    height: 10px;
    background: #f1f5f9;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 10px;
}

.timer-fill {
    height: 100%;
    background: var(--ups-primary);
    width: 0%;
    transition: width 1s linear;
}

.timer-status {
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
}

.success-icon-bg {
    width: 100px;
    height: 100px;
    background: #ecfdf5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    margin: 0 auto;
    animation: successBounce 1s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes successBounce {
    0% {
        transform: scale(0);
    }

    70% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

@media print {
    @page {
        size: landscape;
        margin: 0;
    }

    html,
    body {
        height: 100%;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
        background: #fff !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .upschool-lms-container,
    .modal-overlay,
    .sidebar-footer,
    .stage-header,
    .course-tabs-wrapper,
    #close-cert,
    .nav-btn,
    #cert-viewer>div>div:last-child {
        display: none !important;
    }

    #cert-viewer {
        display: block !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
        z-index: 999999 !important;
    }

    #cert-viewer>div {
        margin: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        box-shadow: none !important;
        border: none !important;
    }

    #cert-canvas {
        width: 100vw !important;
        height: 100vh !important;
        overflow: hidden !important;
    }

    #cert-canvas img {
        width: 100vw !important;
        height: 100vh !important;
        object-fit: fill !important;
    }
}