/**
 * Course Finder Block Styles
 */

/* ============================================
   Container & Layout
   ============================================ */

.fx-course-finder-block {
    position: relative;
    padding: 60px 20px;
    background: #ffffff;
    overflow: hidden;
}

/* Background line chart graphic */
.fx-course-finder-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 800"><path d="M0,600 Q300,400 600,450 T1200,500" fill="none" stroke="%23e0e0e0" stroke-width="1" opacity="0.3"/><path d="M0,500 Q300,300 600,350 T1200,400" fill="none" stroke="%23e0e0e0" stroke-width="1" opacity="0.3"/><path d="M0,400 Q300,200 600,250 T1200,300" fill="none" stroke="%23e0e0e0" stroke-width="1" opacity="0.3"/></svg>');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    pointer-events: none;
    opacity: 0.5;
    z-index: 0;
}

.fx-course-finder-container {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    z-index: 1;
}

/* ============================================
   Header Section
   ============================================ */

.fx-course-finder-header {
    text-align: center;
    margin-bottom: 40px;
}

.fx-course-finder-title {
    font-size: 36px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 15px 0;
    line-height: 1.2;
}

.fx-course-finder-intro {
    font-size: 16px;
    color: #666;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.5;
}

/* ============================================
   Toggle Buttons
   ============================================ */

.fx-course-finder-toggle {
    display: flex;
    justify-content: center;
    gap: 0;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.fx-toggle-btn {
    padding: 12px 30px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 2px solid #34495e;
    background: #ffffff;
    color: #34495e;
    cursor: pointer;
    transition: all 0.3s ease;
    border-right: none;
    position: relative;
}

.fx-toggle-btn:first-child {
    border-radius: 4px 0 0 4px;
}

.fx-toggle-btn:last-child {
    border-radius: 0 4px 4px 0;
    border-right: 2px solid #34495e;
}

.fx-toggle-btn:hover {
    background: #ecf0f1;
}

.fx-toggle-btn.active {
    background: #34495e;
    color: #ffffff;
    z-index: 1;
}

/* ============================================
   Views Container
   ============================================ */

.fx-course-finder-views {
    position: relative;
    min-height: 300px;
}

.fx-view {
    display: none;
}

.fx-view.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   Category Buttons
   ============================================ */

.fx-category-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin: 0 auto;
}

.fx-category-btn {
    padding: 30px;
    font-size: 18px;
    font-weight: 600;
    color: #34495e;
    background: #ffffff;
    border: 0;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    box-shadow: 0 0 35px 0 rgba(12, 27, 57, 0.23);
    text-transform: uppercase;
    -webkit-font-smoothing: antialiased;
}

.fx-category-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 35px 0 rgba(12, 27, 57, 0.1);
}

.fx-category-btn.active {
    background: #FF8B3D;
    color: #ffffff;
}

/* ============================================
   Lightbox Overlay
   ============================================ */

.fx-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(52, 73, 94, 0.85);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* ============================================
   Lightbox Common Styles
   ============================================ */

.fx-lightbox {
    position: relative;
    background: #ffffff;
    border-radius: 8px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: lightboxSlideIn 0.3s ease;
}

@keyframes lightboxSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.fx-lightbox-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    font-size: 30px;
    line-height: 1;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fx-lightbox-close:hover {
    color: #FF8B3D;
    transform: rotate(90deg);
}

.fx-subskill-details-lightbox .fx-lightbox-back {
    position: absolute;
    top: 10px;
    left: calc(20% + 20px);
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    font-size: 30px;
    line-height: 1;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fx-lightbox-back:hover {
    color: #FF8B3D;
    transform: translateX(-5px);
}

.fx-lightbox-content {
    padding: 60px 40px 40px;
}

.fx-subskill-details-lightbox .fx-lightbox-content,
.fx-course-details-lightbox .fx-lightbox-content,
.fx-role-details-lightbox .fx-lightbox-content {
    padding: 0;
}

.fx-course-details-lightbox .fx-subskill-info,
.fx-role-details-lightbox .fx-subskill-info {
    padding-top: 30px;
}

.fx-subskill-details-lightbox .fx-lightbox-header {
    position: relative;
}

.fx-subskill-details-lightbox .fx-subskill-info-header .fx-lightbox-close, 
.fx-subskill-details-lightbox .fx-subskill-info-header .fx-lightbox-back {
    position: relative;
}

.fx-subskill-details-lightbox .fx-subskill-info-header .fx-lightbox-close {
    right: 0;
}

.fx-subskill-details-lightbox .fx-subskill-info-header .fx-lightbox-back {
    left: 0;
}

.fx-subskill-details-lightbox .fx-subskill-info-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 30px;
}

.fx-subskill-details-lightbox .fx-lightbox-content-header {
    display: none;
}

/* ============================================
   Carousel Navigation
   ============================================ */

.fx-carousel-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
    padding: 15px 0;
    border-bottom: 1px solid #e0e0e0;
}

.fx-carousel-prev,
.fx-carousel-next {
    width: 40px;
    height: 40px;
    border: 2px solid #FF8B3D;
    background: #ffffff;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #FF8B3D;
}

.fx-carousel-prev:hover,
.fx-carousel-next:hover {
    background: #FF8B3D;
    color: #ffffff;
    transform: scale(1.1);
}

.fx-carousel-prev.disabled,
.fx-carousel-next.disabled {
    border-color: #ccc;
    color: #ccc;
    cursor: not-allowed;
    opacity: 0.5;
}

.fx-carousel-prev.disabled:hover,
.fx-carousel-next.disabled:hover {
    background: #ffffff;
    color: #ccc;
    transform: none;
}

.fx-carousel-counter {
    font-size: 14px;
    font-weight: 600;
    color: #666;
    background: #f8f9fa;
    padding: 8px 16px;
    border-radius: 20px;
    min-width: 60px;
    text-align: center;
}

/* ============================================
   Loading and Error States
   ============================================ */

.fx-loading {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
}

.fx-loading::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #FF8B3D;
    border-radius: 50%;
    animation: fx-spin 1s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes fx-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.fx-error {
    text-align: center;
    padding: 40px 20px;
    color: #e74c3c;
    background: #fdf2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    margin: 20px 0;
}

/* ============================================
   Role Details Lightbox
   ============================================ */

.fx-role-details-lightbox {
    max-width: 900px;
    width: 100%;
}

.fx-role-detail {
    padding: 0;
}

.fx-role-detail-inner {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
}

.fx-role-info {
    text-align: center;
    padding: 40px 30px;
}

.fx-role-title {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 20px 0;
}

.fx-role-description {
    font-size: 16px;
    color: #555;
    line-height: 1.5;
    margin: 0 0 30px 0;
}

.fx-role-description p {
    margin: 0 0 15px 0;
}

.fx-role-description p:last-child {
    margin-bottom: 0;
}

.fx-role-description ul,
.fx-role-description ol {
    margin: 0 0 15px 20px;
}

.fx-role-description li {
    margin-bottom: 8px;
}

.fx-role-description strong,
.fx-role-description b {
    font-weight: 600;
    color: #2c3e50;
}

.fx-role-description em,
.fx-role-description i {
    font-style: italic;
}

.fx-role-description a {
    color: #FF8B3D;
    text-decoration: underline;
}

.fx-role-description a:hover {
    color: #e57a2e;
}

.fx-role-description h1,
.fx-role-description h2,
.fx-role-description h3,
.fx-role-description h4,
.fx-role-description h5,
.fx-role-description h6 {
    color: #2c3e50;
    font-weight: 600;
    margin: 0 0 10px 0;
}

.fx-role-description blockquote {
    border-left: 4px solid #FF8B3D;
    padding-left: 15px;
    margin: 0 0 15px 0;
    font-style: italic;
    color: #666;
}

.fx-role-subskills {
    margin: 30px 0;
}

.fx-role-subskills h4 {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 15px 0;
}

/* Related Courses in Role View */
.fx-role-courses {
    margin: 30px 0;
}

.fx-role-courses h4 {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 15px 0;
}

/* Course tags use same styling as subskill/role tags */
.fx-course-clickable {
    cursor: pointer;
    transition: all 0.3s ease;
}

.fx-course-clickable:hover {
    background: #FF8B3D;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 139, 61, 0.3);
}

.fx-no-courses {
    color: #999;
    font-style: italic;
    margin: 0;
    padding: 10px 0;
}

.fx-role-cta {
    display: inline-block;
    background: #FF8B3D;
    color: #ffffff;
    padding: 12px 30px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    line-height: 1.5;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.fx-role-cta:hover {
    background: #e67e22;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 139, 61, 0.3);
}

/* ============================================
   Subskills Lightbox (Step 2)
   ============================================ */

.fx-subskills-lightbox {
    max-width: 700px;
    width: 100%;
}

.fx-subskills-lightbox .fx-lightbox-title {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 10px 0;
    text-align: left;
}

.fx-subskills-lightbox .fx-lightbox-subtitle {
    font-size: 16px;
    color: #666;
    line-height: 1.5;
    margin: 0 0 30px 0;
    text-align: left;
}

.fx-subskills-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.fx-subskill-btn {
    padding: 15px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #34495e;
    background: #ffffff;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    box-shadow: 0 0 35px 0 rgba(12, 27, 57, 0.12);
}

.fx-subskill-btn:hover {
    transform: translateY(-2px);
}

.fx-subskill-btn.active {
    background: #FF8B3D;
    color: #ffffff;
}

/* ============================================
   Subskill Details Lightbox (Step 3)
   ============================================ */

.fx-subskill-details-lightbox {
    max-width: 900px;
    width: 100%;
}

.fx-subskill-detail {
    padding: 0;
}

.fx-subskill-detail-inner {
    display: flex;
    gap: 0;
}

.fx-subskill-image {
    flex: 0 0 30%;
    max-width: 30%;
    position: relative;
}

.fx-subskill-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 0;
}

/* Gradient Background Mode */
.fx-subskill-image.fx-gradient-background {
    /* Gradient is set inline via style attribute */
    width: 100%;
    min-height: 400px;
}

/* Logo Overlay on Background */
.fx-background-logo {
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translate(-50%, 0);
    width: 80%;
    max-width: 300px;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.fx-background-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.fx-subskill-info {
    flex: 1;
    padding: 0 30px 30px 30px;
    position: relative;
}

.fx-subskill-title {
    font-size: 26px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 10px 0;
    line-height: 1.3;
}

.fx-subskill-caption {
    font-size: 16px;
    font-weight: 600;
    color: #FF8B3D;
    line-height: 1.5;
    margin: 0;
}

.fx-subskill-text {
    font-size: 16px;
    font-weight: 300;
    color: #666;
    line-height: 1.5;
    margin: 5px 0 15px 0;
}

.fx-subskill-description {
    font-size: 16px;
    color: #666;
    line-height: 1.5;
    margin: 0 0 20px 0;
}

/* Handle WYSIWYG content in subskill descriptions */
.fx-subskill-description p {
    margin: 0 0 10px 0;
}

.fx-subskill-description p:last-child {
    margin-bottom: 0;
}

.fx-subskill-description ul,
.fx-subskill-description ol {
    margin: 0 0 10px 20px;
}

.fx-subskill-description strong {
    font-weight: 600;
}

.fx-subskill-description em {
    font-style: italic;
}

.fx-subskill-description a {
    color: #FF8B3D;
    text-decoration: underline;
}

.fx-subskill-description a:hover {
    color: #e57a2e;
}

.fx-subskill-cta {
    display: inline-block;
    padding: 14px 35px;
    font-size: 15px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #ffffff;
    background: #FF8B3D;
    border: none;
    border-radius: 0;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(255, 139, 61, 0.3);
    position: relative;
    z-index: 2;
}

.fx-subskill-cta:hover {
    background: #e57a2e;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 139, 61, 0.4);
}

.fx-subskill-cta::after {
    content: '';
    border: 2px solid #003763;
    width: 100%;
    height: 100%;
    position: absolute;
    left: 10px;
    top: 10px;
    mix-blend-mode: lighten; 
    z-index: -1;
}

/* ============================================
   Course Details Lightbox (for Course View)
   ============================================ */
/* NOTE: Course View now uses .fx-subskill-* classes (same as Skills View)
   for consistent styling across both views */

.fx-course-details-lightbox {
    max-width: 900px;
    width: 100%;
}

.fx-course-detail {
    padding: 0;  /* Updated to match subskill view */
}

/* Related subskills tags in course view */
.fx-course-subskills {
    margin-bottom: 20px;
}

.fx-course-subskills h4 {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    line-height: 1.5;
    margin: 0 0 10px 0;
}

.fx-subskill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.fx-subskill-tag {
    display: inline-block;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #34495e;
    background: #ecf0f1;
    border-radius: 20px;
}

.fx-subskill-clickable,
.fx-role-clickable,
.fx-subskill-tag {
    cursor: pointer;
    transition: all 0.3s ease;
}

.fx-subskill-clickable:hover,
.fx-role-clickable:hover,
.fx-subskill-tag:hover {
    background: #FF8B3D;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 139, 61, 0.3);
}


/* ============================================
   Slick Slider Customization
   ============================================ */

.fx-course-slider {
    position: relative;
}

.fx-course-slider .slick-dots {
    bottom: -40px;
}

.fx-course-slider .slick-dots li button:before {
    font-size: 10px;
    color: #ccc;
}

.fx-course-slider .slick-dots li.slick-active button:before {
    color: #FF8B3D;
}

.fx-course-slider .slick-prev,
.fx-course-slider .slick-next {
    width: 40px;
    height: 40px;
    background: #FF8B3D;
    border-radius: 50%;
    z-index: 10;
}

.fx-course-slider .slick-prev:hover,
.fx-course-slider .slick-next:hover {
    background: #e57a2e;
}

.fx-course-slider .slick-prev {
    left: -50px;
}

.fx-course-slider .slick-next {
    right: -50px;
}

.fx-course-slider .slick-prev:before,
.fx-course-slider .slick-next:before {
    font-size: 24px;
    color: #ffffff;
}

/* ============================================
   Responsive Styles
   ============================================ */

/* Tablet */
@media (max-width: 768px) {
    .fx-course-finder-title {
        font-size: 28px;
    }
    
    .fx-course-finder-intro {
        font-size: 14px;
    }
    
    /* 2-button toggle stays horizontal on tablet */
    .fx-toggle-btn {
        flex: 1;
        padding: 10px 20px;
        font-size: 12px;
    }
    
    /* Subskill detail layout - content first, then image/gradient */
    .fx-subskill-detail-inner {
        flex-direction: column-reverse;
    }
    
    .fx-subskill-image {
        height: 165px;
        flex: 0 0 auto;
        max-width: 100%;
        width: 100%;
    }
    
    .fx-subskill-image.fx-gradient-background {
        height: 165px;
        min-height: 165px;
        /* Override gradient direction on mobile - bottom to top instead of left to right */
        background: linear-gradient(to top, var(--gradient-color) 0%, rgba(255,255,255,0) 100%) !important;
    }
    
    /* Logo on mobile - slightly smaller */
    .fx-background-logo {
        width: 95%;
    }
    
    .fx-subskill-info {
        padding: 30px 20px 20px 20px;
    }
    
    .fx-subskill-details-lightbox .fx-lightbox-back {
        left: 10px;
    }
    
    .fx-lightbox-content {
        padding: 50px 20px 30px;
        position: relative;
    }

    .fx-subskill-details-lightbox .fx-lightbox-content {
        padding: 0;
    }

    .fx-subskill-details-lightbox .fx-lightbox-content-header {
        display: block;
        padding-bottom: 15px;
    }

    .fx-subskill-details-lightbox .fx-subskill-info-header {
        display: none;
    }
    
    /* Carousel navigation mobile */
    .fx-carousel-nav {
        gap: 15px;
        margin: 15px 0;
        padding: 10px 0;
    }
    
    .fx-carousel-prev,
    .fx-carousel-next {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    .fx-carousel-counter {
        font-size: 12px;
        padding: 6px 12px;
        min-width: 50px;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .fx-course-finder-block {
        padding: 40px 15px;
    }
    
    .fx-course-finder-title {
        font-size: 24px;
    }
    
    .fx-course-finder-intro {
        font-size: 13px;
    }
    
    .fx-toggle-btn {
        font-size: 11px;
        padding: 8px 15px;
    }
    
    .fx-category-btn {
        padding: 15px 20px;
        font-size: 14px;
        width: 100%;
    }
    
    .fx-lightbox {
        max-width: 95%;
        border-radius: 4px;
    }
    
    .fx-subskills-lightbox .fx-lightbox-title {
        font-size: 22px;
    }
    
    .fx-subskills-buttons {
        grid-template-columns: 1fr;
    }
    
    .fx-course-title {
        font-size: 22px;
    }
    
    
    
    .fx-course-slider .slick-prev,
    .fx-course-slider .slick-next {
        width: 35px;
        height: 35px;
    }
    
    .fx-course-slider .slick-prev:before,
    .fx-course-slider .slick-next:before {
        font-size: 20px;
    }
}

/* Very small mobile */
@media (max-width: 360px) {
    .fx-course-finder-title {
        font-size: 20px;
    }
    
    .fx-toggle-btn {
        font-size: 10px;
        padding: 7px 10px;
    }
    
    .fx-lightbox-content {
        padding: 45px 15px 25px;
    }
}

/* ============================================
   Utility Classes
   ============================================ */

.fx-course-data {
    display: none !important;
}

/* Print styles */
@media print {
    .fx-lightbox-overlay {
        display: none !important;
    }
}

