/*
 * Custom YouTube Playlist Showcase - Premium Styles
 */

/* ==========================================================================
   Base Wrapper
   ========================================================================== */
.yt-playlist-wrapper {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    margin: 2rem 0;
    --card-bg: #ffffff;
    --card-shadow: 0 10px 20px rgba(0,0,0,0.05);
    --card-shadow-hover: 0 15px 30px rgba(0,0,0,0.12);
    --card-radius: 16px;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --accent-color: #ff0000;
    --transition-speed: 0.3s;
}

/* Dark mode fallback if theme is dark */
@media (prefers-color-scheme: dark) {
    .yt-playlist-wrapper {
        --card-bg: #1e1e1e;
        --card-shadow: 0 10px 20px rgba(0,0,0,0.2);
        --card-shadow-hover: 0 15px 30px rgba(0,0,0,0.4);
        --text-primary: #f8fafc;
        --text-secondary: #cbd5e1;
    }
}

/* ==========================================================================
   Common Video Item Styles
   ========================================================================== */
.yt-video-item {
    display: flex;
    background: var(--card-bg);
    border-radius: var(--card-radius);
    overflow: hidden;
    text-decoration: none;
    box-shadow: var(--card-shadow);
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
    border: 1px solid rgba(0,0,0,0.03);
}

.yt-video-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--card-shadow-hover);
}

.yt-video-thumbnail {
    position: relative;
    overflow: hidden;
    background: #000;
}

.yt-video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    display: block;
    border-radius: 0;
}

.yt-video-item:hover .yt-video-thumbnail img {
    transform: scale(1.05);
}

/* Custom Play Button Overlay */
.yt-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    opacity: 0.9;
    transition: opacity var(--transition-speed) ease, transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3));
}

.yt-video-item:hover .yt-play-icon {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
}

.yt-video-info {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.yt-video-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color var(--transition-speed);
}

.yt-video-item:hover .yt-video-title {
    color: var(--accent-color);
}

/* ==========================================================================
   Grid (Cards) Style
   ========================================================================== */
.yt-style-grid .yt-playlist-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.yt-style-grid .yt-video-item {
    flex-direction: column;
}

.yt-style-grid .yt-video-thumbnail {
    aspect-ratio: 16 / 9;
    width: 100%;
}

/* ==========================================================================
   List Style
   ========================================================================== */
.yt-style-list .yt-playlist-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.yt-style-list .yt-video-item {
    flex-direction: row;
    align-items: stretch;
}

.yt-style-list .yt-video-thumbnail {
    width: 280px;
    min-width: 280px;
    aspect-ratio: 16 / 9;
}

.yt-style-list .yt-video-info {
    padding: 1.5rem 2rem;
}

.yt-style-list .yt-video-title {
    font-size: 1.25rem;
}

@media (max-width: 640px) {
    .yt-style-list .yt-video-item {
        flex-direction: column;
    }
    
    .yt-style-list .yt-video-thumbnail {
        width: 100%;
        min-width: 100%;
    }
    
    .yt-style-list .yt-video-info {
        padding: 1.25rem;
    }
}

/* ==========================================================================
   Pagination
   ========================================================================== */
.yt-pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2.5rem;
}

.yt-page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: all var(--transition-speed) ease;
    border: 1px solid rgba(0,0,0,0.05);
}

.yt-page-link:hover {
    background: #f1f5f9;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.yt-page-active,
.yt-page-active:hover {
    background: var(--accent-color);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 0, 0, 0.3);
    border-color: var(--accent-color);
}

/* ==========================================================================
   Frontend Submission Form
   ========================================================================== */
.yt-submission-form-container {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    margin: 2rem 0;
    max-width: 600px;
}

.yt-submission-form .yt-form-group {
    margin-bottom: 1.5rem;
}

.yt-submission-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.yt-submission-form select,
.yt-submission-form input[type="url"],
.yt-submission-form input[type="password"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    background: #f8fafc;
    color: var(--text-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.yt-submission-form select:focus,
.yt-submission-form input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(255, 0, 0, 0.1);
}

.yt-submit-btn {
    background: var(--accent-color);
    color: #ffffff;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    width: 100%;
}

.yt-submit-btn:hover {
    background: #cc0000;
    transform: translateY(-2px);
}

.yt-notice {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.yt-notice-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.yt-notice-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}
