/* projects-marketplace.css - ПОЛНАЯ ОБНОВЛЕННАЯ ВЕРСИЯ: СТРОКИ + УНИФИЦИРОВАННЫЕ ФИЛЬТРЫ */

/* КОНТЕЙНЕР ВИТРИНЫ */
.marketplace-container {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.7) !important;
    z-index: 9999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px !important;
    overflow-y: auto !important;
}

/* МОДАЛЬНОЕ ОКНО ВИТРИНЫ */
.marketplace-modal {
    background: white !important;
    border-radius: 16px !important;
    width: 100% !important;
    max-width: 1400px !important;
    max-height: 95vh !important;
    overflow: hidden !important;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4) !important;
    display: flex !important;
    flex-direction: column !important;
    z-index: 10000 !important;
}

/* ШАПКА ВИТРИНЫ */
.marketplace-header {
    background: linear-gradient(135deg, #4CAF50, #2E7D32) !important;
    color: white !important;
    padding: 20px 30px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    border-radius: 16px 16px 0 0 !important;
}

.marketplace-header h2 {
    margin: 0 !important;
    font-size: 24px !important;
    font-weight: 600 !important;
    color: white !important;
}

.header-actions {
    display: flex !important;
    align-items: center !important;
    gap: 20px !important;
}

.selected-counter {
    background: rgba(255, 255, 255, 0.2) !important;
    padding: 8px 16px !important;
    border-radius: 20px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
}

.close-marketplace {
    background: none !important;
    border: none !important;
    color: white !important;
    font-size: 28px !important;
    cursor: pointer !important;
    padding: 5px !important;
    border-radius: 6px !important;
    transition: background 0.2s ease !important;
    width: 40px !important;
    height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.close-marketplace:hover {
    background: rgba(255, 255, 255, 0.2) !important;
}

/* ПАНЕЛЬ ФИЛЬТРОВ - УНИФИЦИРОВАННАЯ */
.marketplace-filters {
    background: #f8f9fa !important;
    border-bottom: 1px solid #e9ecef !important;
    padding: 20px 30px !important;
}

.filters-row {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
    gap: 15px !important;
    margin-bottom: 15px !important;
    align-items: end !important;
}

.filters-row:last-child {
    margin-bottom: 0 !important;
}

.filter-group {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
}

.filter-group label {
    font-weight: 600 !important;
    color: #333 !important;
    font-size: 14px !important;
    line-height: 1.2 !important;
    margin: 0 !important;
}

/* УНИФИЦИРОВАННЫЕ ИНПУТЫ И СЕЛЕКТЫ */
.filter-group input,
.filter-group select {
    padding: 10px 12px !important;
    border: 1px solid #ddd !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    background: white !important;
    transition: border-color 0.2s ease !important;
    height: 42px !important;
    box-sizing: border-box !important;
    line-height: 1.2 !important;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none !important;
    border-color: #4CAF50 !important;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2) !important;
}

.range-inputs {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    height: 42px !important;
}

.range-inputs input {
    flex: 1 !important;
    margin: 0 !important;
    height: 42px !important;
    padding: 10px 12px !important;
}

.range-inputs span {
    color: #666 !important;
    font-weight: bold !important;
    font-size: 16px !important;
    line-height: 1 !important;
    flex-shrink: 0 !important;
}

.filter-group .btn {
    height: 42px !important;
    padding: 10px 16px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    border: none !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    white-space: nowrap !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.filter-group .btn-secondary {
    background: #6c757d !important;
    color: white !important;
}

.filter-group .btn-secondary:hover {
    background: #5a6268 !important;
    transform: translateY(-1px) !important;
}

.filter-group select[multiple] {
    min-height: 42px !important;
    max-height: 120px !important;
    overflow-y: auto !important;
    resize: vertical !important;
}

/* КОНТЕНТ ВИТРИНЫ */
.marketplace-content {
    flex: 1 !important;
    overflow-y: auto !important;
    padding: 20px 30px !important;
}

.projects-stats {
    margin-bottom: 20px !important;
    padding: 12px 20px !important;
    background: rgba(76, 175, 80, 0.1) !important;
    border: 1px solid rgba(76, 175, 80, 0.2) !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    color: #2E7D32 !important;
    font-size: 14px !important;
}

/* ПРОЕКТЫ В ВИДЕ СТРОК */
.projects-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    background: white !important;
    border: 1px solid #e9ecef !important;
    border-radius: 8px !important;
    overflow: hidden !important;
}

.project-card {
    display: grid !important;
    grid-template-columns: 40px 200px 1fr 200px 150px !important;
    align-items: center !important;
    background: white !important;
    border: none !important;
    border-bottom: 1px solid #e9ecef !important;
    border-radius: 0 !important;
    overflow: visible !important;
    transition: all 0.2s ease !important;
    box-shadow: none !important;
    padding: 12px !important;
    min-height: 80px !important;
}

.project-card:last-child {
    border-bottom: none !important;
}

.project-card:hover {
    transform: none !important;
    box-shadow: none !important;
    background: #f8f9fa !important;
}

.project-card.selected {
    border-color: #4CAF50 !important;
    background: rgba(76, 175, 80, 0.05) !important;
}

/* СТРУКТУРА СТРОКИ */
.project-checkbox {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.project-checkbox input[type="checkbox"] {
    width: 18px !important;
    height: 18px !important;
    accent-color: #4CAF50 !important;
    cursor: pointer !important;
    margin: 0 !important;
}

.project-checkbox label {
    display: none !important;
}

.project-map-container {
    width: 180px !important;
    height: 60px !important;
    margin: 0 !important;
    padding: 0 !important;
}

.project-mini-map {
    width: 100% !important;
    height: 100% !important;
    border-radius: 6px !important;
    overflow: hidden !important;
    border: 1px solid #ddd !important;
    background: #f8f9fa !important;
    position: relative !important;
}

.map-placeholder {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 100% !important;
    color: #666 !important;
    font-size: 12px !important;
    text-align: center !important;
    background: linear-gradient(135deg, #e8f5e8, #f0f8f0) !important;
}

.project-details {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
    padding: 0 12px !important;
    align-items: flex-start !important;
}

.project-title {
    margin: 0 0 4px 0 !important;
}

.project-title h3 {
    margin: 0 !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #333 !important;
    line-height: 1.2 !important;
}

.project-location {
    font-size: 12px !important;
    color: #666 !important;
    font-weight: 500 !important;
    margin: 0 0 8px 0 !important;
}

.project-info-row {
    display: flex !important;
    align-items: center !important;
    gap: 15px !important;
    flex-wrap: wrap !important;
}

.info-item {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
}

.info-item label {
    font-size: 11px !important;
    font-weight: 600 !important;
    color: #666 !important;
    text-transform: uppercase !important;
}

.vintage-badge {
    background: #4CAF50 !important;
    color: white !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    text-align: center !important;
}

.min-quantity,
.available-credits {
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #333 !important;
}

.price-badge {
    background: #4CAF50 !important;
    color: white !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
}

.project-standards {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    padding: 0 12px !important;
    width: 180px !important;
}

.project-standards label {
    font-size: 10px !important;
    font-weight: 600 !important;
    color: #666 !important;
    text-transform: uppercase !important;
}

.standards-list {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 4px !important;
}

.standard-badge {
    background: #4CAF50 !important;
    color: white !important;
    padding: 2px 6px !important;
    border-radius: 3px !important;
    font-size: 9px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
}

.standards-more {
    background: #6c757d !important;
    color: white !important;
    padding: 2px 6px !important;
    border-radius: 3px !important;
    font-size: 9px !important;
    font-weight: 600 !important;
}

.no-standards {
    color: #999 !important;
    font-size: 11px !important;
    font-style: italic !important;
}

.project-actions {
    padding: 0 !important;
    border: none !important;
    background: none !important;
    display: flex !important;
    justify-content: center !important;
}

.project-actions .btn {
    width: auto !important;
    padding: 8px 16px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    border: none !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    white-space: nowrap !important;
}

.project-actions .btn-success {
    background: #28a745 !important;
    color: white !important;
}

.project-actions .btn-success:hover {
    background: #218838 !important;
    transform: translateY(-1px) !important;
}

.project-header,
.project-content,
.project-documents {
    display: none !important;
}

/* ФУТЕР ВИТРИНЫ */
.marketplace-footer {
    background: #f8f9fa !important;
    border-top: 1px solid #e9ecef !important;
    padding: 20px 30px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    border-radius: 0 0 16px 16px !important;
}

.selected-projects-info {
    font-weight: 600 !important;
    color: #4CAF50 !important;
    font-size: 14px !important;
}

.footer-actions {
    display: flex !important;
    gap: 15px !important;
    align-items: center !important;
}

.footer-actions .btn {
    padding: 8px 16px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    border: none !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    white-space: nowrap !important;
}

.footer-actions .btn-primary {
    background: #4CAF50 !important;
    color: white !important;
}

.footer-actions .btn-primary:hover:not(:disabled) {
    background: #45a049 !important;
    transform: translateY(-1px) !important;
}

.footer-actions .btn-primary:disabled {
    background: #6c757d !important;
    cursor: not-allowed !important;
    transform: none !important;
}

.footer-actions .btn-outline {
    background: transparent !important;
    color: #4CAF50 !important;
    border: 1px solid #4CAF50 !important;
}

.footer-actions .btn-outline:hover {
    background: #4CAF50 !important;
    color: white !important;
}

.footer-actions .btn-secondary {
    background: #6c757d !important;
    color: white !important;
}

.footer-actions .btn-secondary:hover {
    background: #5a6268 !important;
}

/* СОСТОЯНИЯ ЗАГРУЗКИ И ОШИБОК */
.loading-projects {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 60px 20px !important;
    text-align: center !important;
    color: #666 !important;
}

.loading-spinner {
    width: 40px !important;
    height: 40px !important;
    border: 4px solid #f0f0f0 !important;
    border-top: 4px solid #4CAF50 !important;
    border-radius: 50% !important;
    animation: spin 1s linear infinite !important;
    margin-bottom: 20px !important;
}

.no-projects,
.projects-error {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 60px 20px !important;
    text-align: center !important;
    color: #666 !important;
}

.no-projects h3,
.projects-error h3 {
    margin-bottom: 10px !important;
    color: #333 !important;
}

.no-projects p,
.projects-error p {
    margin-bottom: 20px !important;
    max-width: 400px !important;
}

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

/* RESPONSIVE ДИЗАЙН */
@media (max-width: 1200px) {
    .project-card {
        grid-template-columns: 30px 150px 1fr 150px 120px !important;
        padding: 10px !important;
    }

    .project-map-container {
        width: 140px !important;
        height: 50px !important;
    }

    .project-standards {
        width: 140px !important;
    }
}

@media (max-width: 768px) {
    .marketplace-container {
        padding: 10px !important;
        align-items: flex-start !important;
        padding-top: 20px !important;
    }

    .marketplace-modal {
        max-width: 100% !important;
        max-height: 95vh !important;
        border-radius: 12px !important;
    }

    .marketplace-header {
        padding: 15px 20px !important;
        flex-direction: column !important;
        gap: 15px !important;
        text-align: center !important;
    }

    .marketplace-filters {
        padding: 15px 20px !important;
    }
    
    .filters-row {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    
    .filter-group input,
    .filter-group select,
    .filter-group .btn,
    .range-inputs {
        height: 44px !important;
    }
    
    .range-inputs input {
        height: 44px !important;
        padding: 12px !important;
    }

    /* НА МОБИЛЬНЫХ ВОЗВРАЩАЕМ БЛОКИ */
    .projects-list {
        display: flex !important;
        flex-direction: column !important;
        gap: 15px !important;
        background: none !important;
        border: none !important;
    }

    .project-card {
        display: flex !important;
        flex-direction: column !important;
        background: white !important;
        border: 2px solid #e9ecef !important;
        border-radius: 12px !important;
        padding: 15px !important;
        gap: 15px !important;
        min-height: auto !important;
    }

    .project-card.selected {
        border-color: #4CAF50 !important;
        background: rgba(76, 175, 80, 0.05) !important;
    }

    .project-checkbox {
        order: -1 !important;
        justify-content: flex-start !important;
    }

    .project-checkbox label {
        display: inline !important;
        margin-left: 8px !important;
        font-size: 12px !important;
        color: #666 !important;
    }

    .project-map-container {
        width: 100% !important;
        height: 120px !important;
    }

    .project-details {
        padding: 0 !important;
    }

    .project-standards {
        width: 100% !important;
        padding: 0 !important;
    }

    .project-actions {
        justify-content: stretch !important;
    }

    .project-actions .btn {
        width: 100% !important;
        padding: 12px !important;
        font-size: 14px !important;
    }
}

@media (max-width: 480px) {
    .marketplace-filters {
        padding: 12px 15px !important;
    }
    
    .filters-row {
        gap: 10px !important;
    }
    
    .filter-group label {
        font-size: 13px !important;
    }
    
    .filter-group input,
    .filter-group select {
        font-size: 13px !important;
    }
}
