/* ========================================
   PROGRAMS PUBLIC VIEW
   Main CSS for the public programs page
   (formerly learning network)
   ======================================== */

/* Learning Stations & CEFR Guide Styles */

/* Prevent horizontal overflow */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}

.container-fluid {
    max-width: 100%;
    overflow-x: hidden;
}

/* Override adult theme header with more specific selector */
.container-fluid .header,
body .header {
    padding: 40px 0 40px !important;
    margin-bottom: 0 !important;
    text-align: center;
}

.header h1 {
    font-size: 28px;
    font-weight: 300;
    color: #333;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.header p {
    font-size: 16px;
    color: #666;
    font-weight: 300;
}

.explanation-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 80px;
    margin-bottom: 80px;
    align-items: start;
}

.section {
    position: relative;
}

.cefr-section {
    margin-bottom: 60px;
    width: 100vw;
    background: white;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    padding-left: calc(50vw - 50% + 15px);
    padding-right: calc(50vw - 50% + 15px);
    padding-top: 20px;
    padding-bottom: 20px;
    position: relative;
}

.learning-stations-section {
    width: 100%;
}

.section-title {
    font-size: 20px;
    font-weight: 400;
    color: #333;
    margin-bottom: 32px;
    letter-spacing: -0.3px;
}

/* Program Info Container */
.program-info-container {
    margin-bottom: 40px;
}

.program-info-header {
    text-align: center;
    margin-bottom: 30px;
}

.program-info-header h1 {
    font-size: 32px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

/* Search and Filter Styles */
.search-section {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
    align-items: center;
    position: relative;
}

#program-search, #cefr-filter {
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    flex: 1;
    transition: border-color 0.2s ease;
}

#program-search:focus, #cefr-filter:focus {
    border-color: #0066cc;
    outline: none;
}

#cefr-filter {
    flex: 0 0 200px;
    background: white;
}

/* Explanation Section Styles */
.explanation-content-wrapper {
    display: flex;
    gap: 40px;
}

.explanation-left {
    flex: 0 0 40%;
}

.explanation-right {
    flex: 0 0 60%;
}

.explanation-diagram {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.explanation-item {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.explanation-lines {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.explanation-line {
    display: flex;
    align-items: center;
    gap: 15px;
}

.line-connector {
    width: 40px;
    height: 2px;
    background: #333;
    border-radius: 1px;
}

.line-text {
    font-size: 18px;
    font-weight: 500;
    white-space: nowrap;
    color: #333;
}

.explanation-notes {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 600px;
    text-align: left;
}

.note-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.note-bullet {
    font-size: 20px;
    font-weight: bold;
    color: #333;
}

.note-text {
    flex: 1;
    line-height: 1.5;
    color: #666;
}

/* BCK Characters Image Styling */
.bck-characters-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    margin: 30px 0;
    overflow: hidden;
}

.bck-characters-image {
    max-width: 100%;
    max-height: 250px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

/* Explanation Section Styles */
.explanation-section {
    background: white;
    color: #333;
    padding: 40px;
    border-radius: 20px;
    margin-bottom: 40px;

    border: 2px solid #e0e0e0;
}

.explanation-title {
    font-size: 32px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 40px;
    color: #333;
}

/* Interactive Title */
.interactive-title {
    font-size: 20px;
    font-weight: 400;
    color: #333;
    padding: 40px;
    text-align: center;
    letter-spacing: -0.3px;
}

/* Program Showcase Carousel */
.program-carousel-container {
    grid-column: 1 / -1;
    margin: 0;
    max-width: 100%;
}

.carousel-track-container {
    position: relative;
    overflow: hidden;
    border-radius: 12px;

    background: white;
    height: 250px;
}

.carousel-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
    height: 100%;
}

.carousel-slide {
    min-width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    padding: 20px;
}

.carousel-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #e0e0e0;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;

    z-index: 10;
}

.carousel-btn-prev {
    left: 10px;
}

.carousel-btn-next {
    right: 10px;
}

.carousel-btn:hover {
    background: white;
    border-color: #ccc;
    transform: translateY(-50%) scale(1.1);
}

.carousel-btn:active {
    transform: translateY(-50%) scale(0.95);
}

/* Drawing Board Modal Styles */
.modal-blackboard {
    display: none; 
    position: fixed; 
    z-index: 2000; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgba(0,0,0,0.7); 
    padding-top: 50px;
}

.modal-content-blackboard {
    background-color: #fefefe;
    margin: auto;
    padding: 0;
    border: 1px solid #888;
    width: 90%;
    max-width: 1000px;

    animation-name: animatetop;
    animation-duration: 0.4s
}

.modal-header-blackboard {
    padding: 15px;
    background-color: #f8f9fa;
    color: #333;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body-blackboard {
    height: 70vh;
    position: relative;
}

#blackboardCanvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

.modal-footer-blackboard {
    padding: 10px 15px;
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.controls-group {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
}

.close-btn-blackboard {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-btn-blackboard:hover,
.close-btn-blackboard:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .explanation-content-wrapper {
        flex-direction: column;
        gap: 20px;
    }
    
    .explanation-left,
    .explanation-right {
        flex: none;
        width: 100%;
    }
    
    .bck-characters-image {
        max-height: 200px;
    }
}

@media (max-width: 768px) {
    .explanation-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .header h1 {
        font-size: 24px;
    }
    
    .cefr-section {
        padding: 15px 10px;
    }
    
    .search-section {
        flex-direction: column;
        gap: 15px;
    }
    
    #cefr-filter {
        flex: none;
        width: 100%;
    }
}

@media (max-width: 500px) {
    /* Remove side padding for better readability on small screens */
    .cefr-section {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
    
    .explanation-section {
        padding: 20px 10px;
    }
    
    .bck-characters-image {
        max-height: 150px;
    }
}
