/**
 * YouTube Manager - Frontend Styles
 * Kompaktný moderný dizajn
 *
 * @package Srz_Rada
 */

/* Variables */
:root {
    --ytm-primary: #0693E3;
    --ytm-primary-dark: #0577b8;
    --ytm-youtube-red: #FF0000;
    --ytm-youtube-dark: #cc0000;
    --ytm-text: #1a1a1a;
    --ytm-text-muted: #666;
    --ytm-bg: #f5f5f5;
    --ytm-white: #ffffff;
    --ytm-radius: 8px;
    --ytm-shadow: 0 2px 8px rgba(0,0,0,0.1);
    --ytm-gap: 12px;
}

/* ========================================
   Hero Slider / Banner
   ======================================== */
.ytm-hero-slider {
    background: linear-gradient(135deg, var(--ytm-primary) 0%, #0577b8 50%, #034c7a 100%);
    padding: 4px 24px;
    position: relative;
    overflow: hidden;
}

.ytm-hero-slider::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
}

.ytm-hero-slider::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: rgba(255,0,0,0.1);
    border-radius: 50%;
}

.ytm-hero-slider-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 20px;
    align-items: start;
    position: relative;
    z-index: 1;
}

.ytm-hero-content {
    color: white;
}

.ytm-hero-header {
    display: flex;
    align-items: center;
    gap: 40px;
    margin-bottom: 0;
}

.ytm-hero-text {
    flex: 2;
    min-width: 600px;
    align-self: flex-start;
}

.ytm-hero-text .ytm-hero-subtitle {
    margin-bottom: 0;
}

.ytm-hero-logo {
    flex-shrink: 0;
    height: 120px;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.ytm-hero-logo img {
    width: 100%;
    height: auto;
}

.ytm-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--ytm-youtube-red);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
}

.ytm-hero-title {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 700;
    margin: 0 0 6px 0;
    line-height: 1.2;
}

.ytm-hero-subtitle {
    font-size: 1rem;
    opacity: 0.8;
    margin: 0 0 6px 0;
}

.ytm-hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--ytm-youtube-red);
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.3s ease;
    margin-top: 0;
}

.ytm-hero-btn svg {
    width: 20px;
    height: 20px;
}

.ytm-hero-btn:hover {
    background: var(--ytm-youtube-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255,0,0,0.3);
    color: white;
    text-decoration: none;
}

/* Hero Video Carousel */
.ytm-hero-video-carousel {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.ytm-hero-video-carousel .ytm-video-card {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
}

.ytm-hero-video-carousel .ytm-video-info {
    background: transparent;
    padding: 12px;
}

.ytm-hero-video-carousel .ytm-video-title {
    color: white;
    font-size: 13px;
    -webkit-line-clamp: 1;
}

.ytm-hero-video-carousel .ytm-video-meta {
    color: rgba(255,255,255,0.7);
    font-size: 11px;
}

.ytm-hero-video-carousel .ytm-video-description {
    display: none;
}

/* ========================================
   Main Content Layout
   ======================================== */
.ytm-main-content {
    background: var(--ytm-bg);
}

.ytm-two-columns {
    gap: 30px !important;
}

.ytm-section-header {
    margin-bottom: 16px;
}

.ytm-section-title {
    font-size: 18px !important;
    font-weight: 700 !important;
    color: var(--ytm-text) !important;
    margin: 0 !important;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--ytm-primary);
    display: inline-block;
}

/* ========================================
   Video Grid - Compact
   ======================================== */
.ytm-videos-grid {
    display: grid;
    gap: var(--ytm-gap);
}

.ytm-columns-1 { grid-template-columns: 1fr; }
.ytm-columns-2 { grid-template-columns: repeat(2, 1fr); }
.ytm-columns-3 { grid-template-columns: repeat(3, 1fr); }
.ytm-columns-4 { grid-template-columns: repeat(4, 1fr); }

/* Video Card - Compact */
.ytm-video-card {
    background: var(--ytm-white);
    border-radius: var(--ytm-radius);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: var(--ytm-shadow);
}

.ytm-video-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* Video Thumbnail */
.ytm-video-thumbnail {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #eee;
}

.ytm-video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.ytm-video-card:hover .ytm-video-thumbnail img {
    transform: scale(1.05);
}

/* Video Overlay */
.ytm-video-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0);
    transition: background 0.3s ease;
}

.ytm-video-card:hover .ytm-video-overlay {
    background: rgba(0,0,0,0.4);
}

/* Play Button */
.ytm-play-btn {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ytm-youtube-red);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
}

.ytm-play-btn svg {
    width: 22px;
    height: 22px;
    margin-left: 3px;
}

.ytm-video-card:hover .ytm-play-btn {
    opacity: 1;
    transform: scale(1);
}

.ytm-play-btn:hover {
    background: var(--ytm-youtube-dark);
    transform: scale(1.1);
}

/* Video Duration */
.ytm-video-duration {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: rgba(0,0,0,0.85);
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
}

/* Video Featured Badge */
.ytm-video-featured {
    position: absolute;
    top: 6px;
    left: 6px;
    background: var(--ytm-youtube-red);
    color: white;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

/* Video Info - Compact */
.ytm-video-info {
    padding: 10px 12px;
}

.ytm-video-title {
    margin: 0 0 6px 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--ytm-text);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ytm-video-card:hover .ytm-video-title {
    color: var(--ytm-primary);
}

/* Video Description */
.ytm-video-description {
    margin: 0 0 8px 0;
    font-size: 12px;
    color: var(--ytm-text-muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Video Meta */
.ytm-video-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 11px;
    color: var(--ytm-text-muted);
}

.ytm-video-views {
    display: flex;
    align-items: center;
    gap: 3px;
}

.ytm-video-views svg {
    width: 12px;
    height: 12px;
    opacity: 0.6;
}

/* ========================================
   Playlists Grid - Compact
   ======================================== */
.ytm-playlists-grid {
    display: grid;
    gap: var(--ytm-gap);
}

/* Playlist Card - Compact */
.ytm-playlist-card {
    display: flex;
    background: var(--ytm-white);
    border-radius: var(--ytm-radius);
    overflow: hidden;
    text-decoration: none;
    transition: all 0.25s ease;
    box-shadow: var(--ytm-shadow);
}

.ytm-sidebar-column .ytm-playlist-card {
    flex-direction: row;
}

.ytm-sidebar-column .ytm-playlist-thumbnail {
    width: 120px;
    flex-shrink: 0;
}

.ytm-playlist-card:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.12);
    text-decoration: none;
}

/* Playlist Thumbnail */
.ytm-playlist-thumbnail {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #eee;
}

.ytm-playlist-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.ytm-playlist-card:hover .ytm-playlist-thumbnail img {
    transform: scale(1.05);
}

.ytm-playlist-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
}

.ytm-playlist-video-count {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--ytm-primary);
    color: white;
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
}

/* Playlist Info - Compact */
.ytm-playlist-info {
    padding: 10px 12px;
    display: flex;
    align-items: center;
    flex: 1;
}

.ytm-playlist-info .ytm-playlist-title {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--ytm-text);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ytm-playlist-card:hover .ytm-playlist-title {
    color: var(--ytm-primary);
}

/* Active Playlist Card */
.ytm-playlist-card.ytm-playlist-active {
    border: 2px solid var(--ytm-primary);
    box-shadow: 0 4px 15px rgba(6, 147, 227, 0.25);
}

.ytm-playlist-card.ytm-playlist-active .ytm-playlist-title {
    color: var(--ytm-primary);
}

.ytm-playlist-active-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ytm-primary);
    color: white;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Playlist Filter Tag */
.ytm-playlist-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--ytm-primary);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-left: 10px;
    vertical-align: middle;
}

.ytm-filter-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: rgba(255,255,255,0.3);
    color: white;
    border-radius: 50%;
    text-decoration: none;
    font-size: 14px;
    line-height: 1;
    transition: background 0.2s ease;
}

.ytm-filter-remove:hover {
    background: rgba(255,255,255,0.5);
    color: white;
    text-decoration: none;
}

/* ========================================
   No Content Messages
   ======================================== */
.ytm-no-videos,
.ytm-no-playlists {
    text-align: center;
    padding: 40px 20px;
    background: var(--ytm-white);
    border-radius: var(--ytm-radius);
    color: var(--ytm-text-muted);
    font-size: 14px;
}

/* ========================================
   Modal
   ======================================== */
.ytm-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.ytm-modal[aria-hidden="false"] {
    opacity: 1;
    visibility: visible;
}

.ytm-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.9);
    cursor: pointer;
}

.ytm-modal-container {
    position: relative;
    width: 90%;
    max-width: 900px;
    z-index: 1;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.ytm-modal[aria-hidden="false"] .ytm-modal-container {
    transform: scale(1);
}

.ytm-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ytm-modal-close:hover {
    background: rgba(255,255,255,0.2);
    transform: rotate(90deg);
}

.ytm-modal-close svg {
    width: 20px;
    height: 20px;
}

.ytm-modal-content {
    background: #000;
    border-radius: var(--ytm-radius);
    overflow: hidden;
}

.ytm-video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
}

.ytm-video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 1024px) {
    .ytm-hero-slider-inner {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .ytm-hero-content {
        text-align: center;
    }

    .ytm-hero-header {
        justify-content: center;
    }

    .ytm-hero-logo img {
        width: 280px;
    }

    .ytm-hero-video-carousel {
        grid-template-columns: repeat(3, 1fr);
    }

    .ytm-two-columns {
        flex-direction: column !important;
    }

    .ytm-videos-column,
    .ytm-sidebar-column {
        flex-basis: 100% !important;
    }

    .ytm-sidebar-column .ytm-playlists-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
    }

    .ytm-sidebar-column .ytm-playlist-card {
        flex-direction: column;
    }

    .ytm-sidebar-column .ytm-playlist-thumbnail {
        width: 100%;
    }

    .ytm-columns-3 { grid-template-columns: repeat(3, 1fr); }
    .ytm-columns-4 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .ytm-hero-slider {
        padding: 30px 16px;
    }

    .ytm-hero-header {
        flex-direction: column;
        gap: 20px;
    }

    .ytm-hero-text {
        min-width: auto;
    }

    .ytm-hero-logo img {
        width: 220px;
    }

    .ytm-hero-video-carousel {
        grid-template-columns: repeat(2, 1fr);
    }

    .ytm-columns-3,
    .ytm-columns-4 { grid-template-columns: repeat(2, 1fr); }

    .ytm-sidebar-column .ytm-playlists-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .ytm-play-btn {
        width: 44px;
        height: 44px;
        opacity: 1;
        transform: scale(1);
    }

    .ytm-play-btn svg {
        width: 18px;
        height: 18px;
    }
}

@media (max-width: 480px) {
    .ytm-hero-video-carousel {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .ytm-columns-2,
    .ytm-columns-3,
    .ytm-columns-4 { grid-template-columns: repeat(2, 1fr); }

    .ytm-sidebar-column .ytm-playlists-grid {
        grid-template-columns: 1fr;
    }

    .ytm-sidebar-column .ytm-playlist-card {
        flex-direction: row;
    }

    .ytm-sidebar-column .ytm-playlist-thumbnail {
        width: 100px;
    }

    :root {
        --ytm-gap: 8px;
    }
}

/* ========================================
   Animation
   ======================================== */
@keyframes ytm-fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.ytm-video-card,
.ytm-playlist-card {
    animation: ytm-fade-in 0.4s ease forwards;
}

.ytm-video-card:nth-child(2),
.ytm-playlist-card:nth-child(2) { animation-delay: 0.05s; }
.ytm-video-card:nth-child(3),
.ytm-playlist-card:nth-child(3) { animation-delay: 0.1s; }
.ytm-video-card:nth-child(4),
.ytm-playlist-card:nth-child(4) { animation-delay: 0.15s; }
.ytm-video-card:nth-child(5),
.ytm-playlist-card:nth-child(5) { animation-delay: 0.2s; }
.ytm-video-card:nth-child(6),
.ytm-playlist-card:nth-child(6) { animation-delay: 0.25s; }
