/**
 * Videolar Frontend CSS
 */

/* Videolar Container */
.videolar-container {
    margin: 0;
    padding: 10px;
}

/* Filter Bar */
.videolar-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    align-items: flex-start;
}

.videolar-search-box {
    flex: 1;
    min-width: 240px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff !important;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 0 14px;
    height: 46px;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
    color-scheme: light;
}

.videolar-search-box:focus-within {
    border-color: #153d25;
}

.videolar-search-box svg {
    flex-shrink: 0;
    color: #888;
}

.videolar-search-input {
    flex: 1;
    width: 100%;
    border: none;
    outline: none;
    font-family: inherit !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    line-height: 1.4 !important;
    height: 100%;
    background: #fff !important;
    color: #333 !important;
    padding: 0;
    color-scheme: light;
    -webkit-text-fill-color: #333;
}

.videolar-search-input::placeholder {
    color: #888 !important;
    opacity: 1;
    -webkit-text-fill-color: #888;
}

.videolar-filter-dropdown {
    position: relative;
}

.videolar-filter-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 46px;
    padding: 0 18px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    color: #333;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.videolar-filter-toggle:hover,
.videolar-filter-toggle.open,
.videolar-filter-toggle.active {
    border-color: #153d25;
    color: #153d25;
}

.videolar-filter-toggle .videolar-chevron {
    transition: transform 0.2s ease;
}

.videolar-filter-toggle.open .videolar-chevron {
    transform: rotate(180deg);
}

.videolar-filter-count {
    background: #153d25;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    border-radius: 10px;
    padding: 3px 7px;
}

.videolar-filter-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    box-shadow: none;
    padding: 18px;
    min-width: 280px;
    z-index: 50;
}

.videolar-filter-panel[hidden] {
    display: none;
}

.videolar-filter-group {
    margin-bottom: 14px;
}

.videolar-filter-group:last-of-type {
    margin-bottom: 0;
}

.videolar-filter-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}

.videolar-filter-select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: inherit !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    line-height: 1.4 !important;
    background: #fff;
    box-sizing: border-box;
}

.videolar-filter-select:focus {
    outline: none;
    border-color: #153d25;
}

/* Kategoriler - kapalı çoklu seçim dropdown */
.videolar-msdropdown {
    position: relative;
}

.videolar-msdropdown-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
    background-color: #fff;
    cursor: pointer;
    box-sizing: border-box;
    text-align: left;
    color: #333;
}

.videolar-msdropdown-trigger:hover,
.videolar-msdropdown-trigger.open {
    border-color: #153d25;
}

.videolar-msdropdown-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.videolar-chevron-sm {
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.videolar-msdropdown-trigger.open .videolar-chevron-sm {
    transform: rotate(180deg);
}

.videolar-msdropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    padding: 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 60;
}

.videolar-msdropdown-menu[hidden] {
    display: none;
}

.videolar-msdropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
    color: #333;
    user-select: none;
}

.videolar-msdropdown-item:hover {
    background: #f5f5f5;
}

.videolar-msdropdown-item input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin: 0;
    border: 1.5px solid #ccc;
    border-radius: 4px;
    background-color: #fff;
    cursor: pointer;
    position: relative;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.videolar-msdropdown-item input[type="checkbox"]:hover {
    border-color: #153d25;
}

.videolar-msdropdown-item input[type="checkbox"]:checked {
    background-color: #153d25;
    border-color: #153d25;
}

.videolar-msdropdown-item input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.videolar-msdropdown-item span {
    padding-left: 5px;
}

.videolar-filter-select option {
    font-family: inherit !important;
    font-size: 14px !important;
    font-weight: 400 !important;
}

.videolar-filter-panel-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #eee;
}

.videolar-clear-filters {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 6px;
    color: #555;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    transition: all 0.2s;
}

.videolar-clear-filters:hover {
    background: #fdf0f0;
    border-color: #d9534f;
    color: #d9534f;
}

.videolar-no-results {
    text-align: center;
    padding: 60px 20px;
    background: #ffffff;
    border: 2px dashed #e5e7eb;
    border-radius: 12px;
    display: none;
}

.videolar-no-results svg {
    color: #9ca3af;
    margin-bottom: 16px;
}

.videolar-no-results p {
    color: #6b7280;
    font-size: 16px;
    margin: 0;
}

/* Pagination */
.videolar-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 30px 0 20px;
    flex-wrap: wrap;
}

.videolar-pagination a,
.videolar-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    color: #153d25;
    text-decoration: none;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    background: #fff;
    gap: 6px;
}

.videolar-pagination a:hover {
    background: #153d25;
    color: #fff;
    border-color: #153d25;
    transform: translateY(-2px);
}

.videolar-pagination span.current {
    background: #153d25;
    color: #fff;
    border-color: #153d25;
    font-weight: 600;
}

.videolar-pagination span.dots {
    border: none;
    background: none;
    color: #999;
}

.videolar-pagination a svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.videolar-pagination .prev,
.videolar-pagination .next {
    font-weight: 600;
}

/* Videolar Grid */
.videolar-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 20px;
    margin: 20px 0;
}

@media (min-width: 768px) {
    .videolar-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .videolar-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.videolar-grid.videolar-cols-1 {
    grid-template-columns: 1fr !important;
}

.videolar-grid.videolar-cols-2 {
    grid-template-columns: repeat(2, 1fr) !important;
}

.videolar-grid.videolar-cols-3 {
    grid-template-columns: repeat(3, 1fr) !important;
}

.videolar-grid.videolar-cols-4 {
    grid-template-columns: repeat(4, 1fr) !important;
}

/* Video Item */
.video-item {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.video-item:hover {
    transform: translateY(-5px);
}

.video-item.hidden {
    display: none;
}

/* Thumbnail */
.videolar-thumbnail {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    overflow: hidden;
    cursor: pointer;
    background: #000;
}

.videolar-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.videolar-thumbnail:hover img {
    transform: scale(1.05);
}

/* Play Button */
.videolar-play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 68px;
    height: 48px;
    opacity: 0.9;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.videolar-thumbnail:hover .videolar-play-button {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
}

/* Content */
.videolar-content {
    padding: 20px;
}

/* Category Badge */
.video-kategori-badge {
    display: inline-block;
    background: #153d25;
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.videolar-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    color: #333;
    cursor: pointer;
    transition: color 0.3s ease;
}

.videolar-title:hover {
    color: #153d25;
}

/* Modal (Popup) */
.videolar-modal {
    display: none;
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.9);
    animation: fadeIn 0.3s ease;
}

.videolar-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Modal Content */
.videolar-modal-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    background-color: #000;
    border-radius: 8px;
    overflow: hidden;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Video Wrapper */
.videolar-video-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
}

.videolar-video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Close Button — lightbox sağ üst */
.videolar-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 32px;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.videolar-modal-close:hover,
.videolar-modal-close:focus {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
    outline: none;
}

/* Kapatma sonrası alttaki videoya sızan tıklamayı yut */
.videolar-click-blocker {
    position: fixed;
    inset: 0;
    z-index: 10000000;
    background: transparent;
    pointer-events: auto;
    -webkit-tap-highlight-color: transparent;
}

/* Responsive */
@media screen and (max-width: 1024px) {
    .videolar-grid.videolar-cols-4 {
        grid-template-columns: repeat(3, 1fr);
    }

    .videolar-search-box {
        min-width: 0;
    }
}

/* Responsive Filter Bar */
@media (max-width: 768px) {
    .videolar-container {
        padding: 0;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow: visible;
    }

    .videolar-filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        width: 100%;
        max-width: 100%;
        margin-bottom: 16px;
        box-sizing: border-box;
    }

    .videolar-search-box,
    .videolar-filter-dropdown,
    .videolar-filter-toggle {
        flex: 1 1 auto;
        width: 100%;
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
    }

    .videolar-filter-toggle {
        justify-content: center;
    }

    .videolar-filter-panel {
        position: static;
        top: auto;
        right: auto;
        left: auto;
        width: 100%;
        min-width: 0;
        max-width: 100%;
        margin-top: 8px;
        box-sizing: border-box;
        box-shadow: none;
    }

    .videolar-msdropdown-menu {
        max-height: 180px;
    }

    .videolar-search-input,
    .videolar-filter-select,
    .videolar-msdropdown-trigger {
        font-size: 16px !important; /* iOS zoom önleme */
    }

    /* Pagination mobile */
    .videolar-pagination {
        gap: 6px;
        margin: 20px 0;
    }

    .videolar-pagination a,
    .videolar-pagination span {
        min-width: 36px;
        height: 36px;
        padding: 0 8px;
        font-size: 13px;
    }

    .videolar-content {
        padding: 15px;
    }
    
    .videolar-title {
        font-size: 16px;
    }
    
    .videolar-modal-content {
        width: 95%;
    }
    
    .videolar-modal-close {
        top: 12px;
        right: 12px;
        width: 40px;
        height: 40px;
        font-size: 28px;
    }
}

@media screen and (max-width: 480px) {
    .video-item {
        margin-bottom: 0;
    }
}

/* Dark Mode Support — listing kartları site temasına uyumlu kalsın;
   arama/filtre alanları her zaman açık (beyaz) kalır */
@media (prefers-color-scheme: dark) {
    .videolar-search-box,
    .videolar-filter-toggle,
    .videolar-filter-panel,
    .videolar-filter-select,
    .videolar-msdropdown-trigger,
    .videolar-msdropdown-menu {
        background: #fff !important;
        border-color: #ddd !important;
        color: #333 !important;
    }

    .videolar-search-input {
        background: #fff !important;
        color: #333 !important;
        -webkit-text-fill-color: #333;
    }
}

/* Listing cards follow the cultural heritage card design. */
body .videolar-grid .video-item {min-width:0;display:flex;flex-direction:column;background:transparent;border:0;border-radius:0;overflow:visible;}
body .videolar-grid .video-item:hover {transform:none;}
body .videolar-grid .video-item.hidden {display:none;}
body .video-item .videolar-thumbnail {aspect-ratio:16/9;padding:0;flex-shrink:0;background:#e7ebe1;}
body .video-item .videolar-thumbnail img {width:100%;height:100%;object-fit:cover;transition:transform .45s;}
body .video-item:hover .videolar-thumbnail img {transform:scale(1.035);}
body .video-item .video-kategori-badge {position:absolute;bottom:0;left:0;max-width:100%;margin:0;padding:6px 13px;border-radius:0;font-size:12px;line-height:1.5;font-weight:700;letter-spacing:.06em;text-transform:none;}
body .video-item .videolar-content {padding:18px 0 0;display:flex;flex-direction:column;flex-grow:1;}
body .video-item h3.videolar-title {margin:0 0 20px;font-size:16px !important;font-weight:600 !important;line-height:1.45 !important;letter-spacing:-.015em !important;color:#182c22;overflow-wrap:anywhere;}
body .video-item h3.videolar-title:hover {color:#153d25;}
body .video-item .videolar-watch {display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;min-height:0;margin-top:auto;padding:12px 0 0;border:0;border-top:1px solid #d3dbd0;border-radius:0;background:transparent;color:#153d25;font-size:13px;font-weight:600;line-height:1.45;box-shadow:none;text-align:left;cursor:pointer;}
body .video-item .videolar-watch:hover {background:transparent;color:#153d25;}
body .video-item .videolar-watch svg {width:19px;height:19px;flex-shrink:0;}
body .video-item .videolar-watch:focus-visible {outline:2px solid #153d25;outline-offset:3px;}
@media(max-width:768px){body .videolar-grid[class*="videolar-cols-"]{grid-template-columns:repeat(2,minmax(0,1fr)) !important;gap:20px;}}
@media(max-width:480px){body .videolar-grid[class*="videolar-cols-"]{grid-template-columns:1fr !important;}}
@media(prefers-reduced-motion:reduce){body .video-item .videolar-thumbnail img{transition:none;}}
