/* ============================================================
   AOSA Course — frontend styles
   These are structural/functional styles. Override colours and
   typography in your theme to match your design system.
   ============================================================ */

/* Wrap */
#aosa-course-wrap {
    display: grid;
    grid-template-columns: 1fr 280px;
    grid-template-rows: auto auto 1fr;
    gap: 0 32px;
    max-width: 1100px;
    margin: 32px auto;
    padding: 0 24px;
}

/* Progress bar row — spans full width */
.aosa-progress-row {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
}
.aosa-progress-label-text {
    font-size: 13px;
    color: #555;
    white-space: nowrap;
}
.aosa-progress-track {
    flex: 1;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: visible;
    position: relative;
}
#aosa-progress-bar-fill {
    height: 100%;
    background: #4caf50;
    border-radius: 4px;
    transition: width 0.4s ease;
    position: relative;
}
#aosa-progress-bar-fill::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #4caf50;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px #4caf50;
}
#aosa-progress-label {
    font-size: 13px;
    color: #555;
    min-width: 36px;
    text-align: right;
}

/* Main content column */
.aosa-step-content {
    grid-column: 1;
}

/* Individual step panels */
[data-step-index] {
    display: none; /* JS shows the active one */
}
.aosa-step-panel,
.aosa-certificate-panel {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}
.aosa-step-panel.is-visible,
.aosa-certificate-panel.is-visible {
    opacity: 1;
}
.aosa-step-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 20px;
}

/* 16x9 Card Container for Step Content */
.aosa-step-content-card {
    width: 100%;
    max-width: 800px;
    height: 450px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* Content blocks inside the card */
.aosa-content-block {
    width: 100%;
    max-height: 100%;
    /* height: 100%; /* do not force height so content can vertically center */
}

/* Padded content (basic content and forms) */
.aosa-content-padded {
    padding: 24px;
    box-sizing: border-box;
    overflow-y: auto;
}

/* Video content (no padding, fills container) */
.aosa-content-video {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    padding: 0;
    height: 100%; /* most tabs  vertically center but embeds should take up full height */
}

.aosa-content-video iframe,
.aosa-content-video video,
.aosa-content-video embed {
    width: 100%;
    height: 100%;
    border: none;
}

/* Form submitted notice */
.aosa-form-submitted-notice {
    padding: 20px;
    background: #e8f5e9;
    border-radius: 4px;
    text-align: center;
}

.aosa-form-submitted-notice p {
    margin: 0;
    font-size: 15px;
    color: #2e7d32;
}

/* Certificate Display */
.aosa-cert-full-display {
    max-width: 900px;
    margin: 0 auto;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.aosa-cert-border {
    border: 6px double #1565c0;
    padding: 60px 40px;
    text-align: center;
}

.aosa-cert-header h1 {
    font-size: 48px !important;
    color: #1565c0;
    margin: 0 0 10px !important;
    letter-spacing: 2px;
    font-family: Georgia, serif;
}

.aosa-cert-header .cert-org {
    font-size: 16px;
    color: #666;
    margin: 0;
}

.aosa-cert-body {
    margin: 40px 0;
}

.aosa-cert-body p {
    font-size: 20px;
    margin: 12px 0;
    color: #555;
}

.aosa-cert-body .cert-name {
    font-size: 42px;
    font-weight: bold;
    color: #1a1a2e;
    border-bottom: 3px solid #1565c0;
    display: inline-block;
    padding: 0 32px 12px;
    margin: 24px 0;
}

.aosa-cert-body .cert-course {
    font-size: 32px;
    font-style: italic;
    color: #1565c0;
    margin: 24px 0;
}

.aosa-cert-body .cert-date {
    font-size: 16px;
    color: #888;
    margin-top: 48px;
}

.aosa-cert-preview {
    width: 100%;
    max-width: 700px;
    background: #fff;
    padding: 20px;
}

.aosa-cert-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.aosa-btn-download {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 24px;
    background: #1565c0;
    color: #fff !important;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s;
}

/* Sidebar */
.aosa-sidebar,
#aosa-course-wrap .ct-sidebar {
    grid-column: 2;
    grid-row: 2 / 4;
    align-self: start;
    position: sticky;
    top: 24px;
}
/*
.aosa-module-details,
#aosa-course-wrap .ct-widget {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    background: #f9f9f9;
    font-size: 13px;
}
.aosa-module-details h3,
#aosa-course-wrap .ct-widget h3 {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 16px;
}
*/
#aosa-course-wrap .aosa-detail-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    margin-bottom: 2px;
}
.aosa-detail-value {
    font-size: 14px;
    margin-bottom: 16px;
}
.aosa-detail-value a {
    color: #1565c0;
    text-decoration: none;
}

/* Sidebar step list */
.aosa-step-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.aosa-sidebar-step {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 13px;
    color: #444;
    border-bottom: 1px solid #eee;
    gap: 8px;
    transition: opacity 0.2s, background-color 0.15s;
}
.aosa-sidebar-step:last-child { border-bottom: none; }
.aosa-sidebar-step.is-accessible { cursor: pointer; }
.aosa-sidebar-step.is-accessible:hover { color: #1565c0; text-decoration: underline; }
.aosa-sidebar-step.is-locked { cursor: not-allowed; opacity: 0.5; }
.aosa-sidebar-step.is-active  { font-weight: 700; color: #1565c0; }
.aosa-sidebar-step.is-complete .aosa-step-check { color: #4caf50; }
.aosa-sidebar-step.is-pending  .aosa-step-check { color: #f9a825; }
.aosa-sidebar-step .aosa-step-name { flex: 1; }
.aosa-step-check {
    font-size: 16px;
    color: #ccc;
    flex-shrink: 0;
}

/* Navigation buttons */
.aosa-nav {
    grid-column: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #eee;
}

/* Primary button styles */
.aosa-btn,
#aosa-course-wrap .ct-button {
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    text-decoration: none;
    display: inline-block;
    white-space: nowrap;
}
.aosa-btn:disabled,
#aosa-course-wrap .ct-button:disabled {opacity: 0.5;
     cursor: default;
     background: #ccc;
     color: #333;
}

/* Secondary/ghost button styles */
#aosa-course-wrap .ct-button-ghost {
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    text-decoration: none;
    display: inline-block;
}
#aosa-course-wrap .ct-button-ghost:hover:not(:disabled) {
}
#aosa-course-wrap .ct-button-ghost:disabled {
    opacity: 0.4;
    cursor: default;
}

/* Legacy button-primary class support */

.aosa-btn-locked {
    border-color: #bbb;
    color: #bbb;
}

/* Gate message */
.aosa-gate-msg {
    color: #c62828;
    font-size: 13px;
    margin: 0 10px;
    text-align: center;
}

/* Course complete banner */
.aosa-complete-banner {
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
    border-radius: 6px;
    padding: 16px 20px;
    margin-bottom: 24px;
    color: #1b5e20;
    font-size: 15px;
    grid-column: 1 / -1;
}

/* Responsive: stack on small screens */
@media (max-width: 920px) {
    #aosa-course-wrap {
        grid-template-columns: 1fr;
    }
    .aosa-sidebar {
        grid-column: 1;
        grid-row: auto;
        position: static;
    }
    
    .aosa-sidebar, #aosa-course-wrap .ct-sidebar {
       grid-column: 1;
       grid-row: auto;
       margin-top: 1em;
    }
}
