/* static/css/pages/platform-detail.css */
/* Страница детальной карточки платформы. */

body {
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: #EEF5FB;
    padding: 40px;
    min-height: 100vh;
}

/* .logo-placeholder наследует display: none из header.css — показывается только через JS */
.logo-placeholder,
.service-logo-placeholder,
.screenshot-placeholder {
    background: #f5f5f5;
    border: 2px dashed #ccc;
    border-radius: 8px;
    color: #999;
    font-weight: 600;
    cursor: default;
    user-select: none;
}

.service-logo-placeholder,
.screenshot-placeholder {
    display: inline-block;
}

.logo-placeholder {
    padding: 20px 40px;
    font-size: 18px;
    letter-spacing: 2px;
}

.keywords-section {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.keyword-item {
    padding: 6px 12px;
    background: #f5f5f5;
    border: 2px solid #e0e0e0;
    border-radius: 16px;
    color: #555;
    font-size: 12px;
    text-decoration: none;
    cursor: pointer;
    user-select: none;
    display: inline-block;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.keyword-item:hover {
    background: #5B9BD5;
    color: #ffffff;
    border-color: #5B9BD5;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(91, 155, 213, 0.3);
}

.keywords-section-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 40px 0 30px 0;
}

.service-logo-section {
    text-align: center;
    margin-bottom: 30px;
}

.service-logo-img {
    max-width: 200px;
    max-height: 150px;
    object-fit: contain;
    width: 100%;
    height: auto;
}

.service-logo-placeholder {
    width: 150px;
    height: 150px;
    line-height: 150px;
    border-radius: 12px;
    font-size: 48px;
    text-align: center;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

.left-column,
.right-column,
.center-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.info-block {
    background: #f9f9f9;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
}

.info-block h3 {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 15px;
}

.info-item {
    margin-bottom: 12px;
}

.info-item:last-child {
    margin-bottom: 0;
}

.info-label {
    font-size: 12px;
    color: #999;
    margin-bottom: 4px;
}

.info-value {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.info-value.empty {
    color: #999;
    font-style: italic;
}

.info-subsection {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.info-subsection-title {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 15px;
}

.service-name {
    font-size: 32px;
    font-weight: 700;
    color: #2c3e50;
    text-align: center;
    margin-bottom: 15px;
}

.service-price {
    margin-bottom: 20px;
}

.tariff-item {
    font-size: 15px;
    color: #444;
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
}

.tariff-item:last-child {
    border-bottom: none;
}

.tariff-amount {
    font-weight: 700;
    color: #2c3e50;
}

.tariff-period {
    font-weight: 500;
    color: #555;
}

.tariff-dash {
    color: #999;
    margin: 0 6px;
}

.tariff-service {
    color: #555;
}

.tariffs-title {
    font-size: 24px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 16px;
    text-align: left;
}

.tariffs-list-block {
    background: #f9f9f9;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 14px 20px;
}

.ip-link,
.legal-link,
.contact-link {
    color: #5B9BD5;
    text-decoration: none;
    transition: all 0.3s ease;
}

.ip-link:hover,
.legal-link:hover,
.contact-link:hover {
    text-decoration: underline;
    color: #4A8BC8;
}

.blurred-content {
    filter: blur(4px);
    user-select: none;
    opacity: 0.6;
    position: relative;
    cursor: pointer;
    transition: filter 0.3s ease, opacity 0.3s ease;
}

.blurred-content:hover {
    filter: blur(3px);
    opacity: 0.7;
}

.blurred-content::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    cursor: pointer;
}

.blurred-content a,
.blurred-content * {
    pointer-events: none;
}

.auth-required-message {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 10px;
}

.screenshot-section {
    text-align: center;
    margin-bottom: 20px;
}

.cancellation-block {
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    border: 2px solid;
    margin-bottom: 20px;
}

.cancellation-block.easy {
    background: #f0faf4;
    border-color: #4caf7d;
}

.cancellation-block.medium {
    background: #fffbf0;
    border-color: #e6a817;
}

.cancellation-block.hard {
    background: #fff5f5;
    border-color: #e05a5a;
}

.cancellation-block-icon {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    margin-top: 1px;
}

.cancellation-block.easy .cancellation-block-icon { color: #2e7d52; }
.cancellation-block.medium .cancellation-block-icon { color: #8a6200; }
.cancellation-block.hard .cancellation-block-icon { color: #c0392b; }

.cancellation-block-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cancellation-block-title {
    font-size: 15px;
    font-weight: 700;
}

.cancellation-block.easy .cancellation-block-title { color: #2e7d52; }
.cancellation-block.medium .cancellation-block-title { color: #8a6200; }
.cancellation-block.hard .cancellation-block-title { color: #c0392b; }

.cancellation-block-desc {
    font-size: 13px;
    color: #555;
    line-height: 1.4;
}

.screenshots-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.screenshot-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.screenshot-img {
    max-width: 100%;
    width: 100%;
    height: auto;
    border-radius: 12px;
    border: 2px solid #e0e0e0;
    margin-bottom: 10px;
}

.screenshot-img.desktop {
    max-width: 600px;
}

.screenshot-img.mobile {
    max-width: 200px;
    display: none;
}

.screenshot-placeholder {
    width: 200px;
    height: 150px;
    line-height: 150px;
    border-radius: 12px;
    font-size: 48px;
    text-align: center;
}

.related-services {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #e0e0e0;
}

.related-services h2 {
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 20px;
}

.related-services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.related-service-card-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.related-service-card {
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
    width: 100%;
}

.related-service-card.inactive {
    border-color: #ff9999;
}

.related-service-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(91, 155, 213, 0.05) 0%, rgba(74, 139, 200, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.related-service-card:hover {
    border-color: #5B9BD5;
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(91, 155, 213, 0.2);
}

.related-service-card:hover::before {
    opacity: 1;
}

.related-service-logo,
.related-service-card object {
    max-width: 100%;
    max-height: 80px;
    object-fit: contain;
    position: relative;
    z-index: 1;
    pointer-events: none;
}

.related-service-card.visited .related-service-logo,
.related-service-card.visited object {
    filter: grayscale(100%);
    opacity: 0.7;
}

.related-service-name {
    font-size: 12px;
    font-weight: 600;
    color: #555;
    text-align: center;
    word-break: break-word;
    position: relative;
    z-index: 1;
    pointer-events: none;
}

.related-service-domain {
    font-size: 10px;
    color: #999;
    text-align: center;
    line-height: 1.2;
    word-break: break-word;
    width: 100%;
}

.related-service-card * {
    pointer-events: none;
}

/* Стили для сворачивающихся групп документации */

.doc-group-item {
    margin-bottom: 12px;
}

.doc-group-item:last-child {
    margin-bottom: 0;
}

.doc-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    padding: 8px 0;
    transition: opacity 0.2s ease;
}

.doc-group-header:hover {
    opacity: 0.7;
}

.doc-group-label {
    font-size: 12px;
    color: #999;
    flex: 1;
}

.doc-group-toggle {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.doc-group-toggle svg {
    width: 16px;
    height: 16px;
    fill: #999;
}

.doc-group-item.expanded .doc-group-toggle {
    transform: rotate(180deg);
}

.doc-group-content {
    overflow: hidden;
    transition: height 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    height: 0;
}

.doc-group-item.expanded .doc-group-content {
    margin-top: 4px;
}

.doc-item {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.doc-item:last-child {
    border-bottom: none;
}

.contact-page-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #5B9BD5;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    width: 100%;
    justify-content: center;
}

.contact-page-btn:hover {
    background: #4A8BC8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(91, 155, 213, 0.3);
    color: #ffffff;
}

.contact-page-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.description-section {
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 8px;
}

.description-text {
    color: #444;
    font-size: 15px;
    line-height: 1.7;
    white-space: pre-line;
}

/* Блок уведомления: платформа является копией бренда */

.brand-primary-notice {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff8e1;
    border: 1.5px solid #ffe082;
    border-radius: 10px;
    padding: 12px 18px;
    margin-bottom: 24px;
    font-size: 14px;
    color: #5a4500;
}

.brand-primary-notice svg {
    flex-shrink: 0;
    color: #f5a623;
}

.brand-primary-notice a {
    color: #5B9BD5;
    font-weight: 600;
    text-decoration: none;
}

.brand-primary-notice a:hover {
    text-decoration: underline;
}

/* Секция копий бренда */

.brand-copies-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #e0e0e0;
}

.brand-copies-section h2 {
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 20px;
}

.brand-copies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
}

.brand-copy-card-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.brand-copy-card {
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 80px;
    position: relative;
    overflow: hidden;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
}

.brand-copy-card:hover {
    border-color: #5B9BD5;
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(91, 155, 213, 0.2);
}

.brand-copy-card .related-service-logo,
.brand-copy-card object {
    max-width: 100%;
    max-height: 80px;
    object-fit: contain;
}

.brand-copy-domain {
    font-size: 11px;
    color: #666;
    text-align: center;
    line-height: 1.3;
    word-break: break-word;
}

.brand-copy-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
}

.brand-copy-badge {
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 600;
    line-height: 1.4;
}

.brand-copy-badge.diff-contacts {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffd666;
}

.brand-copy-badge.diff-docs {
    background: #e8f4fd;
    color: #1a5276;
    border: 1px solid #aed6f1;
}

@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .breadcrumbs,
    .keywords-section {
        justify-content: flex-start;
    }

    .site-logo-img {
        max-width: 140px;
        max-height: 60px;
    }

    .logo-placeholder {
        padding: 15px 30px;
        font-size: 16px;
    }
}

@media (max-width: 767px) {
    .screenshot-img.desktop {
        display: none;
    }

    .screenshot-img.mobile {
        display: block;
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 15px;
        border-radius: 12px;
        min-height: calc(100vh - 20px);
    }

    .service-name {
        font-size: 24px;
        word-break: break-word;
    }

    .service-price {
        font-size: 20px;
        word-break: break-word;
    }

    .tariff-item {
        font-size: 14px;
        padding: 5px 0;
    }

    .related-services-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }

    .info-block {
        padding: 15px;
    }

    .info-value,
    .contact-link,
    .ip-link,
    .legal-link {
        word-break: break-word;
    }

    .brand-copies-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }
}
