/* Slack-style Media Gallery */
.sm-media-page.sm-slack-style-gallery {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(16, 24, 40, 0.08);
    min-height: auto;
}

/* Tab Header Styling (matching features template) */
.sm-tab-header-inside {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e8e8e8;
}

.sm-tab-header-inside h2 {
    font-size: 32px;
    font-weight: 700;
    color: #1d1c1d;
    margin: 0 0 10px 0;
    line-height: 1.3;
}

.sm-tab-description {
    font-size: 16px;
    color: #666;
    margin: 0;
    line-height: 1.6;
}

.sm-slack-media-container {
    display: grid;
    grid-template-columns: 1fr 450px;
    gap: 24px;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}

/* Main Preview Area (Left) */
.sm-main-preview-area {
    position: relative;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    overflow: hidden;
    height: auto;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sm-preview-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sm-preview-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sm-video-preview iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Make entire video preview feel clickable */
.sm-video-preview {
    cursor: pointer;
}

.sm-image-preview {
    padding: 20px;
    cursor: zoom-in;
}

.sm-image-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
}

/* Video Poster in Main Preview */
.sm-video-poster {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: #000;
}

.sm-video-poster img {
    width: 100%;
    height: 100%;
    object-fit: contain !important;
    object-position: center center;
}

.sm-poster-play-overlay {
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Navigation Arrows */
.sm-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(0,0,0,0.6);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 36px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sm-nav-arrow:hover {
    background: rgba(0,0,0,0.8);
    transform: translateY(-50%) scale(1.1);
}

.sm-nav-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.sm-nav-prev {
    left: 15px;
}

.sm-nav-next {
    right: 15px;
}

/* Thumbnail Sidebar (Right) */
.sm-thumbnail-sidebar {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    overflow-y: auto;
    height: 100%;
    max-height: none;
    padding: 15px;
    width: 100%;
    box-sizing: border-box;
}

.sm-thumbnail-sidebar .sm-thumbnail-list {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 1fr;
    gap: 14px;
    align-content: stretch;
    height: 100%;
}

.sm-thumbnail-item {
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.2s ease;
    background: #f8f8f8;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.sm-thumbnail-item:hover {
    border-color: #0084ff;
    transform: translateX(-2px);
}

.sm-thumbnail-item.active {
    border-color: #0084ff;
    background: #e8f4ff;
}

.sm-thumb-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 */
    overflow: hidden;
    background: #e0e0e0;
    flex: 1 1 auto;
}

.sm-thumb-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sm-thumb-video-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 36px;
    height: 36px;
    background: rgba(0,0,0,0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sm-thumb-label {
    padding: 8px 10px;
    font-size: 13px;
    font-weight: 500;
    color: #1d1c1d;
    background: #fff;
    min-height: 36px;
    display: flex;
    align-items: center;
}

/* YouTube Subscribe Section */
.sm-youtube-subscribe-section {
    margin-top: 30px;
    padding: 25px;
    background: linear-gradient(135deg, #f9f9f9 0%, #ffffff 100%);
    border-radius: 12px;
    text-align: center;
    border: 2px solid #e8e8e8;
    transition: all 0.3s ease;
}

.sm-youtube-subscribe-section:hover {
    border-color: #FF0000;
    box-shadow: 0 4px 15px rgba(255, 0, 0, 0.1);
}

.sm-youtube-subscribe-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #FF0000 0%, #CC0000 100%);
    color: white;
    padding: 14px 32px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 0, 0, 0.3);
    border: none;
    cursor: pointer;
}

.sm-youtube-subscribe-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 0, 0, 0.4);
    background: linear-gradient(135deg, #CC0000 0%, #990000 100%);
    color: white;
    text-decoration: none;
}

.sm-youtube-subscribe-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(255, 0, 0, 0.3);
}

.sm-youtube-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.sm-subscribe-note {
    margin-top: 12px;
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 0;
}

/* Empty state */
.sm-no-media {
    text-align: center;
    padding: 100px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.sm-no-media-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.sm-no-media h3 {
    font-size: 28px;
    color: #333;
    margin-bottom: 15px;
    font-weight: 600;
}

.sm-no-media p {
    font-size: 16px;
    color: #666;
}

/* Lightbox Modal */
.sm-lightbox-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
}

.sm-lightbox-modal.active {
    display: flex;
}

.sm-lightbox-content {
    position: relative;
    max-width: 95%;
    max-height: 95%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sm-lightbox-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
}

.sm-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    border-radius: 50%;
    color: white;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 100001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sm-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.sm-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    border-radius: 50%;
    color: white;
    font-size: 40px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 100001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sm-lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.3);
}

.sm-lightbox-nav.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.sm-lightbox-prev {
    left: 30px;
}

.sm-lightbox-next {
    right: 30px;
}

.sm-lightbox-counter {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 25px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    z-index: 100001;
}

/* Zoom Controls */
.sm-lightbox-zoom-controls {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 100001;
}

.sm-zoom-btn {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sm-zoom-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.sm-lightbox-image-wrapper {
    overflow: auto;
    max-width: 95vw;
    max-height: 95vh;
    display: block;
}

.sm-lightbox-image-wrapper img {
    transition: transform 0.3s ease;
    transform-origin: left top;
    display: block;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .sm-slack-media-container {
        grid-template-columns: 1fr;
    }
    
    .sm-thumbnail-sidebar {
        max-height: 400px;
    }
    
    .sm-thumbnail-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

@media (max-width: 768px) {
    .sm-media-page.sm-slack-style-gallery {
        padding: 15px;
    }
    
    .sm-tab-header-inside h2 {
        font-size: 22px;
    }
    
    .sm-tab-description {
        font-size: 14px;
    }
    
    .sm-main-preview-area {
        height: auto;
        aspect-ratio: 16 / 9;
    }
    
    .sm-nav-arrow {
        width: 40px;
        height: 40px;
        font-size: 28px;
    }
    
    .sm-thumbnail-sidebar {
        padding: 10px;
    }
    
    .sm-thumbnail-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .sm-youtube-subscribe-section {
        margin-top: 20px;
        padding: 20px 15px;
    }
    
    .sm-youtube-subscribe-btn {
        padding: 12px 24px;
        font-size: 15px;
        gap: 10px;
    }
    
    .sm-youtube-icon {
        width: 20px;
        height: 20px;
    }
    
    .sm-subscribe-note {
        font-size: 13px;
    }
    
    .sm-lightbox-close {
        width: 40px;
        height: 40px;
        font-size: 24px;
        top: 10px;
        right: 10px;
    }
    
    .sm-lightbox-nav {
        width: 45px;
        height: 45px;
        font-size: 30px;
    }
    
    .sm-lightbox-prev {
        left: 10px;
    }
    
    .sm-lightbox-next {
        right: 10px;
    }
    
    .sm-lightbox-counter {
        bottom: 20px;
        padding: 8px 20px;
        font-size: 14px;
    }
    
    .sm-lightbox-zoom-controls {
        bottom: 60px;
    }
    
    .sm-zoom-btn {
        width: 36px;
        height: 36px;
        font-size: 20px;
    }
}
