/* =================================================================================
   1. LOGIN PAGE - GLOBAL & MOBILE OVERRIDES
   ================================================================================= */

/* Force blue background on root HTML, Body, and Canvas mobile wrapper elements */
html.cps-is-login-page,
body.cps-is-login-page,
html.cps-is-login-page #application,
html.cps-is-login-page #wrapper,
html.cps-is-login-page #content,
html.cps-is-login-page .ic-Layout-wrapper {
    background-color: #2a17d4 !important;
}

/* Force login container to align centrally */
.ic-Login {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    margin: 0 !important;
    background-color: transparent !important;
}

/* Hide native form inputs & wrappers on login page unless in Admin mode */
html.cps-is-login-page:not(.cps-admin-mode) .ic-Login__body, 
html.cps-is-login-page:not(.cps-admin-mode) .ic-Login__actions, 
html.cps-is-login-page:not(.cps-admin-mode) .ic-Form-group, 
html.cps-is-login-page:not(.cps-admin-mode) #login_form,
html.cps-is-login-page:not(.cps-admin-mode) form[action*="/login"],
html.cps-is-login-page:not(.cps-admin-mode) .ic-Login__footer { 
    display: none !important; 
}

/* Reveal native form inputs specifically for Admin Login (?admin=true) */
html.cps-admin-mode .ic-Login__body,
html.cps-admin-mode .ic-Login__actions,
html.cps-admin-mode .ic-Login .ic-Form-group,
html.cps-admin-mode #login_form,
html.cps-admin-mode form[action*="/login"],
html.cps-admin-mode .ic-Login__footer {
    display: block !important;
}

html.cps-admin-mode .ic-Login__actions {
    display: flex !important;
}

/* =================================================================================
   2. MOBILE SPECIFIC LOGIN STYLING
   ================================================================================= */
@media only screen and (max-width: 767px) {
    /* The ultimate iOS scroll killer */
    body.ic-Login-Body {
        background-color: #2a17d4 !important;
        width: 100vw !important; 
        height: 100vh !important;
        height: 100dvh !important; /* Modern iOS dynamic viewport height */
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
        overflow: hidden !important; 
        position: fixed !important; /* physically prevents scrolling */
        top: 0 !important;
        left: 0 !important;
    }

    #application, .ic-Login-Body, .ic-Login {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        background-color: transparent !important;
        margin: 0 !important;
        padding: 0 !important;
        transform: none !important;
    }

    /* Set exact 400px limit, centered */
    .ic-Login__container, .ic-Login__content {
        display: block !important;
        width: 100% !important;
        max-width: 400px !important; 
        margin: 0 auto !important;
        padding: 0 15px !important;
        border: none !important;
        box-shadow: none !important;
        position: static !important;
        box-sizing: border-box !important;
    }

    .ic-Login__innerContent {
        padding-top: 0 !important;
    }

    .ic-Login-header__logo img,
    .ic-Login-header__logo svg,
    .mobileLogin-Header img {
        display: none !important;
		flex: 0 0 100%;
    }

    .mobileLogin-Header, .ic-Login__header, .ic-Login-header {
        background-image: url('/pub_files/CPS-logo-wide-white-trans.png') !important; 
        background-repeat: no-repeat !important;
        background-position: center center !important; 
        background-size: contain !important; 
        width: 100% !important;
        max-width: 250px !important;
        height: 80px !important; 
        min-height: 80px !important;
        margin: 10px auto 15px auto !important; 
        padding: 0 !important;
        display: block !important;
        border: none !important;
        position: relative !important;
        z-index: 10 !important;
    }

    .mobileLogin-Header:after, .ic-Login__header:after, .ic-Login-header:after {
        display: none !important;
        content: none !important;
    }
}

/* =================================================================================
   3. CUSTOM LOGIN MESSAGE WRAPPER (Desktop & Mobile Layout)
   ================================================================================= */
   
/* Base styles shared by both devices */
#cps-custom-login-wrapper {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    box-sizing: border-box !important;
    text-align: center !important;
    z-index: 10 !important;
}

/* Desktop Layout */
#cps-custom-login-wrapper.cps-is-desktop {
    position: relative !important;
    margin: 30px 0 30px 0 !important;
    padding: 0 20px !important;
}

/* Mobile Layout - Dynamic positioning to prevent overlap */
#cps-custom-login-wrapper.cps-is-mobile {
    position: relative !important;
    margin: 10px auto !important;
    padding: 0 15px !important;
    max-width: 360px !important;
    z-index: 100 !important;
}

/* Force the Canvas footer to stop overlapping on desktop */
.ic-Login-footer {
    position: relative !important;
    margin-top: 20px !important;
}


/* =================================================================================
   4. INJECTED ELEMENT STYLING (Login Text & Buttons)
   ================================================================================= */
   
#cps-custom-login-wrapper h2 {
    color: #ffffff !important;
    margin: 0 0 15px 0 !important;
    font-size: 22px !important;
    font-weight: bold !important;
    font-family: sans-serif !important;
    line-height: 1.2 !important;
}

#cps-custom-login-wrapper p {
    color: #ffffff !important;
    margin: 0 0 25px 0 !important;
    font-size: 15px !important;
    font-family: sans-serif !important;
}

#cps-custom-login-wrapper a.cps-login-btn {
    display: inline-block !important;
    background-color: rgba(255,255,255,0.1) !important;
    border: 2px solid #ffffff !important;
    padding: 10px 30px !important;
    color: #ffffff !important;
    text-decoration: none !important;
    border-radius: 12px !important;
    font-weight: bold !important;
    font-size: 17px !important;
    box-sizing: border-box !important;
    touch-action: manipulation;
}

#cps-custom-login-wrapper a.cps-login-btn:hover {
    background-color: rgba(255,255,255,0.2) !important;
}

/* Profile SSO Banner Styling */
#custom-sso-banner {
    margin-bottom: 25px;
}

#custom-sso-banner .cps-sso-alert {
    background: #e8f4fd !important;
    border-left: 5px solid #0078d4 !important;
    padding: 15px !important;
    border-radius: 4px !important;
    color: #333 !important;
}

#custom-sso-banner .cps-sso-alert a {
    font-weight: bold !important;
}


/* =================================================================================
   5. FORUM MODE (GROUP PAGES) - SIDEBAR NAVIGATION
   ================================================================================= */

html.cps-is-group-page #left-side > *:not(#cps-group-course-home),
body[class*="context-group_"] #left-side > *:not(#cps-group-course-home) {
    display: none !important;
}

#cps-group-course-home {
    list-style: none !important;
    padding: 0 !important;
    margin: 40px 0 20px 20px !important;
}

/* 
.cps-course-home-btn {
    display: flex !important;
    align-items: center !important;
    padding: 10px 12px !important;
    background-color: #f5f5f5 !important;
    color: #2D3B45 !important; 
    text-decoration: none !important;
    font-weight: bold !important;
    border-radius: 4px !important;
    border-left: 3px solid #0078d4 !important;
    transition: background-color 0.2s ease !important;
}

.cps-course-home-btn:hover, .cps-course-home-btn:focus {
    background-color: #e8ecee !important;
    text-decoration: none !important;
}
*/

/* =================================================================================
   6. MISCELLANEOUS
   ================================================================================= */

ul {
	padding-top: 10px;
}


/* logo container on login page */
.ic-Login-header__logo {
	flex: 0 0 100% !important;
}


/* Remove course card color overlay globally */
.ic-DashboardCard__header_hero {
	background-color: transparent !important;
	border: 1px solid #e0e0e0 !important;
}

/* Hide "Course Groups" on home page */
body.home #right-side #course_show_secondary h2.course-groups-home-rside-header, 
body.home #right-side #course_show_secondary h2.course-groups-home-rside-header + ul.unstyled_list.group_list {
    display: none !important;
}

.pages #wiki_page_show, .module-sequence-footer {
    padding-bottom: 30px;
}

.module-sequence-footer {
    padding-top: 30px;
}

.pages li {
    padding-bottom: 12px;
}

/* Hide global nav calendar link */
li:has(#global_nav_calendar_link) {
    display: none !important;
}

.page-featured-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Course home pages */
body.home[class*="context-course_"] #course_home_content h3 {
    margin-top: 30px !important;
    padding: 12px !important;
    background-color: #f9c34d !important;
    font-weight: 600 !important;
    color: #0f065a;
}

details {
    margin-bottom: 10px; 
    border: 1px solid #c7cdd1; 
    padding: 10px;
}

summary {
    font-weight: bold;
    cursor: pointer; 
    font-size: 1.1em; 
    color: #2d3b45;
}

details div.details-content {
    margin-top: 10px;
    padding-left: 15px;
}

details .btn {
    color: var(--ic-brand-button--primary-text) !important;
    text-decoration: none;
}

/* Allow full discussion titles on mobile */
.discussion-title, .ig-title {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    line-height: 1.4em !important;
}

.discussion-author-name {
    display: block;
    font-size: 0.85em;
    color: #5b6670;
    margin-top: 4px;
    margin-bottom: 15px;
    font-weight: normal;
}


/* MEDIA PLAY BOXES */
.audio-box {
    background-color: #f9fafb; 
    border: 1px solid #e5e7eb; 
    border-radius: 12px; 
    padding: 20px; 
    max-width: 350px; 
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05); 
    margin: 30px auto 40px auto;
}

.audio-box .prompt h3 {
    margin: 0 0 15px 0; 
    color: #1f2937; 
    font-size: 1.25rem; 
}

.audio-box .player audio {
    width: 100%;
    outline: none;
}

.audio-box .hint span {
    font-size: 0.8rem;
    color: #6b7280;
    font-style: italic;
}

.video-box {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    margin: 25px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
}

.video-box .prompt h3 {
    margin: 0 0 15px 0;
    color: #0f172a;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.video-box video, .video-box iframe {
    width: 100% !important; 
    height: auto !important; 
    aspect-ratio: 16 / 9; 
    border-radius: 6px;
    background-color: #000000;
    display: block; 
}

.video-box .hint span {
    font-size: 0.85rem;
    color: #64748b;
    font-style: italic;
}




/* PAGE FOOTER: Breadcrumb Style */
.page-nav-footer {
    margin-top: 40px;
    display: flex;
}

.page-nav-footer ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center; 
    flex-wrap: wrap; 
}

.page-nav-footer li {
    margin: 0;
    display: flex;
    align-items: center;
}

.page-nav-footer li:not(:last-child)::after {
    content: "\203A"; 
    margin: 0 10px; 
    color: #94a3b8; 
    font-size: 1.2rem; 
}

.page-nav-footer a {
    color: #2563eb; 
    text-decoration: none !important;
    font-weight: 500; 
    transition: color 0.2s ease;
}

.page-nav-footer a:hover, .page-nav-footer a:focus {
    color: #1e3a8a; 
    text-decoration: underline !important; 
}

.page-nav-footer li:last-child a {
    color: #64748b;
    pointer-events: none; 
    font-weight: 400;
}

/* RESOURCE PAGE STYLING */
.resource-page-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.resource-page-prompt {
    background-color: #f0f9ff;
    border-left: 5px solid #0284c7;
    padding: 15px 20px;
    border-radius: 0 8px 8px 0;
    margin: 30px 0;
}

.resource-page-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.resource-page-list li {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center; 
    flex-wrap: wrap;
    gap: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.resource-page-list li a {
    text-decoration: none !important;
    color: #64748b !important;
    font-weight: 600 !important;
    font-size: 1.1rem !important;
}

.resource-page-list li span {
    color: #64748b;
    font-size: 0.85rem;
    margin-left: auto; 
}

/* Responsive collapse for resource list items on narrow phones */
@media (max-width: 480px) {
    .resource-page-list li {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .resource-page-list li span {
        margin-left: 0;
    }
}