/* Video Feed Styles (YouTube Like) */
.ssd-video-feed-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    padding: 10px;
}

.ssd-video-card {
    background: #1f2937;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.2s;
}
.ssd-video-card:hover { transform: translateY(-3px); }

.ssd-video-thumbnail {
    display: block;
    width: 100%;
    height: 150px;
    background-size: cover;
    background-position: center;
    position: relative;
}
.ssd-video-thumbnail .play-icon {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    color: rgba(255,255,255,0.8);
    background: rgba(0,0,0,0.5);
    border-radius: 50%;
    width: 50px; height: 50px;
    display: flex; align-items: center; justify-content: center;
}

.ssd-video-info { padding: 10px; position: relative; }
.ssd-video-title { margin: 0 0 5px 0; font-size: 0.95rem; line-height: 1.3; }
.ssd-video-title a { color: #e5e7eb; text-decoration: none; }
.ssd-video-date { font-size: 0.75rem; color: #9ca3af; }

/* Files Grid Styles */
.ssd-files-grid {
    display: grid;
    grid-template-columns: 1fr; /* Default mobile 1 column? Prompt said 2 horizontal */
    gap: 10px;
    padding: 10px;
}
/* Mobile Horizontal 2 Files View */
@media (max-width: 600px) {
    .ssd-files-grid {
        grid-template-columns: 1fr 1fr; /* 2 Columns on mobile */
    }
}

.ssd-file-card {
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.ssd-file-icon { font-size: 2rem; color: #ef4444; margin-bottom: 8px; }
.ssd-file-title { margin: 0 0 5px 0; font-size: 0.85rem; color: #e5e7eb; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.ssd-file-date { font-size: 0.7rem; color: #9ca3af; display: block; margin-bottom: 8px; }
.ssd-download-btn {
    background: #374151; color: #fff;
    padding: 5px 10px; border-radius: 4px;
    font-size: 0.75rem; text-decoration: none;
    display: block; width: 100%;
}
.ssd-download-btn:hover { background: #4b5563; }

/* Actions (Delete) */
.ssd-media-actions {
    position: absolute; right: 10px; bottom: 10px;
}
.ssd-delete-media-btn {
    background: #ef4444; color: white; border: none;
    padding: 5px; border-radius: 4px; cursor: pointer;
    font-size: 0.8rem;
}
.ssd-file-actions { display: flex; gap: 5px; width: 100%; }
.ssd-file-actions .ssd-delete-media-btn.small-del { width: 30px; }

/* Floating Action Button (FAB) */
.ssd-fab-container {
    position: fixed;
    bottom: 80px; /* Above mobile footer */
    right: 20px;
    z-index: 1000;
}
.ssd-fab-main {
    width: 56px; height: 56px;
    background-color: #3b82f6;
    color: white;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    cursor: pointer;
    transition: transform 0.2s;
}
.ssd-fab-main:active { transform: scale(0.95); }

.ssd-fab-options {
    position: absolute;
    bottom: 70px; right: 0;
    display: flex; flex-direction: column; gap: 10px;
    opacity: 0; visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s;
}
.ssd-fab-container.active .ssd-fab-options {
    opacity: 1; visibility: visible; transform: translateY(0);
}

.ssd-fab-option {
    display: flex; align-items: center; gap: 10px;
    background: white; color: #1f2937;
    padding: 8px 12px; border-radius: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    cursor: pointer;
    text-decoration: none; font-size: 0.9rem; font-weight: 600;
    white-space: nowrap;
    justify-content: flex-end;
}
.ssd-fab-option span { order: 1; }
.ssd-fab-option i { 
    order: 2; 
    background: #1f2937; color: white;
    width: 35px; height: 35px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
}

/* Ensure active tab is visible */
.page-tab-pane {
    display: none; /* Default hidden */
    animation: fadeIn 0.3s ease-in-out;
}
.page-tab-pane.active, 
.page-tab-pane[style*="display: block"] {
    display: block !important; /* Force show if active style is applied */
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Video Player Container (16:9 Aspect Ratio) */
.ssd-video-player-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Ratio */
    height: 0;
    overflow: hidden;
    background: #000;
    border-bottom: 1px solid #374151;
}

.ssd-video-player-wrapper iframe,
.ssd-video-player-wrapper .ssd-video-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Card Adjustments */
.ssd-video-card {
    background: #1f2937;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: transform 0.2s;
    display: flex;
    flex-direction: column;
}

.ssd-video-info {
    padding: 12px;
    position: relative;
    background: #1f2937;
}

.ssd-video-title {
    margin: 0 0 5px 0;
    font-size: 0.95rem;
    color: #f3f4f6;
    font-weight: 600;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Show max 2 lines */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ssd-video-date {
    font-size: 0.75rem;
    color: #9ca3af;
}

/* Fix Delete Button Positioning */
.ssd-media-actions {
    position: absolute;
    bottom: 12px;
    right: 12px;
}

/* Floating Action Button (FAB) Position */
.ssd-fab-container {
    position: fixed;
    bottom: 30px; /* Desktop: තිරයේ පහළ සිට 30px උඩින් */
    right: 20px;
    z-index: 1000;
    transition: bottom 0.3s ease; /* Smooth movement */
}

/* Mobile View Adjustment */
@media (max-width: 768px) {
    .ssd-fab-container {
        /* Mobile Footer එක 60px උස නිසා, ඊට මදක් ඉහළින් (70px) තබයි.
           ඔබට තව පහත් කිරීමට අවශ්‍ය නම් 65px වැනි අගයක් දෙන්න. */
        bottom: 20px; 
    }
}

/* Video Wrapper */
.ssd-video-player-wrapper {
    width: 100%;
    aspect-ratio: 16 / 9; /* Modern aspect ratio */
    background: #000;
    border-bottom: 1px solid #374151;
    position: relative;
}

.ssd-video-player-wrapper iframe {
    width: 100%;
    height: 100%;
}

/* Plyr Customizations (Optional - to match dark theme) */
.plyr {
    height: 100%;
    width: 100%;
    --plyr-color-main: #3b82f6; /* Blue accent */
}

/* Grid adjustments for smoothness */
.ssd-video-feed-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); /* Bigger cards */
    gap: 20px;
    padding: 10px 0;
}

.ssd-video-card {
    background: #1f2937;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* Video Grid */
.ssd-video-feed-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 10px 0;
}

/* Video Card */
.ssd-video-card {
    background: #1f2937;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    border: 1px solid #374151;
}

/* Player Wrapper (16:9 Ratio) */
.ssd-video-player-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    background: #000; /* Black background before load */
    overflow: hidden;
}

.ssd-video-player-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Video Info */
.ssd-video-info {
    padding: 12px;
    position: relative;
    background: #1f2937;
}

.ssd-video-title {
    margin: 0 0 5px 0;
    font-size: 0.95rem;
    color: #f3f4f6;
    font-weight: 600;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ssd-video-date {
    font-size: 0.75rem;
    color: #9ca3af;
}

/* Delete Button */
.ssd-media-actions {
    position: absolute;
    bottom: 12px;
    right: 12px;
}

/* Fallback Area */
.ssd-video-fallback {
    position: absolute; top:0; left:0; width:100%; height:100%;
}
.ssd-video-thumbnail {
    display: block; width: 100%; height: 100%;
    background-size: cover; background-position: center;
    position: relative;
}

/* Video Wrapper */
.ssd-video-player-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 Ratio */
    background: #000;
    overflow: hidden;
    border-bottom: 1px solid #374151;
}

.ssd-video-player-wrapper iframe,
.ssd-video-facade {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* --- Custom Facade (The Cover) --- */
.ssd-video-facade {
    background-size: cover;
    background-position: center;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s;
}

/* Hover Effect: Darken image slightly */
.ssd-video-facade::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.2);
    transition: background 0.3s;
}
.ssd-video-facade:hover::before {
    background: rgba(0, 0, 0, 0.4);
}

/* --- Mehewara Blue Play Button --- */
.ssd-custom-play-btn {
    position: relative;
    width: 60px;
    height: 60px;
    background-color: #3b82f6; /* Mehewara Blue */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.5); /* Glowing Effect */
    transition: transform 0.2s, background-color 0.2s;
    z-index: 2;
}

.ssd-custom-play-btn i {
    color: white;
    font-size: 24px;
    margin-left: 4px; /* Center icon visually */
}

/* Hover Animation for Button */
.ssd-video-facade:hover .ssd-custom-play-btn {
    transform: scale(1.1);
    background-color: #2563eb; /* Darker Blue */
}

/* Card Styles (Existing) */
.ssd-video-feed-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 10px 0;
}
.ssd-video-card {
    background: #1f2937;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    border: 1px solid #374151;
}
.ssd-video-info { padding: 12px; position: relative; background: #1f2937; }
.ssd-video-title { margin: 0 0 5px 0; font-size: 0.95rem; color: #f3f4f6; }
.ssd-video-date { font-size: 0.75rem; color: #9ca3af; }
.ssd-media-actions { position: absolute; bottom: 12px; right: 12px; }