/* ===================================
   VIDEO FILTER & GRID STYLING
   =================================== */

/* Kategori filter */
.video-kategori-filter {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
    border: 1px solid #e9ecef;
}

.video-kategori-filter p {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.kategori-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.kategori-checkboxes label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    padding: 10px 16px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    transition: all 0.2s ease;
    user-select: none;
}

.kategori-checkboxes label:hover {
    background: #e8f4ff;
    border-color: #0066cc;
}

.kategori-checkboxes input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #0066cc;
}

.kategori-checkboxes input[type="checkbox"]:checked + span,
.kategori-checkboxes label:has(input:checked) {
    background: #e8f4ff;
    border-color: #0066cc;
    font-weight: 600;
    color: #0066cc;
}

/* Video results container */
.video-results-container {
    min-height: 400px;
    transition: opacity 0.3s ease;
    position: relative;
}

.video-results-container.loading {
    opacity: 0.5;
    pointer-events: none;
}

.video-results-container.loading::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50px;
    height: 50px;
    margin: -25px 0 0 -25px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0066cc;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 10;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Video grid */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

/* Video kort */
.video-kort {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.video-kort:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

/* Video embed */
.video-embed {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    background: #000;
}

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

/* Video placeholder (hvis ingen video) */
.video-placeholder {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
}

.video-placeholder p {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.video-placeholder small {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    opacity: 0.8;
    max-width: 80%;
    word-break: break-all;
}

/* Video info */
.video-info {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.video-tittel {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 12px 0;
    line-height: 1.4;
    color: #1a1a1a;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-id {
    font-size: 12px;
    color: #6c757d;
    font-family: 'Courier New', Courier, monospace;
    margin: 0 0 12px 0;
    background: #f8f9fa;
    padding: 6px 10px;
    border-radius: 4px;
    display: inline-block;
    font-weight: 500;
}

.video-gren {
    margin-bottom: 10px;
}

.video-gren .badge {
    display: inline-block;
    padding: 6px 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.video-kategorier {
    font-size: 13px;
    color: #6c757d;
    margin-top: 8px;
    line-height: 1.5;
}

.video-beskrivelse {
    font-size: 14px;
    color: #495057;
    line-height: 1.6;
    margin-top: auto;
    padding-top: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Ingen videoer melding */
.ingen-videoer {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    color: #6c757d;
    font-size: 18px;
    background: #f8f9fa;
    border-radius: 8px;
}

/* Error message */
.error-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: #dc3545;
    font-size: 16px;
    background: #f8d7da;
    border: 1px solid #f5c2c7;
    border-radius: 8px;
}

/* ===================================
   PAGINATION STYLING
   =================================== */

.video-pagination {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #e9ecef;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.page-btn {
    min-width: 40px;
    padding: 10px 16px;
    border: 2px solid #0066cc;
    background: white;
    color: #0066cc;
    font-weight: 600;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-size: 14px;
    font-family: inherit;
}

.page-btn:hover:not(.active) {
    background: #e8f4ff;
    transform: translateY(-2px);
}

.page-btn.active {
    background: #0066cc;
    color: white;
    cursor: default;
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

.page-btn.active:hover {
    transform: none;
}

.page-prev,
.page-next {
    padding: 10px 20px;
    font-weight: 700;
}

.page-dots {
    padding: 0 8px;
    color: #6c757d;
    font-weight: 600;
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */

@media (max-width: 1200px) {
    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 25px;
    }
}

@media (max-width: 768px) {
    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }

    .video-kort {
        border-radius: 10px;
    }

    .video-info {
        padding: 16px;
    }

    .video-tittel {
        font-size: 16px;
    }

    .kategori-checkboxes {
        flex-direction: column;
        gap: 10px;
    }

    .kategori-checkboxes label {
        width: 100%;
        justify-content: flex-start;
    }

    .video-kategori-filter {
        padding: 20px;
    }
}

@media (max-width: 640px) {
    .video-grid {
        grid-template-columns: 1fr;
    }

    .pagination {
        gap: 5px;
    }

    .page-btn {
        min-width: 36px;
        padding: 8px 12px;
        font-size: 13px;
    }

    .page-prev,
    .page-next {
        padding: 8px 16px;
    }
}

/* ===================================
   ELEMENTOR TAB OVERRIDES
   =================================== */

.elementor-tabs .elementor-tab-content {
    padding: 30px 20px;
}

.elementor-tabs .elementor-tab-title {
    font-weight: 600;
}

.elementor-tabs .elementor-tab-title.elementor-active {
    background: #0066cc;
    color: white;
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    .video-kort {
        background: #1e1e1e;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }

    .video-tittel {
        color: #ffffff;
    }

    .video-info {
        background: #1e1e1e;
    }

    .video-id {
        background: #2a2a2a;
        color: #a0a0a0;
    }
}