/* YouTube Integration Plugin - Frontend Styles */

/* ===== PLACEHOLDER STYLES ===== */
.sokka-loading-placeholder,
.sokka-error-placeholder,
.sokka-no-content-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    min-height: 200px;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 20px 0;
}

.sokka-placeholder-shimmer {
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
    border-radius: 2px;
    margin-bottom: 20px;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.sokka-placeholder-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.sokka-placeholder-icon,
.sokka-error-icon,
.sokka-no-content-icon {
    font-size: 48px;
    color: #6c757d;
    margin-bottom: 10px;
}

.sokka-placeholder-icon svg {
    width: 48px;
    height: 48px;
    color: #6c757d;
}

.sokka-placeholder-text,
.sokka-error-text,
.sokka-no-content-text {
    font-size: 18px;
    font-weight: 600;
    color: #495057;
    margin: 0;
}

.sokka-placeholder-subtext,
.sokka-error-subtext,
.sokka-no-content-subtext {
    font-size: 14px;
    color: #6c757d;
    margin: 0;
}

.sokka-error-placeholder {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
}

.sokka-error-text {
    color: #721c24;
}

.sokka-error-subtext {
    color: #856404;
}

.sokka-no-content-placeholder {
    background: #e2e3e5;
    border: 1px solid #d6d8db;
}

.sokka-no-content-text {
    color: #495057;
}

.sokka-no-content-subtext {
    color: #6c757d;
}

/* ===== CAROUSEL STYLES ===== */
.sokka-youtube-carousel {
    position: relative;
    margin: 20px 0;
    overflow: hidden;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Carousel Header */
.sokka-carousel-header {
    background: linear-gradient(135deg, #ff0000 0%, #cc0000 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.sokka-carousel-header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.sokka-refresh-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.sokka-refresh-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.sokka-refresh-btn:active {
    transform: translateY(0);
}

.sokka-carousel-container {
    position: relative;
    min-height: 300px;
    padding: 20px;
}

.sokka-carousel-slides {
    position: relative;
    height: 100%;
}

.sokka-carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sokka-carousel-slide.active {
    opacity: 1;
}

.sokka-carousel-items {
    display: flex;
    gap: 20px;
    height: 100%;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    width: 100%;
}

.sokka-carousel-item {
    position: relative;
    overflow: hidden;
    display: block;
    flex-shrink: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.sokka-carousel-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.sokka-carousel-thumbnail {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    cursor: pointer;
}

.sokka-carousel-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.sokka-carousel-item:hover .sokka-carousel-thumbnail img {
    transform: scale(1.05);
}

.sokka-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 0, 0, 0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.9;
    z-index: 10;
    transition: opacity 0.3s ease;
}

.sokka-carousel-item:hover .sokka-play-overlay {
    opacity: 1;
}

.sokka-play-overlay svg {
    width: 24px;
    height: 24px;
    margin-left: 3px;
    fill: white;
}

.sokka-carousel-item-info {
    padding: 15px;
}

.sokka-carousel-item-title {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
    color: #333;
}

.sokka-carousel-item-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.sokka-carousel-item-title a:hover {
    color: #ff0000;
}

/* Carousel Navigation */
.sokka-carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 115, 170, 0.9);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s ease;
    z-index: 10;
}

.sokka-carousel-arrow:hover {
    background: rgba(0, 115, 170, 1);
    transform: translateY(-50%) scale(1.1);
}

.sokka-carousel-prev {
    left: 15px;
}

.sokka-carousel-next {
    right: 15px;
}

.sokka-carousel-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.sokka-carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
}

.sokka-carousel-dot.active {
    background: #ff0000;
    transform: scale(1.2);
}

/* ===== GRID STYLES ===== */
.sokka-youtube-grid {
    margin: 20px 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.sokka-grid-container {
    min-height: 200px;
    padding: 20px;
}

.sokka-grid-content {
    display: grid;
    gap: 20px;
}

.sokka-grid-content[data-columns="2"] {
    grid-template-columns: repeat(2, 1fr);
}

.sokka-grid-content[data-columns="3"] {
    grid-template-columns: repeat(3, 1fr);
}

.sokka-grid-content[data-columns="4"] {
    grid-template-columns: repeat(4, 1fr);
}

.sokka-grid-content[data-columns="5"] {
    grid-template-columns: repeat(5, 1fr);
}

.sokka-grid-content[data-columns="6"] {
    grid-template-columns: repeat(6, 1fr);
}

.sokka-grid-item {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.sokka-grid-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.sokka-grid-thumbnail {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
}

.sokka-grid-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.sokka-grid-item:hover .sokka-grid-thumbnail img {
    transform: scale(1.05);
}

.sokka-short-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ff0000;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
}

.sokka-grid-info {
    padding: 15px;
}

.sokka-grid-title {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    color: #333;
}

.sokka-grid-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.sokka-grid-title a:hover {
    color: #ff0000;
}

.sokka-grid-channel {
    margin: 0 0 5px 0;
    color: #666;
    font-size: 12px;
    font-weight: 500;
}

.sokka-grid-date {
    margin: 0;
    color: #999;
    font-size: 10px;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1024px) {
    .sokka-grid-content[data-columns="4"],
    .sokka-grid-content[data-columns="5"],
    .sokka-grid-content[data-columns="6"] {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .sokka-carousel-items {
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .sokka-carousel-header {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .sokka-carousel-header h3 {
        font-size: 20px;
    }
    
    .sokka-grid-content[data-columns="3"],
    .sokka-grid-content[data-columns="4"],
    .sokka-grid-content[data-columns="5"],
    .sokka-grid-content[data-columns="6"] {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .sokka-carousel-items {
        gap: 10px;
    }
    
    .sokka-carousel-arrow {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .sokka-grid-content {
        grid-template-columns: 1fr !important;
    }
    
    .sokka-carousel-items {
        gap: 8px;
    }
    
    .sokka-carousel-arrow {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }
    
    .sokka-loading-placeholder,
    .sokka-error-placeholder,
    .sokka-no-content-placeholder {
        padding: 20px 15px;
        min-height: 150px;
    }
    
    .sokka-placeholder-text,
    .sokka-error-text,
    .sokka-no-content-text {
        font-size: 16px;
    }
    
    .sokka-placeholder-subtext,
    .sokka-error-subtext,
    .sokka-no-content-subtext {
        font-size: 12px;
    }
}
