.carousel-section {
    margin: 0 auto;
    font-family: Arial, sans-serif;
}
/* Slideshow and Thumbnails Container */
.slideshow-thumbnails-container {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    /* Remove align-items: stretch to prevent stretching */
}

.carousel-main {
    flex: 1;
    background: #f5f5f5;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.slideshow-container {
    position: relative;
    width: 100%;
    /* A4 ratio: height = width * 1.414 - This is fixed and won't stretch */
    aspect-ratio: 1 / 1.414;
    height: auto;
    overflow: hidden;
}

.slide-item {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.slide-item.active {
    opacity: 1;
}

.slide-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Caption Container - Separate from slideshow */
.caption-container {
    position: relative;
    width: 100%;
    min-height: 50px;
    background: #2c3e50;
    display: flex;
    align-items: center;
    justify-content: center;
}

.caption {
    display: none;
    color: white;
    padding: 15px 20px;
    text-align: center;
    font-size: 16px;
    width: 100%;
    line-height: 1.4;
}

.caption.active {
    display: block;
}

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    padding: 15px 20px;
    font-size: 24px;
    cursor: pointer;
    border-radius: 5px;
    transition: background 0.3s;
    z-index: 10;
}

.nav-btn:hover {
    background: rgba(0,0,0,0.8);
}

.prev-btn {
    left: 15px;
}

.next-btn {
    right: 15px;
}

.play-pause-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    padding: 10px;
    font-size: 20px;
    cursor: pointer;
    border-radius: 5px;
    transition: background 0.3s;
    z-index: 10;
}

.play-pause-btn:hover {
    background: rgba(0,0,0,0.8);
}

/* Thumbnail Navigation - Right Side with Fixed Height Based on Slideshow */
.thumbnail-container {
    width: 150px;
    flex-shrink: 0;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 10px;
    overflow-y: scroll !important; /* Force scrollbar to always show */
    overflow-x: hidden;
    
    /* Calculate height based on slideshow A4 ratio */
    /* Use calc to match the slideshow height approximately */
    height: calc((100vw - 320px) * 1.414 * 0.6); /* Approximate calculation */
    max-height: 600px; /* Maximum height to prevent too tall containers */
    min-height: 300px; /* Minimum height to ensure usability */
    
    /* Force scrollbar visibility in all browsers */
    scrollbar-width: thick;
    scrollbar-color: #9c2034 #e9ecef;
    -ms-overflow-style: scrollbar; /* For IE */
}

.thumbnail-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-right: 8px; /* Space for scrollbar */
    /* Remove min-height that was forcing stretch */
}

.thumbnail {
    cursor: pointer;
    border: 3px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    /* Square thumbnails */
    width: 100%;
    aspect-ratio: 1;
    flex-shrink: 0;
}

.thumbnail:hover {
    border-color: #9c2034;
    transform: scale(1.05);
}

.thumbnail.active {
    border-color: #9c2034;
    box-shadow: 0 0 10px rgba(0,123,255,0.5);
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.thumbnail-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 5px;
    font-size: 10px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Enhanced Webkit Scrollbar - Always Visible */
.thumbnail-container::-webkit-scrollbar {
    width: 16px !important; /* Wider scrollbar */
    display: block !important;
}

.thumbnail-container::-webkit-scrollbar-track {
    background: #dee2e6 !important;
    border-radius: 8px !important;
    border: 1px solid #ced4da !important;
    box-shadow: inset 0 0 2px rgba(0,0,0,0.1) !important;
}

.thumbnail-container::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #007bff 0%, #0056b3 100%) !important;
    border-radius: 8px !important;
    border: 2px solid #dee2e6 !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2) !important;
}

.thumbnail-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #0056b3 0%, #004085 100%) !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3) !important;
}

.thumbnail-container::-webkit-scrollbar-thumb:active {
    background: linear-gradient(180deg, #004085 0%, #002752 100%) !important;
}

.thumbnail-container::-webkit-scrollbar-corner {
    background: #dee2e6 !important;
}


/* Firefox Scrollbar - Enhanced */
.thumbnail-container {
    scrollbar-width: auto !important;
    scrollbar-color: #9c2034 #dee2e6 !important;
}

/* News Section Styles */
.news-section {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.news-header {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #9c2034;
}

.news-header h2 {
    margin: 0;
    color: #333;
    font-size: 24px;
    font-weight: 600;
}

.news-list {
    margin-bottom: 0;
}

.news-item {
    display: flex;
    align-items: flex-start;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
    transition: background 0.3s;
    cursor: pointer;
    gap: 15px;
}

.news-item:hover {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin: 0 -15px;
}

.news-item:last-child {
    border-bottom: none;
}

.news-announcement-date {
    flex-shrink: 0;
    text-align: center;
    background: #9c2034;
    color: white;
    padding: 10px;
    border-radius: 8px;
    min-width: 100px;
    box-shadow: 0 2px 5px rgba(0,123,255,0.3);
}

.announcement-date-label {
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 5px;
    opacity: 0.9;
}

.announcement-date-value {
    font-size: 13px;
    font-weight: bold;
    white-space: nowrap;
}

.news-content {
    flex: 1;
    min-width: 0;
}

.news-title {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
}

.news-excerpt {
    margin: 0 0 10px 0;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

.news-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
}

.news-date {
    color: #999;
}

.news-read-more {
    color: #9c2034;
    font-weight: 500;
}

.no-news {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.no-news p {
    margin: 0;
    font-size: 16px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s;
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 0;
    border-radius: 10px;
    width: 90%;
    max-width: 900px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    animation: slideIn 0.3s;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    border-radius: 10px 10px 0 0;
}

.modal-header h2 {
    margin: 0;
    color: #333;
    font-size: 22px;
    font-weight: 600;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
}

.modal-dates {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #9c2034;
}

.modal-date-item {
    margin-bottom: 8px;
    font-size: 14px;
    color: #333;
}

.modal-date-item:last-child {
    margin-bottom: 0;
}

.modal-date-item strong {
    color: #9c2034;
    font-weight: 600;
    display: inline-block;
    width: 130px;
}

.modal-content-section {
    font-size: 16px;
}

.modal-content-section strong {
    color: #9c2034;
    font-weight: 600;
    display: block;
    margin-bottom: 10px;
    font-size: 16px;
}


.modal-text {
    color: #333;
    font-size: 15px;
    line-height: 1.6;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #90545e;
    /* Ensure normal white-space handling */
    white-space: normal;
}

/* Add specific styling for HTML content in modal */
#modalContent {
    white-space: normal;
}

#modalContent p {
    margin-bottom: 1em;
    text-indent: 0;
}

#modalContent p:last-child {
    margin-bottom: 0;
}

#modalContent p:empty {
    display: none;
}

/* Modal animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
/* Better approach - Use JavaScript to set exact height */
@media (min-width: 769px) {
    .thumbnail-container {
        /* This will be set by JavaScript to match slideshow height exactly */
        height: var(--slideshow-height, 400px);
    }
}
/* Responsive Design */
@media (max-width: 768px) {
    .carousel-section {
        max-width: 100%;
        padding: 10px;
    }
    
    .slideshow-thumbnails-container {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    
    .slideshow-container {
        /* Maintain A4 ratio on mobile */
        aspect-ratio: 1 / 1.414;
    }
    
    .thumbnail-container {
        width: 100%;
        height: 120px !important; /* Fixed height for mobile horizontal scroll */
        min-height: 120px;
        max-height: 120px;
        overflow-y: hidden !important;
        overflow-x: scroll !important;
        padding: 10px;
        border: 2px solid #e9ecef;
    }
    
    
    .thumbnail-wrapper {
        flex-direction: row;
        min-width: max-content;
        min-height: auto;
        gap: 10px;
        padding-right: 0;
        padding-bottom: 8px; /* Space for horizontal scrollbar */
        height: 100%; /* Full height of container */
    }
    
    .thumbnail {
        width: 80px;
        height: 80px;
        flex-shrink: 0;
    }
    
     /* Mobile horizontal scrollbar styling */
     .thumbnail-container::-webkit-scrollbar {
        height: 12px !important;
        width: auto !important;
    }
    
    .thumbnail-container::-webkit-scrollbar-track {
        background: #dee2e6 !important;
        border-radius: 6px !important;
        border: 1px solid #ced4da !important;
    }
    
    .thumbnail-container::-webkit-scrollbar-thumb {
        background: linear-gradient(90deg, #007bff 0%, #0056b3 100%) !important;
        border-radius: 6px !important;
        border: 1px solid #dee2e6 !important;
    }
    
    .nav-btn {
        padding: 10px 15px;
        font-size: 18px;
    }
    
    .caption {
        font-size: 14px;
        padding: 10px;
    }
    
    .news-section {
        padding: 15px;
    }
    
    .news-header h2 {
        font-size: 20px;
    }
    
    .news-item {
        flex-direction: column;
        align-items: stretch;
        padding: 12px 0;
        gap: 10px;
    }
    
    .news-announcement-date {
        align-self: flex-start;
        min-width: 80px;
    }
    
    .announcement-date-label {
        font-size: 10px;
    }
    
    .announcement-date-value {
        font-size: 12px;
    }
    
    .news-title {
        font-size: 16px;
    }
    
    .news-excerpt {
        font-size: 13px;
    }
    
    .news-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
        max-height: 85vh;
    }
    
    .modal-header {
        padding: 15px;
    }
    
    .modal-header h2 {
        font-size: 18px;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .modal-dates {
        padding: 12px;
    }
    
    .modal-date-item {
        font-size: 13px;
    }
    
    .modal-date-item strong {
        width: 100px;
        font-size: 13px;
    }
    
    .modal-content-section strong {
        font-size: 14px;
    }
    
    .modal-text {
        font-size: 14px;
        padding: 12px;
    }
}