/* ============================================
   Стили для форм объявлений
   ============================================ */

/* Блоки дополнительных полей */
.glider-fields,
.harness-fields,
.device-fields {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
}

.glider-fields h4,
.harness-fields h4,
.device-fields h4 {
    margin-top: 0;
    color: #495057;
    font-weight: 600;
}

/* Подсветка полей с ошибками */
.form-group.has-error input,
.form-group.has-error select,
.form-group.has-error textarea {
    border-color: #dc3545;
    background-color: #ff000024;
}

.form-group.has-error .help-block {
    color: #000000;
    position: absolute;
    width: 200px;
    background: yellow;
    padding: 0.5em;
    border-radius: 8px;
    box-shadow: 2px 2px 6px black;
}

/* Анимация тряски */
@keyframes shake {
    0%,
    100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

.shake-error {
    animation: shake 0.3s ease-in-out;
}

/* Стили для Drag & Drop зоны */
.drag-drop-zone {
    transition: border-color 0.3s ease, background-color 0.3s ease;
    cursor: default;
}

.drag-drop-zone:hover {
    border-color: #ccc !important;
    background-color: transparent !important;
}

.drag-drop-zone.drag-over {
    border-color: #5bc0de !important;
    background-color: #f0f8ff !important;
}

.btn-file {
    cursor: pointer;
    display: inline-block;
    margin-top: 10px;
}

/* Прогресс загрузки */
.progress {
    height: 30px;
    margin-bottom: 0;
}

/* Уведомления в форме */
.alert {
    transition: opacity 0.5s ease;
}

/* Сортировка изображений */
.sort-handle:hover {
    background: rgba(0, 0, 0, 0.7) !important;
}

/* ============================================
   Стили для карусели
   ============================================ */

.carousel-container {
    position: relative;
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
}

.carousel {
    position: relative;
}

.carousel-inner {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.carousel-inner .item {
    position: relative;
    display: none;
    transition: transform 0.6s ease;
}

.carousel-inner .item.active {
    display: block;
}

.carousel-image {
    width: 100%;
    height: 400px;
    object-fit: contain;
    background: #f8f9fa;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.carousel-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
    pointer-events: none;
}

.item:hover .carousel-image-overlay {
    background: rgba(0, 0, 0, 0.3);
}

/* Кнопки управления */
.carousel-control {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40px;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s ease;
    border: none;
    z-index: 10;
    text-decoration: none;
}

.carousel-control:hover {
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    text-decoration: none;
}

.carousel-control.left {
    left: 0;
    border-radius: 0 4px 4px 0;
}

.carousel-control.right {
    right: 0;
    border-radius: 4px 0 0 4px;
}

.carousel-control .glyphicon {
    font-size: 30px;
}

/* Индикаторы */
.carousel-indicators {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    gap: 8px;
    z-index: 15;
}

.carousel-indicators li {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
    display: block;
    text-indent: -9999px;
}

.carousel-indicators li.active {
    background: #fff;
    border-color: #fff;
}

/* Миниатюры */
.carousel-thumbnails {
    display: flex;
    gap: 8px;
    padding: 10px 20px;
    background: #f8f9fa;
    overflow-x: auto;
    justify-content: center;
}

.carousel-thumbnail {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    opacity: 0.7;
}

.carousel-thumbnail:hover {
    opacity: 1;
    border-color: #ccc;
}

.carousel-thumbnail.active {
    border-color: #007bff;
    opacity: 1;
}

.carousel-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Fullscreen модальное окно */
.fullscreen-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.fullscreen-modal.open {
    display: flex;
}

.fullscreen-image {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
}

.fullscreen-close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
    z-index: 10001;
    transition: transform 0.3s ease;
    font-weight: 300;
    line-height: 1;
}

.fullscreen-close:hover {
    transform: rotate(90deg);
}

.fullscreen-nav {
    position: absolute;
    bottom: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    pointer-events: none;
}

.fullscreen-prev,
.fullscreen-next {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    font-size: 30px;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    pointer-events: auto;
    transition: background 0.3s ease;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fullscreen-prev:hover,
.fullscreen-next:hover {
    background: rgba(255, 255, 255, 0.4);
}

.fullscreen-counter {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
    font-family: Arial, sans-serif;
}

/* Адаптивность */
@media (max-width: 768px) {
    .carousel-image {
        height: 250px;
    }
    
    .carousel-thumbnails {
        padding: 5px 10px;
        justify-content: flex-start;
    }
    
    .carousel-thumbnail {
        width: 45px;
        height: 45px;
    }
    
    .carousel-control {
        width: 30px;
    }
    
    .carousel-control .glyphicon {
        font-size: 20px;
    }
    
    .fullscreen-image {
        max-width: 95%;
        max-height: 80%;
    }
    
    .fullscreen-close {
        top: 15px;
        right: 20px;
        font-size: 30px;
    }
    
    .fullscreen-prev,
    .fullscreen-next {
        width: 35px;
        height: 35px;
        font-size: 20px;
    }
}