/* CSS стили для страницы магазина курсов */

.shop-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.shop-header {
    text-align: center;
    margin-bottom: 40px;
}

.shop-header h1 {
    color: #2c3e50;
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: bold;
}

.shop-subtitle {
    color: #7f8c8d;
    font-size: 1.1rem;
    margin: 0;
}

/* Фильтры поиска */
.filters-container {
    background: white;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.filters-form .filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
    align-items: end;
}

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

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

.filter-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.filter-group input,
.filter-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background-color: white;
    box-sizing: border-box;
}

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

.price-filter {
    flex: 2;
    min-width: 300px;
}

.price-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
}

.price-inputs input {
    flex: 1;
    margin: 0;
}

.price-separator {
    color: #7f8c8d;
    font-weight: bold;
    font-size: 16px;
}

.currency-label {
    color: #7f8c8d;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
}

.filter-actions {
    display: flex;
    gap: 10px;
    align-items: end;
    min-width: 200px;
}

.btn-filter,
.btn-clear {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-filter {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    flex: 1;
}

.btn-filter:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-clear {
    background: #ecf0f1;
    color: #7f8c8d;
    border: 2px solid #bdc3c7;
}

.btn-clear:hover {
    background: #d5dbdb;
    border-color: #95a5a6;
    color: #2c3e50;
}

/* Результаты поиска */
.search-results {
    margin-bottom: 25px;
}

.results-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.results-count {
    color: #2c3e50;
    font-size: 16px;
}

.page-info {
    color: #7f8c8d;
    font-size: 14px;
}

/* Сетка курсов */
.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.course-card {
    background: white;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.course-card:hover {
    border-color: #667eea;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.course-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.course-logo {
    width: 100%;
    height: 180px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
}

.course-logo-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.course-logo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 2.5rem;
    font-weight: bold;
}

.course-info {
    flex-grow: 1;
    margin-bottom: 20px;
}

.course-info h3 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 1.3rem;
    line-height: 1.4;
    font-weight: bold;
}

.course-info p {
    margin: 8px 0;
    color: #7f8c8d;
    font-size: 14px;
    line-height: 1.5;
    display: flex;
    align-items: center;
    gap: 8px;
}

.course-info p i {
    color: #667eea;
    width: 16px;
    text-align: center;
}

.course-author,
.course-level,
.course-themes,
.course-language {
    border-bottom: 1px solid #ecf0f1;
    padding-bottom: 6px;
}

.course-price {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid #ecf0f1;
}

.price-value {
    color: #27ae60;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
}

.price-free {
    color: #3498db;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
}

.course-actions {
    display: flex;
    gap: 12px;
    margin-top: auto;
}

.btn-view-course,
.btn-buy-course {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    text-align: center;
}

.btn-view-course {
    background: #ecf0f1;
    color: #2c3e50;
    border: 2px solid #bdc3c7;
}

.btn-view-course:hover {
    background: #d5dbdb;
    border-color: #95a5a6;
    text-decoration: none;
    color: #2c3e50;
}

.btn-buy-course {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
}

.btn-buy-course:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

/* Пагинация */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 40px 0;
}

.pagination-btn,
.pagination-number {
    padding: 10px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    color: #2c3e50;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pagination-btn:hover,
.pagination-number:hover {
    border-color: #667eea;
    background: #f8f9fa;
    text-decoration: none;
    color: #667eea;
}

.pagination-number.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.pagination-numbers {
    display: flex;
    gap: 5px;
    align-items: center;
}

.pagination-dots {
    color: #7f8c8d;
    font-weight: bold;
    padding: 0 8px;
}

/* Отсутствие курсов */
.no-courses {
    text-align: center;
    padding: 80px 20px;
    color: #7f8c8d;
}

.no-courses-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    color: #bdc3c7;
}

.no-courses h3 {
    color: #2c3e50;
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.no-courses p {
    font-size: 16px;
    margin-bottom: 25px;
    line-height: 1.5;
}

/* Загрузка */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e1e5e9;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Адаптивность */
@media (max-width: 1200px) {
    .course-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

@media (max-width: 768px) {
    .shop-container {
        padding: 15px;
    }

    .shop-header h1 {
        font-size: 2rem;
    }

    .filters-form .filters-row {
        flex-direction: column;
        gap: 15px;
    }

    .filter-group {
        min-width: auto;
    }

    .price-filter {
        min-width: auto;
    }

    .price-inputs {
        flex-direction: column;
        align-items: stretch;
    }

    .price-separator {
        text-align: center;
    }

    .filter-actions {
        min-width: auto;
        flex-direction: column;
    }

    .course-grid {
        grid-template-columns: 1fr;
    }

    .course-actions {
        flex-direction: column;
    }

    .results-info {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .pagination {
        flex-wrap: wrap;
        gap: 5px;
    }

    .pagination-btn {
        padding: 8px 12px;
        font-size: 13px;
    }

    .pagination-number {
        padding: 8px 12px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .shop-header h1 {
        font-size: 1.7rem;
    }

    .filters-container {
        padding: 20px;
    }

    .course-card {
        margin: 0 10px;
    }

    .course-logo {
        height: 150px;
    }
}

.course-language-flags {
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
    font-size: 1.2em;
    margin-left: 5px;
}

.course-language-flags span {
    margin-right: 3px;
}

/* Улучшение отображения emoji флагов */
.course-language {
    display: flex;
    align-items: center;
    gap: 8px;
}

.course-language-flags {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}
