/**
 * Dynamic Sections - Multi-Item with Horizontal Scroll + Arrow Navigation
 * Version 3.0
 * @created January 13, 2026
 */

/* BASE HORIZONTAL SCROLL */
.dynamic-section.horizontal-scroll {
    width: 100%;
    position: relative;
    padding: 20px 0;
}

.dynamic-section.horizontal-scroll .scroll-wrapper {
    position: relative;
}

.dynamic-section.horizontal-scroll .scroll-container {
    display: flex !important;
    gap: 20px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    padding: 10px 5px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.dynamic-section.horizontal-scroll .scroll-container::-webkit-scrollbar {
    display: none;
}

/* ARROW NAVIGATION FOR DESKTOP */
.scroll-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    z-index: 10;
    transition: all 0.3s;
}

.scroll-arrow:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: translateY(-50%) scale(1.1);
}

.scroll-arrow.left { left: 10px; }
.scroll-arrow.right { right: 10px; }

@media (min-width: 768px) {
    .dynamic-section.horizontal-scroll:hover .scroll-arrow {
        display: flex !important;
    }
}

/* VERTICAL STACK */
.dynamic-section.vertical-stack {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
}

/* VIDEO SECTION */
.video-section.horizontal-scroll .video-item {
    flex: 0 0 auto !important;
    width: 480px !important;
    max-width: 85vw;
}

.video-section.vertical-stack .video-item {
    width: 100%;
    margin-bottom: 30px;
}

.video-item {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.12);
    transition: all 0.3s;
}

.video-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.18);
}

.video-item iframe, .video-item video {
    width: 100%;
    height: 270px;
    display: block;
    border: none;
}

.video-info {
    padding: 16px;
}

.video-title {
    margin: 0 0 8px 0;
    font-size: 17px;
    font-weight: 600;
    color: #222;
}

.video-description {
    margin: 0;
    font-size: 14px;
    color: #666;
}

/* BANNER SECTION */
.banner-section.horizontal-scroll .banner-item {
    flex: 0 0 auto !important;
    width: 450px !important;
    max-width: 85vw;
}

.banner-section.vertical-stack .banner-item {
    width: 100%;
    margin-bottom: 20px;
}

.banner-item {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.12);
    transition: all 0.3s;
}

.banner-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.18);
}

.banner-item img {
    width: 100%;
    height: auto;
    display: block;
}

.banner-item a {
    display: block;
}

/* EXTERNAL LINK SECTION */
.external-link-section.horizontal-scroll .link-item {
    flex: 0 0 auto !important;
    width: 350px !important;
    max-width: 85vw;
}

.external-link-section.vertical-stack .link-item {
    width: 100%;
    margin-bottom: 20px;
}

.link-item {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.12);
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
}

.link-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.18);
}

/* IFRAME SECTION */
.iframe-section.horizontal-scroll .iframe-item {
    flex: 0 0 auto !important;
    min-width: 300px;
}

.iframe-section.vertical-stack .iframe-item-full {
    width: 100%;
    margin-bottom: 20px;
}

.iframe-item {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.12);
    transition: all 0.3s;
}

.iframe-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.18);
}

.iframe-item-full {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.12);
    margin-bottom: 20px;
}

.iframe-title {
    padding: 15px;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.iframe-item .embedded-iframe,
.iframe-item-full .embedded-iframe {
    display: block;
    border: none;
}

.link-image {
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: #f5f5f5;
}

.link-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.link-item:hover .link-image img {
    transform: scale(1.05);
}

.link-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.link-title {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
    color: #222;
    line-height: 1.3;
}

.link-description {
    margin: 0 0 15px 0;
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    flex: 1;
}

.link-button {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.3s;
    text-align: center;
    border: none;
    cursor: pointer;
}

.link-button.btn-primary { 
    background: #007bff; 
    color: white; 
}

.link-button.btn-primary:hover { 
    background: #0056b3; 
    transform: translateY(-2px);
}

.link-button.btn-secondary { 
    background: #6c757d; 
    color: white; 
}

.link-button.btn-secondary:hover { 
    background: #545b62; 
}

.link-button.btn-success { 
    background: #28a745; 
    color: white; 
}

.link-button.btn-success:hover { 
    background: #1e7e34; 
}

.link-button.btn-danger { 
    background: #dc3545; 
    color: white; 
}

.link-button.btn-danger:hover { 
    background: #bd2130; 
}

.link-button i {
    font-size: 12px;
    margin-left: 5px;
}

/* POPUP SECTION */
.popup-section.horizontal-scroll .popup-item {
    flex: 0 0 auto !important;
    width: 450px !important;
    max-width: 85vw;
}

.popup-section.vertical-stack .popup-item {
    width: 100%;
    margin-bottom: 20px;
}

.popup-item {
    padding: 0;
}

.popup-card {
    display: flex;
    flex-direction: row;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 3px 12px rgba(0,0,0,0.12);
    transition: all 0.3s;
    cursor: pointer;
    height: 120px;
}

.popup-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 24px rgba(0,0,0,0.18);
}

.popup-card:active {
    transform: translateY(-2px);
}

.popup-card-image {
    flex: 0 0 120px;
    width: 120px;
    height: 120px;
    overflow: hidden;
    background: #f5f5f5;
}

.popup-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.popup-card:hover .popup-card-image img {
    transform: scale(1.05);
}

.popup-card-content {
    flex: 1;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

.popup-card-title {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: #222;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.popup-card-description {
    margin: 0;
    font-size: 13px;
    color: #666;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Popup modal title */
.popup-title {
    margin: 0 0 20px 0;
    font-size: 24px;
    font-weight: 600;
    color: #222;
    padding-right: 30px;
}

/* Old button style for backward compatibility */
.popup-item .popup-trigger {
    width: 100%;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.popup-item .popup-trigger.btn-primary {
    background: #007bff;
    color: white;
}

.popup-item .popup-trigger.btn-primary:hover {
    background: #0056b3;
    transform: translateY(-2px);
}

.popup-item .popup-trigger.btn-secondary {
    background: #6c757d;
    color: white;
}

.popup-item .popup-trigger.btn-secondary:hover {
    background: #545b62;
}

.popup-item .popup-trigger.btn-success {
    background: #28a745;
    color: white;
}

.popup-item .popup-trigger.btn-success:hover {
    background: #1e7e34;
}

.popup-item .popup-trigger.btn-danger {
    background: #dc3545;
    color: white;
}

.popup-item .popup-trigger.btn-danger:hover {
    background: #c82333;
}

/* TESTIMONIAL SECTION */
.testimonial-section.horizontal-scroll .testimonial-item {
    flex: 0 0 auto !important;
    width: 380px !important;
    max-width: 85vw;
}

.testimonial-section.vertical-stack .testimonial-item {
    width: 100%;
    margin-bottom: 20px;
}

.testimonial-item {
    background: white;
    border-radius: 10px;
    padding: 24px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.12);
}

.testimonial-content {
    font-size: 15px;
    line-height: 1.6;
    color: #444;
    margin-bottom: 16px;
    font-style: italic;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 12px;
}

.testimonial-name {
    font-weight: 600;
    color: #222;
}

.testimonial-location {
    font-size: 13px;
    color: #666;
}

.testimonial-rating {
    color: #ffc107;
    font-size: 16px;
}

/* MOBILE RESPONSIVE */
@media (max-width: 767px) {
    .video-item iframe, .video-item video { height: 200px; }
    .video-info { padding: 12px; }
    .video-title { font-size: 15px; }
    .video-description { font-size: 13px; }
    
    .link-image { height: 150px; }
    .link-content { padding: 15px; }
    .link-title { font-size: 16px; }
    .link-description { font-size: 13px; }
    
    .banner-section.horizontal-scroll .banner-item,
    .video-section.horizontal-scroll .video-item,
    .external-link-section.horizontal-scroll .link-item,
    .testimonial-section.horizontal-scroll .testimonial-item,
    .iframe-section.horizontal-scroll .iframe-item,
    .custom-html-section.horizontal-scroll .custom-html-item {
        width: 300px !important;
        max-width: 82vw;
    }
}

@media (min-width: 1025px) {
    .video-section.horizontal-scroll .video-item { width: 500px !important; }
    .banner-section.horizontal-scroll .banner-item { width: 480px !important; }
    .external-link-section.horizontal-scroll .link-item { width: 380px !important; }
    .iframe-section.horizontal-scroll .iframe-item { min-width: 350px; }
    .custom-html-section.horizontal-scroll .custom-html-item { width: 450px !important; }
}

/* ============================================
   CUSTOM HTML SECTION - MULTI-ITEM STYLES
   ============================================ */

/* Custom HTML Item - Generic Container */
.custom-html-item {
    flex-shrink: 0;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

/* Horizontal Scroll Layout */
.custom-html-section.horizontal-scroll .custom-html-item {
    width: 450px;
    max-width: 90vw;
}

/* Vertical Stack Layout */
.custom-html-section.vertical-stack {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px 0;
}

.custom-html-section.vertical-stack .custom-html-item {
    width: 100%;
}

/* Reset common styles to allow full customization */
.custom-html-item * {
    box-sizing: border-box;
