/* Стили для фильтра займов */

.filter-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 10px 0;
    margin-bottom: 10px;
    position: relative;
    overflow: hidden;
}

.filter-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: 200px 20px;
    animation: wave 3s linear infinite;
}

@keyframes wave {
    0% { background-position-x: 0; }
    100% { background-position-x: 200px; }
}

.filter-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
    position: relative;
    z-index: 1;
}

.filter-form {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.filter-title {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    text-align: center;
    margin-bottom: 10px;
}

.filter-subtitle {
    text-align: center;
    color: #666;
    font-size: 16px;
    margin-bottom: 25px;
    line-height: 1.5;
}

.filter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
    align-items: start;
}

/* Десктопная версия - 2 колонки */
@media (min-width: 769px) {
    .filter-grid {
        grid-template-columns: 1fr 1fr;
        gap: 40px;
    }
    
    .filter-left {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }
    
    .filter-right {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        justify-content: center;
        background: rgba(102, 126, 234, 0.05);
        border-radius: 12px;
        padding: 30px;
        border: 1px solid rgba(102, 126, 234, 0.1);
    }
    
    .filter-right h3 {
        font-size: 24px;
        color: #333;
        margin-bottom: 10px;
        font-weight: 700;
    }
    
    .filter-right p {
        color: #666;
        margin-bottom: 30px;
        margin-top: 15px;
        font-size: 16px;
        line-height: 1.5;
    }
    
    .filter-right hr {
        display: none;
    }
}

.filter-field {
    display: flex;
    flex-direction: column;
    position: relative;
}

.filter-label {
    font-weight: 600;
    color: #444;
    margin-bottom: 8px;
    font-size: 14px;
    display: flex;
    align-items: center;
}

.filter-label::before {
    content: '';
    width: 4px;
    height: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    margin-right: 8px;
}

.filter-input, .filter-select {
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
    position: relative;
}

.filter-input:focus, .filter-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.filter-input:hover, .filter-select:hover {
    border-color: #c3d0ff;
}

/* Стилизация select */
.filter-select {
    appearance: none;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8"><path d="M1 1l5 5 5-5" stroke="%23667eea" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

/* Стилизация number input */
.filter-input[type="number"] {
    -moz-appearance: textfield;
}

.filter-input[type="number"]::-webkit-outer-spin-button,
.filter-input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.filter-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 25px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    display: block;
    position: relative;
    overflow: hidden;
}

.filter-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.filter-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.filter-button:hover::before {
    left: 100%;
}

.filter-button:active {
    transform: translateY(0);
}

/* Анимация появления формы */
.filter-form {
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Стили для блока с кнопкой в средней позиции */
.filter-action-section {
    margin: 30px 0;
    padding: 20px 0;
}

.filter-action-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.filter-action-block {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    color: white;
}

.filter-action-divider {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    margin: 0 0 20px 0;
}

.filter-action-title {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 15px;
}

.filter-action-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    margin-bottom: 25px;
    line-height: 1.5;
}

.filter-button-center {
    background: #fff;
    color: #667eea;
    border: none;
    font-weight: 700;
    transition: all 0.3s ease;
}

.filter-button-center:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* Responsive design */
/* Мобильная версия - вертикальная */
@media (max-width: 768px) {
    .filter-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .filter-left {
        display: contents;
    }
    
    .filter-right {
        background: none;
        border: none;
        padding: 0;
        text-align: center;
    }
    
    .filter-right hr {
        display: block;
        margin: 20px 0 15px 0;
        border: none;
        height: 1px;
        background: linear-gradient(90deg, transparent, #ddd, transparent);
    }
    
    .filter-container {
        padding: 0 10px;
    }
    
    .filter-form {
        padding: 20px;
        border-radius: 12px;
    }
    
    .filter-title {
        font-size: 24px;
    }
    
    .filter-subtitle {
        font-size: 14px;
    }
    
    .filter-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .filter-input, .filter-select {
        padding: 14px 16px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .filter-button {
        padding: 16px 30px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .filter-section {
        padding: 20px 0;
    }
    
    .filter-form {
        padding: 15px;
    }
    
    .filter-title {
        font-size: 20px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .filter-form {
        background: rgba(255, 255, 255, 0.95);
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .filter-input, .filter-select {
        border-width: 3px;
    }
    
    .filter-input:focus, .filter-select:focus {
        border-color: #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .filter-form {
        animation: none;
    }
    
    .filter-section::before {
        animation: none;
    }
    
    .filter-button::before {
        transition: none;
    }
    
    .filter-input, .filter-select, .filter-button {
        transition: none;
    }
}

/* Стили для кликнутых карточек офферов */
.card_24zami.clicked {
    order: 99 !important;
    opacity: 0.8;
    border: 2px solid #007bff;
    background-color: #f8f9fa;
    transform: scale(0.98);
    transition: all 0.3s ease;
    position: relative;
}

.card_24zami.clicked::after {
    content: "✓ Вы кликали на этот оффер";
    position: absolute;
    top: -8px;
    right: -8px;
    background: #28a745;
    color: white;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: bold;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.card_24zami.clicked:hover {
    opacity: 0.9;
    transform: scale(0.99);
    border-color: #0056b3;
}

/* Обеспечиваем что кликнутые карточки всегда внизу */
.cards-container {
    display: flex;
    flex-direction: column;
}

.card_24zami.clicked {
    order: 999 !important;
}
