/* Modules Page Section */
.modules-page-section {
    max-width: 1700px;
    margin: 0 auto;
    padding: 150px 40px 100px;
    min-height: calc(100vh - 200px);
}

.modules-page-container {
    max-width: 1500px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.modules-page-title {
    font-family: 'Inter', 'Arial Narrow', Arial, sans-serif;
    font-size: 64px;
    font-weight: 600;
    color: white;
    margin: 0 0 24px 0;
    line-height: 1.2;
    text-align: center;
}

.modules-page-title-accent {
    font-family: 'Square721TL-BoldExtended', 'Arial Black', Arial, sans-serif;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.modules-page-description {
    font-family: 'Inter', 'Arial Narrow', Arial, sans-serif;
    font-size: 20px;
    color: rgba(186, 186, 186, 1);
    text-align: center;
    max-width: 900px;
    margin: 0 auto 60px;
    line-height: 1.6;
}

/* Поисковый бар */
.modules-search-bar {
    position: relative;
    width: 100%;
    max-width: 560px;
    margin: 0 auto 24px;
}

.modules-search-bar-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(186, 186, 186, 0.6);
    font-size: 18px;
    pointer-events: none;
}

.modules-search-bar .modules-search-input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 14px 20px 14px 52px;
    font-size: 16px;
    font-family: 'Inter', 'Arial Narrow', Arial, sans-serif;
    background: rgba(21, 21, 21, 0.6);
    color: rgba(255, 255, 255, 0.95);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    transition: all 0.3s ease;
}

.modules-search-bar .modules-search-input::placeholder {
    color: rgba(186, 186, 186, 0.6);
}

.modules-search-bar .modules-search-input:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.2);
}

.modules-search-bar .modules-search-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.35);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08);
}

/* Modules Filters */
.modules-filters {
    display: inline-flex;
    align-items: center;
    gap: 32px;
    margin: 0px auto 24px;
    padding: 16px 24px;
    background: rgba(21, 21, 21, 0.4);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    flex-wrap: wrap;
    backdrop-filter: blur(10px);

}

.filters-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.filters-label {
    font-family: 'Inter', 'Arial Narrow', Arial, sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: rgba(186, 186, 186, 0.9);
    white-space: nowrap;
}

.filter-dropdown {
    position: relative;
    min-width: 160px;
}

.filter-select {
    width: 100%;
    background: rgba(21, 21, 21, 0.8);
    color: rgba(186, 186, 186, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 16px;
    padding-right: 40px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Inter', 'Arial Narrow', Arial, sans-serif;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%236468FB' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 12px;
}

.filter-select:hover {
    background-color: rgba(100, 104, 251, 0.1);
    border-color: rgba(100, 104, 251, 0.3);
    color: #6468FB;
}

.filter-select:focus {
    outline: none;
    background-color: rgba(100, 104, 251, 0.15);
    border-color: #6468FB;
    color: #6468FB;
}

.filter-select option {
    background: rgba(21, 21, 21, 0.95);
    color: rgba(186, 186, 186, 0.9);
    padding: 10px;
}

.filter-reset-btn {
    background: rgba(100, 104, 251, 0.1);
    color: #6468FB;
    border: 1px solid rgba(100, 104, 251, 0.3);
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Inter', 'Arial Narrow', Arial, sans-serif;
    white-space: nowrap;
    margin-left: auto;
}

.filter-reset-btn:hover {
    background: rgba(100, 104, 251, 0.2);
    border-color: rgba(100, 104, 251, 0.5);
    transform: translateY(-1px);
}

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

/* squircle поддержка для кнопки сброса */
@supports (corner-shape: squircle) {
    .filter-reset-btn {
        corner-shape: squircle;
        border-radius: 40px;
    }
}

/* squircle поддержка для фильтров */
@supports (corner-shape: squircle) {
    .modules-filters {
        corner-shape: squircle;
        border-radius: 40px;
    }
    
    .filter-select {
        corner-shape: squircle;
        border-radius: 40px;
    }
}

/* Modules Counter */
.modules-counter {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.modules-counter-label {
    font-family: 'Inter', 'Arial Narrow', Arial, sans-serif;
    font-size: 18px;
    color: rgba(186, 186, 186, 0.8);
    font-weight: 400;
    margin-left: 30px;

}

.modules-counter-value {
    font-family: 'Inter', 'Arial Narrow', Arial, sans-serif;
    font-size: 24px;
    color: rgba(186, 186, 186, 0.8);
}

/* Modules Grid */
.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
    gap: 32px;
    contain: layout style;
}

/* Module Card */
.module-card {
    background: rgba(21, 21, 21, 0.8);
    border-radius: 20px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    min-height: 340px;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    content-visibility: auto;
    contain-intrinsic-size: auto 340px;
    cursor: pointer;
}

.module-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
}

/* squircle поддержка для module-card */
@supports (corner-shape: squircle) {
    .module-card {
        corner-shape: squircle;
        border-radius: 40px;
    }
}

/* Hero зона карточки */
.module-card-hero {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.module-card-icon {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease-out;
}

.module-card-icon-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.module-card:hover .module-card-icon {
    transform: scale(1.08);
}

.module-card-hero-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-left: -10px;
}

.module-card-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
}

.module-card-title {
    font-family: 'Inter', 'Arial Narrow', Arial, sans-serif;
    font-size: clamp(18px, 1.8vw, 26px);
    font-weight: 600;
    color: white;
    margin: 0;
    line-height: 1.3;
    letter-spacing: -0.02em;
    flex: 1;
    min-width: 0;
}

.module-card-subtitle {
    font-family: 'Inter', 'Arial Narrow', Arial, sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: rgba(186, 186, 186, 0.8);
    margin: 0;
    line-height: 1.4;
}

/* Метка категории — компактный badge в правом углу заголовка */
.module-card-category {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 500;
    padding: 3px 7px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-family: 'Inter', 'Arial Narrow', Arial, sans-serif;
    line-height: 1.2;
}

.module-card-category-core {
    background: rgba(100, 104, 251, 0.15);
    color: rgba(180, 183, 255, 0.95);
    border: 1px solid rgba(100, 104, 251, 0.25);
}

.module-card-category-utility {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(186, 186, 186, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.module-card-description-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

/* Статус модуля */
.module-card-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Inter', 'Arial Narrow', Arial, sans-serif;
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 12px;
    margin-bottom: 12px;
    font-weight: 500;
    width: fit-content;
}

.module-card-status.status-ready {
    background: rgba(76, 175, 80, 0.15);
    color: #4CAF50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.module-card-status.status-pro {
    background: rgba(100, 104, 251, 0.15);
    color: #6468FB;
    border: 1px solid rgba(100, 104, 251, 0.3);
}

.module-card-status .status-icon {
    font-size: 8px;
    line-height: 1;
}

.module-card-status .status-text {
    font-size: 12px;
}

/* Платформы */
.module-card-platforms-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.module-card-platform-badge {
    font-family: 'Inter', 'Arial Narrow', Arial, sans-serif;
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 14px;
    background: rgba(100, 104, 251, 0.12);
    color: rgba(100, 104, 251, 0.9);
    border: 1px solid rgba(100, 104, 251, 0.25);
    white-space: nowrap;
    font-weight: 500;
    display: inline-block;
    transition: all 0.15s ease-out;
}

.module-card:hover .module-card-platform-badge {
    opacity: 0.9;
    transform: translateY(-1px);
}

.module-card-description {
    font-family: 'Inter', 'Arial Narrow', Arial, sans-serif;
    font-size: 15px;
    color: rgba(186, 186, 186, 0.9);
    line-height: 1.6;
    margin: 0 0 12px 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    word-break: break-word;
    hyphens: auto;
}

.module-card-description-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.2s ease-out;
}

.module-card-description-overlay.active {
    display: flex;
    opacity: 1;
}

.module-card-description-popup {
    background: rgba(21, 21, 21, 0.98);
    border-radius: 20px;
    padding: 32px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    position: relative;
    transform: scale(0.95);
    transition: transform 0.2s ease-out;
    -webkit-overflow-scrolling: touch;
}

.module-card-description-overlay.active .module-card-description-popup {
    transform: scale(1);
}

.module-card-description-popup-title {
    font-family: 'Inter', 'Arial Narrow', Arial, sans-serif;
    font-size: 24px;
    font-weight: 600;
    color: white;
    margin: 0 0 8px 0;
}

.module-card-description-popup-subtitle {
    font-family: 'Inter', 'Arial Narrow', Arial, sans-serif;
    font-size: 16px;
    color: rgba(186, 186, 186, 0.8);
    margin: 0 0 20px 0;
    line-height: 1.5;
}

.module-card-description-popup-text {
    font-family: 'Inter', 'Arial Narrow', Arial, sans-serif;
    font-size: 16px;
    color: rgba(186, 186, 186, 1);
    line-height: 1.6;
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.module-card-description-popup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(100, 104, 251, 0.1);
    color: #6468FB;
    border: 1px solid rgba(100, 104, 251, 0.3);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 18px;
    line-height: 1;
}

.module-card-description-popup-close:hover {
    background: rgba(100, 104, 251, 0.2);
    border-color: rgba(100, 104, 251, 0.5);
    transform: rotate(90deg);
}

/* Скрываем скроллбар для popup */
.module-card-description-popup::-webkit-scrollbar {
    width: 6px;
}

.module-card-description-popup::-webkit-scrollbar-track {
    background: transparent;
}

.module-card-description-popup::-webkit-scrollbar-thumb {
    background: rgba(100, 104, 251, 0.3);
    border-radius: 3px;
}

.module-card-description-popup::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 104, 251, 0.5);
}

.module-card-description-popup {
    scrollbar-width: thin;
    scrollbar-color: rgba(100, 104, 251, 0.3) transparent;
}

.btn-show-more {
    background: transparent;
    color: #6468FB;
    border: none;
    padding: 4px 0;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Inter', 'Arial Narrow', Arial, sans-serif;
    text-align: left;
    margin-top: 4px;
    align-self: flex-start;
}

.btn-show-more:hover {
    color: #7F82FF;
    text-decoration: underline;
}

.module-card-features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.module-card-feature {
    font-family: 'Inter', 'Arial Narrow', Arial, sans-serif;
    font-size: 14px;
    color: rgba(186, 186, 186, 0.9);
    display: flex;
    align-items: center;
    gap: 8px;
}

.module-card-feature::before {
    content: '✓';
    color: #6468FB;
    font-weight: bold;
    font-size: 16px;
}

.module-card-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.module-card-details-link {
    font-family: 'Inter', 'Arial Narrow', Arial, sans-serif;
    font-size: 14px;
    color: rgba(100, 104, 251, 0.7);
    text-decoration: none;
    transition: all 0.2s ease-out;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    margin: -8px -16px;
    border-radius: 8px;
    cursor: pointer;
}

.module-card-details-link:hover {
    color: #6468FB;
    gap: 6px;
    background: rgba(100, 104, 251, 0.1);
}


/* Responsive */
@media (max-width: 1200px) {
    .modules-grid {
        grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
        gap: 24px;
    }
}

@media (min-width: 1024px) and (max-width: 1366px) and (orientation: portrait) {
    .modules-page-section {
        padding: 130px 32px 80px;
    }

    .modules-page-title {
        font-size: 48px;
    }

    .modules-page-description {
        font-size: 18px;
        margin-bottom: 32px;
    }

    .modules-filters {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
        align-items: center;
    }

    .filters-group {
        width: 100%;
        justify-content: space-between;
    }

    .filter-dropdown {
        width: 100%;
        min-width: 0;
    }

    .filter-select {
        width: 100%;
    }

    .filter-reset-btn {
        margin-left: 0;
        grid-column: 1 / -1;
        width: 100%;
    }
}

@media (max-width: 767px) {
    .modules-page-section {
        padding: calc(92px + env(safe-area-inset-top)) 16px 40px;
        min-height: auto;
    }

    .modules-page-title {
        font-size: 26px;
        margin-bottom: 16px;
    }

    .modules-page-description {
        font-size: 15px;
        margin-bottom: 24px;
        line-height: 1.6;
    }

    .modules-search-bar {
        margin-bottom: 20px;
        padding: 0 4px;
    }

    .modules-search-bar-icon {
        left: 16px;
        font-size: 16px;
    }

    .modules-search-bar .modules-search-input {
        padding: 12px 16px 12px 44px;
        font-size: 15px;
    }

    .modules-filters {
        padding: 16px;
        gap: 16px;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        margin-bottom: 20px;
    }

    .filters-group {
        width: 100%;
        flex-direction: row;
        align-items: center;
        gap: 10px;
    }

    .filters-label {
        min-width: 70px;
        font-size: 13px;
    }

    .filter-dropdown {
        flex: 1;
        min-width: auto;
    }
    
    .filter-select {
        font-size: 13px;
        padding: 10px 14px;
        padding-right: 36px;
    }

    .filter-reset-btn {
        width: 100%;
        margin-left: 0;
        margin-top: 4px;
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .modules-counter {
        margin-bottom: 20px;
        margin-left: 0;
        justify-content: center;
    }
    
    .modules-counter-label {
        font-size: 15px;
        margin-left: 0;
    }
    
    .modules-counter-value {
        font-size: 20px;
    }

    .modules-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .module-card {
        min-height: auto;
        padding: 20px 16px;
    }
    
    .module-card-hero {
        gap: 12px;
    }
    
    .module-card-icon {
        width: 52px;
        height: 52px;
    }
    
    .module-card-title {
        font-size: 18px;
    }
    
    .module-card-subtitle {
        font-size: 13px;
    }
    
    .module-card-description {
        font-size: 14px;
        line-height: 1.5;
    }
    
    .module-card-status {
        font-size: 11px;
        padding: 5px 10px;
    }
    
    .module-card-category {
        font-size: 9px;
        padding: 2px 5px;
    }
}

@media (max-width: 479px) {
    .modules-page-title {
        font-size: 24px;
    }

    .modules-page-description {
        font-size: 14px;
    }
    
    .filters-label {
        font-size: 12px;
    }
    
    .filter-select {
        font-size: 12px;
        padding: 8px 12px;
        padding-right: 32px;
    }
    
    .filter-reset-btn {
        font-size: 12px;
        padding: 8px 14px;
    }

    .module-card-hero {
        flex-direction: row;
        align-items: flex-start;
        text-align: left;
    }

    .module-card-icon {
        width: 48px;
        height: 48px;
    }

    .module-card-title {
        font-size: 17px;
    }

    .module-card-subtitle {
        font-size: 12px;
    }
    
    .module-card-description {
        font-size: 13px;
    }
}

