/**
 * Стили для фронтенда плагина Step Building
 */

.step-building-container {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px 0;
}

.fancybox-stage {
    color: #fff;
}

.step-building-container {
    /* display: flex; */
}

.step-building-title {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 30px;
}


/* Фильтры */

.step-building-filters {
    margin-bottom: 30px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    transition: opacity 0.3s ease;
}

.step-building-filters.filters-disabled .filter-row {
    opacity: 0.6;
    pointer-events: none;
    cursor: not-allowed;
}

.step-building-filters.filters-disabled select {
    background-color: #f5f5f5;
    border-color: #ddd;
    color: #999;
}

@media (max-width: 768px) {
    .step-building-filters {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #666;
}

.step-building-filter {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    font-size: 16px;
}


/* Табы */

.step-building-tabs {
    margin-bottom: 30px;
}

.tab-buttons {
    display: flex;
    margin-bottom: 20px;
    gap: 10px;
}

.tab-button {
    padding: 12px 24px;
    background-color: #f5f5f5;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.tab-button.active {
    background-color: #2a487c;
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}


/* Карточки */

.step-building-items,
.step-building-webcam-items {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 30px;
    position: relative;
}


/* Стили для случая, когда слайдер не загружен или не нужен */

.step-building-items.no-slider,
.step-building-webcam-items.no-slider {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
}

.step-building-card {
    border-radius: 8px;
    overflow: hidden;
    background-color: #fff;
    transition: transform 0.3s ease;
    height: 100%;
    margin: 5px;
}

.step-building-card:hover {
    transform: translateY(-5px);
}

.step-building-media {
    position: relative;
    display: block;
    height: 0;
    padding-bottom: 135%;
    overflow: hidden;
}
.step-building-media img {
height: 100% !important;
}
@media (max-width:1024px) {
    .step-building-media {
        padding-bottom: 105%;
    }
    .filter-row {
        display: flex;
        flex-wrap: wrap;
        gap: 20px;
        width: 100%;
        margin-bottom: 20px;
        justify-content: center;
    }
    .tab-buttons {
        align-items: flex-start;
        flex-direction: row;
        width: 100%;
        justify-content: center;
    }
}

.fancybox-content {
    background: transparent !important;
    padding: 4px !important;
}

.webcam-iframe-container {
    padding-top: 30px !important;
}

.step-building-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.step-building-media:hover .step-building-thumbnail {
    transform: scale(1.05);
}

.step-building-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.step-building-video-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.step-building-video-thumbnail:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.2);
}

.step-building-video-thumbnail:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23333'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 24px;
}

/* Новый плейсхолдер для видео */
.step-building-video-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius:  8px 8px 0 0;
    transition: all 0.3s ease;
}

.step-building-video-placeholder:hover {
    background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
    transform: scale(1.02);
}

.video-placeholder-content {
    text-align: center;
    color: white;
}

.play-icon {
    font-size: 48px;
    color: #3498db;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.video-label {
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.9;
}


/* Стили для веб-камер */

.step-building-webcam-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.webcam-icon {
    width: 60px;
    height: 60px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.webcam-icon:before {
    content: '';
    width: 30px;
    height: 30px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23333'%3E%3Cpath d='M17 10.5V7c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h12c.55 0 1-.45 1-1v-3.5l4 4v-11l-4 4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.media-badge.webcam-badge {
    background-color: #3b65ae;
    color: white;
}

.step-building-webcam-title {
    font-size: 16px;
    color: #333;
    font-weight: 500;
}

.webcam-iframe-container {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
}

.webcam-iframe-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 соотношение */
    height: 0;
    overflow: hidden;
}

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

.media-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    background-color: white;
    color: #333;
    z-index: 2;
}

.step-building-info {
    padding: 15px;
    background-color: #ECEFF5;
    border-top: 1px solid #eee;
}

.step-building-date {
    font-size: 16px;
    color: #333;
    font-weight: 500;
}


/* Веб-камеры */

.webcams-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

.webcam-item {
    margin-bottom: 30px;
}

.webcam-title {
    margin-bottom: 15px;
    font-size: 20px;
    font-weight: 500;
}

.webcam-iframe {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 соотношение */
    height: 0;
    overflow: hidden;
}

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


/* Стили для Fancybox */

.fancybox-video {
    width: 100%;
    height: auto;
}

.no-results {
    text-align: center;
    padding: 30px;
    font-size: 18px;
    color: #666;
}


/* Стили для стрелок слайдера */

.slick-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.8) !important;
    border: none;
    font-size: 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.slick-arrow:hover {
    background-color: rgba(255, 255, 255, 1);
}

.slick-prev {
    left: 10px;
}

.slick-next {
    right: 10px;
}

.slick-prev:before,
.slick-next:before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    border-width: 2px;
    border-style: solid;
    border-color: #333;
}

.slick-prev:before {
    border-right: none;
    border-top: none;
    transform: translate(-30%, -50%) rotate(45deg);
}

.slick-next:before {
    border-left: none;
    border-bottom: none;
    transform: translate(-70%, -50%) rotate(45deg);
}


/* Скрытие стрелок на десктопе при малом количестве элементов */

.hide-arrows-desktop .slick-arrow {
    display: none;
}

@media (max-width: 1440px) {
    .hide-arrows-desktop .slick-arrow {
        display: block;
    }
}


/* Адаптивность */

@media (max-width: 1440px) {
    .step-building-items,
    .step-building-webcam-items {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1200px) {
    .step-building-items,
    .step-building-webcam-items {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .step-building-items,
    .step-building-webcam-items {
        grid-template-columns: repeat(2, 1fr);
    }
    .webcams-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .step-building-items,
    .step-building-webcam-items {
        grid-template-columns: 1fr;
    }
    .filter-row {
        flex-direction: column;
    }
    .tab-button {
        width: 100%;
        margin-bottom: 0;
        width: 100%;
    }
    .slick-prev {
        left: 5px;
    }
    .slick-next {
        right: 5px;
    }
}


/* Скрытые элементы галереи */

.hidden-gallery-item {
    display: none !important;
}


/* Стили для импортированных изображений */

.step-building-imported-gallery {
    position: relative;
    overflow: hidden;
}

.step-building-imported-gallery .step-building-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.step-building-imported-gallery .media-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
}


/* Стили для дебаг панели */

.step-building-debug {
    background: #f5f5f5 !important;
    padding: 20px !important;
    margin: 20px 0 !important;
    border: 2px solid #ddd !important;
    border-radius: 8px !important;
    font-family: monospace !important;
    font-size: 12px !important;
    max-width: 100% !important;
    overflow-x: auto !important;
}

.step-building-debug h2 {
    color: #d63638 !important;
    margin-top: 0 !important;
    font-size: 18px !important;
    border-bottom: 2px solid #d63638 !important;
    padding-bottom: 10px !important;
}

.step-building-debug h3 {
    color: #2271b1 !important;
    font-size: 14px !important;
    margin-top: 20px !important;
    margin-bottom: 10px !important;
    border-left: 3px solid #2271b1 !important;
    padding-left: 10px !important;
}

.step-building-debug h4 {
    color: #333 !important;
    font-size: 13px !important;
    margin-top: 15px !important;
    margin-bottom: 8px !important;
}

.step-building-debug p {
    margin: 5px 0 !important;
    line-height: 1.4 !important;
}

.step-building-debug ul {
    margin: 10px 0 !important;
    padding-left: 20px !important;
}

.step-building-debug li {
    margin: 3px 0 !important;
    line-height: 1.3 !important;
}

.step-building-debug strong {
    color: #333 !important;
    font-weight: bold !important;
}


/* Адаптивность для дебаг панели */

@media (max-width: 768px) {
    .step-building-debug {
        padding: 15px !important;
        font-size: 11px !important;
    }
    .step-building-debug h2 {
        font-size: 16px !important;
    }
    .step-building-debug h3 {
        font-size: 13px !important;
    }
}