@import url("../../styles/style.css");

main {
    display: flex;
    justify-content: space-between;

    img.link {
	width: auto !important;
	height: auto !important;
    }

    #pagination {
        display: flex;
        justify-content: space-between;
        margin-bottom: 20px;

        a {
            position: relative;
            text-align: center;
        }

        a:first-child {
            padding-left: 20px;

            &::before {
                position: absolute;
                top: 0;
                left: 0px;
                content: url('../../assets/jackdaw.svg');
                transform: rotate(90deg);
                transition: all var(--transition-accordion);
            }

            &:hover::before {
                transform: rotate(90deg) scale(1.3);
            }
        }
        
        a:last-child {
            padding-right: 20px;

            &::after {
                position: absolute;
                top: 0;
                right: 0px;
                content: url('../../assets/jackdaw.svg');
                transform: rotate(-90deg);
                transition: all var(--transition-accordion);
            }

            &:hover::after {
                transform: rotate(-90deg) scale(1.3);
            }
        }
    }

    #subheader {
        display: flex;
        justify-content: space-between;
        margin-bottom: 20px;
	font-size: 18px;

        a {
            position: relative;
            text-align: center;
        }
    }

    #main-info {
        display: flex;
        flex-direction: column;
        gap: 15px;
    
        #airplane {
            width: 100%;
            display: flex;
            justify-content: space-between;
            gap: 40px;

            #left-side {
                width: 100%;
                display: flex;
                flex-direction: column;
                gap: 15px;

                #names {
                    display: flex;
                    flex-direction: column;
                    gap: 10px;

                    .name {
                        color: var(--text-menu-color);
                        font-size: 24px;
                        font-weight: 600;
                        line-height: 20px;

                        .country-year {
                            padding-left: 15px;
                            font-size: 14px;
                            font-weight: 400;
                            line-height: 17px;
                        }
                    }
                }

                #info {
                    width: 100%;
                    display: flex;
                    gap: 20px;

                    img {
                        max-width: 70%;
                        width: 70%;
                        height: 100%;
                        object-fit: contain;
                    }

                    #text-info {
                        width: 100%;
                        display: flex;
                        flex-direction: column;

                        #header {
                            min-width: 200px;
                            display: flex;
                            justify-content: space-between;
                            gap: 10px;
                            margin-bottom: 30px;

                            p {
                                color: var(--text-menu-color);
                                font-size: 16px;
                                font-weight: 600;
                            }
                        }

                        >p {
                            font-size: 14px;
                            font-weight: 400;
                            /* line-height: 17px; */

                            &:last-child {
                                margin-top: 30px;
                            }
                        }
                    }
                }

                @media screen and (max-width: 1500px) {
                    #info {
                        flex-direction: column;
                    }
                }
            }
        }

        #description {
            width: 100%;
            display: flex;
            justify-content: space-between;
            gap: 40px;

            #left-side {
                .text {
                    padding: 20px;
                    display: flex;
                    flex-direction: column;
                    gap: 20px;
                    background: var(--table-row-basic);
                    border: 1px solid var(--main-border-color);
                    border-radius: 25px;

                    p {
                        font-size: 14px;
                        font-weight: 400;
                        line-height: 20px;
                    }

                    .main-text {
                        padding-right: 10px;
                        max-height: 420px;
                        /* overflow-y: auto; */
                        overflow: hidden;
                        white-space: pre-wrap;
                        text-overflow: ellipsis;
                        display: -webkit-box;
                        -webkit-line-clamp: 5; /* Указывает количество видимых строк */
                        -webkit-box-orient: vertical;

                        &.open {
                            overflow-y: auto;
                            white-space: normal;
                            -webkit-line-clamp: unset;
                        }
                    }

                    .show-more {
                        display: block;
                        margin-top: 10px;

                        &.hidden {
                            display: none;
                        }
                    }
                }
            }
        }

        #photos {
            width: 100%;
            margin-top: 15px;
            display: flex;
            justify-content: space-between;
            gap: 40px;

	    .serial {
		background-color: #87e6de;
		padding: 2px 5px;
		&.secondary {
			color: #808080;
			background-color: #c4f3ef;
		}
	    }

	#filter-text {
		padding-right: 10px;
	}
        .chip {
            width: 110px;
            height: 34px;
            display: flex;
            justify-content: center;
            align-items: center;
            border: 2px solid var(--table-row);
            border-radius: 7px;
            box-sizing: border-box;
            cursor: pointer;
            transition: all var(--transition-button__hover);

            p { 
                padding: 5px 0;
                font-size: 13px;
                font-weight: 400;
                line-height: 20px;
            }

            &.selected {
                background: var(--primary-color);
                border: 1px solid var(--main-border-color);

                p {
                    font-weight: 600;
                }
            }

            &.wide {
                width: unset;
                min-width: 50px;
                padding-left: 10px;
                padding-right: 10px;
            }

            &:hover {
                background: var(--primary-color__hover);
            }

            &:active {
            transition: all var(--transition-button__active);
                background: var(--primary-color__active);
            }

            &:first-child {
                p {
                    font-weight: 600;
                }
            }
        }

            #left-side {
                width: 100%;
                display: flex;
                flex-direction: column;
                gap: 30px;

                #header {
                    display: flex;
                    align-items: center;
                    gap: 20px;

                    > h2 {
                        color: var(--text-menu-color);
                        font-size: 20px;
                        font-weight: 600;
                        line-height: 20px;
                    }
                }

                .accordion {
                    position: relative;
                    width: max-content;
                    padding: 0 30px 0 0;
                    color: var(--text-menu-color);
                    outline: none !important;
                    font-size: 18px;
                    font-weight: 600;
                    line-height: 20px;

                    &::after {
                        position: absolute;
                        top: -2px;
                        right: 0px;
                        content: url('../../assets/jackdaw.svg');
                        transition: all var(--transition-accordion);
                    }

                    &.active::after {
                        top: 0px;
                        transform: rotate(-180deg) !important;
                    }

                    &:hover {
                        color: var(--primary-color__hover);
                        background: none;
                    }

                    &:active {
                        color: var(--primary-color__active);
                        background: none;
                    }

		    &.notactive {
			display:none;
		    }
                }

                .plane-versions {
                    display: none;
                    flex-direction: column;
                    gap: 10px;
                    transition: all 300ms;
                    opacity: 0;

                    &.active {
                        display: flex;
                        opacity: 1;
                    }

    		    &.notactive {
			display:none;
		    }

                    .plane-version {
                        display: flex;
                        gap: 20px;
                        padding-bottom: 10px;
                        border-bottom: 1px solid var(--text-header-color);

                        .img-container {
                            position: relative;
                            min-width: 200px;
                            max-width: 200px;
                            max-height: 200px;
                            display: flex;
                            justify-content: center;

                            img {
                                max-width: 100%;
                            }

                            &.marked::before {
                                content: '';
                                position: absolute;
                                top: -20px;
                                left: 52px;
                                width: 96px;
                                height: 20px;
                                background-image: url('../../assets/star.svg');
                                z-index: 10;
                            }
                        }

                        .info {
                            width: 100%;
                            display: flex;
                            flex-direction: column;
                            gap: 4px;

                            >h6 {
                                color: var(--text-header-color);
                                font-size: 14px;
                                font-weight: 600;
                                line-height: 20px;
                            }

                            >h7 {
                                color: var(--text-header-color);
                                font-size: 12px;
                                font-weight: 600;
                                line-height: 20px;
					
				.some {
					cursor: pointer;
				}
                            }

                            >p {
                                font-size: 14px;
                                font-weight: 400;
                                line-height: 20px;
                            }

                            .another-planes {
                                display: flex;
                                flex-wrap: wrap;
                                flex-direction: column;
                                margin-top: auto;
                                text-align: right;

                                span {
                                    color: var(--text-table-color);
                                }

                                a {
                                    text-decoration: underline;
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}

/* Adaptability */
@media screen and (max-width: 1300px) {
    #airplane {
        #left-side {
            #info {
                img {
                        max-width: 100% !important;
                        width: 100% !important;
                    }

	    	img.link {
			width: auto !important;
			height: auto !important;
		    }

                #text-info {
                    >p {
                        text-align: left;
                    }
                }
            }

            @media screen and (max-width: 900px) {
                #names {
                    .name {
                        font-size: 18px !important;
                        line-height: 18px;
                    }
                }
            }
        }

        #right-side {
            display: none;
        }
    }

    #description {
        #right-side {
            display: none;
        }
    }

    #photos {
        #left-side {
            .plane-version .another-planes > span {
                text-align: right;
            }

            @media screen and (max-width: 600px) {
                width: 100%;

                .plane-version {
                    flex-direction: column;
                    align-items: center;

                    .another-planes span, .another-planes a {
                        text-align: center;
                    }
                }

                #header {
                    justify-content: center;
                    flex-direction: column;
                }
            }
        }

        #right-side {
            display: none;
        }
    }
}