﻿@import url('https://fonts.googleapis.com/css?family=Montserrat:400,700|Raleway:300,400');

/* переменные */
:root {
    --blue: #e74c3c;
    --red: #FF4A53;
    --accent: #e74c3c;
    --accent-inactive: #fff;
    --secondary: #fff;
    --indicator-width: 50px;
    --indicator-height: 4px;
    --tab-count: 20;
}

.tabs {
    position: relative;
    background: transparent;
    top: 20px;
}

.tabs input[name="tab-control"] {
    display: none;
}

.tabs .content section h2,
.tabs ul li label {
    font-family: "Montserrat";
    font-weight: bold;
    font-size: 18px;
    color: var(--accent);
}

.tabs ul {
    list-style-type: none;
    padding-left: 0;
    display: flex;
    flex-direction: row;
    margin-bottom: 10px;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
}

.tabs ul li {
    box-sizing: border-box;
    flex: 1;
    width: calc(100% / 12);
    padding: 0 10px;
    text-align: center;
    background: rgba(0, 0, 0, 0.73);
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.tabs ul li label {
    transition: all 0.2s ease-in-out;
    color: var(--secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    cursor: pointer;
    -webkit-touch-callout: none;
}

.tabs ul li label br {
    display: none;
}

.tabs .slider {
    position: relative;
    width: calc(100% / 12);
    transition: all 0.33s cubic-bezier(0.38, 0.8, 0.32, 1.07);
    display: none;
}

.tabs .slider .indicator {
    position: relative;
    width: var(--indicator-width);
    max-width: 10%;
    margin: 0 auto;
    height: var(--indicator-height);
    background: var(--accent);
    border-radius: 1px;
}

.tabs .content {
    margin-top: 30px;
}

.tabs .content section {
    display: none;
    animation: content 0.3s ease-in-out 1;
    line-height: 1.4;
}

.tabs .content section h2 {
    color: var(--accent);
    display: none;
}

.tabs .content section h2::after {
    content: "";
    position: relative;
    display: block;
    width: 30px;
    height: 3px;
    background: var(--accent);
    margin-top: 5px;
    left: 1px;
}

/* Псевдоселекторы для вкладок 1-20 */
input[name="tab-control"]:nth-of-type(1):checked ~ ul > li:nth-child(1),
input[name="tab-control"]:nth-of-type(2):checked ~ ul > li:nth-child(2),
input[name="tab-control"]:nth-of-type(3):checked ~ ul > li:nth-child(3),
input[name="tab-control"]:nth-of-type(4):checked ~ ul > li:nth-child(4),
input[name="tab-control"]:nth-of-type(5):checked ~ ul > li:nth-child(5),
input[name="tab-control"]:nth-of-type(6):checked ~ ul > li:nth-child(6),
input[name="tab-control"]:nth-of-type(7):checked ~ ul > li:nth-child(7),
input[name="tab-control"]:nth-of-type(8):checked ~ ul > li:nth-child(8),
input[name="tab-control"]:nth-of-type(9):checked ~ ul > li:nth-child(9),
input[name="tab-control"]:nth-of-type(10):checked ~ ul > li:nth-child(10),
input[name="tab-control"]:nth-of-type(11):checked ~ ul > li:nth-child(11),
input[name="tab-control"]:nth-of-type(12):checked ~ ul > li:nth-child(12),
input[name="tab-control"]:nth-of-type(13):checked ~ ul > li:nth-child(13),
input[name="tab-control"]:nth-of-type(14):checked ~ ul > li:nth-child(14),
input[name="tab-control"]:nth-of-type(15):checked ~ ul > li:nth-child(15),
input[name="tab-control"]:nth-of-type(16):checked ~ ul > li:nth-child(16),
input[name="tab-control"]:nth-of-type(17):checked ~ ul > li:nth-child(17),
input[name="tab-control"]:nth-of-type(18):checked ~ ul > li:nth-child(18),
input[name="tab-control"]:nth-of-type(19):checked ~ ul > li:nth-child(19),
input[name="tab-control"]:nth-of-type(20):checked ~ ul > li:nth-child(20) {
    cursor: default;
    color: var(--accent);
}

/* Перемещение слайдера для 20 вкладок */
input[name="tab-control"]:nth-of-type(1):checked ~ .slider {
    transform: translateX(0%);
}

input[name="tab-control"]:nth-of-type(2):checked ~ .slider {
    transform: translateX(100%);
}

input[name="tab-control"]:nth-of-type(3):checked ~ .slider {
    transform: translateX(200%);
}

input[name="tab-control"]:nth-of-type(4):checked ~ .slider {
    transform: translateX(300%);
}

input[name="tab-control"]:nth-of-type(5):checked ~ .slider {
    transform: translateX(400%);
}

input[name="tab-control"]:nth-of-type(6):checked ~ .slider {
    transform: translateX(500%);
}

input[name="tab-control"]:nth-of-type(7):checked ~ .slider {
    transform: translateX(600%);
}

input[name="tab-control"]:nth-of-type(8):checked ~ .slider {
    transform: translateX(700%);
}

input[name="tab-control"]:nth-of-type(9):checked ~ .slider {
    transform: translateX(800%);
}

input[name="tab-control"]:nth-of-type(10):checked ~ .slider {
    transform: translateX(900%);
}

input[name="tab-control"]:nth-of-type(11):checked ~ .slider {
    transform: translateX(1000%);
}

input[name="tab-control"]:nth-of-type(12):checked ~ .slider {
    transform: translateX(1100%);
}

input[name="tab-control"]:nth-of-type(13):checked ~ .slider {
    transform: translateX(1200%);
}

input[name="tab-control"]:nth-of-type(14):checked ~ .slider {
    transform: translateX(1300%);
}

input[name="tab-control"]:nth-of-type(15):checked ~ .slider {
    transform: translateX(1400%);
}

input[name="tab-control"]:nth-of-type(16):checked ~ .slider {
    transform: translateX(1500%);
}

input[name="tab-control"]:nth-of-type(17):checked ~ .slider {
    transform: translateX(1600%);
}

input[name="tab-control"]:nth-of-type(18):checked ~ .slider {
    transform: translateX(1700%);
}

input[name="tab-control"]:nth-of-type(19):checked ~ .slider {
    transform: translateX(1800%);
}

input[name="tab-control"]:nth-of-type(20):checked ~ .slider {
    transform: translateX(1900%);
}

/* Відображення відповідного контенту для 20 вкладок */
input[name="tab-control"]:nth-of-type(1):checked ~ .content > section:nth-child(1),
input[name="tab-control"]:nth-of-type(2):checked ~ .content > section:nth-child(2),
input[name="tab-control"]:nth-of-type(3):checked ~ .content > section:nth-child(3),
input[name="tab-control"]:nth-of-type(4):checked ~ .content > section:nth-child(4),
input[name="tab-control"]:nth-of-type(5):checked ~ .content > section:nth-child(5),
input[name="tab-control"]:nth-of-type(6):checked ~ .content > section:nth-child(6),
input[name="tab-control"]:nth-of-type(7):checked ~ .content > section:nth-child(7),
input[name="tab-control"]:nth-of-type(8):checked ~ .content > section:nth-child(8),
input[name="tab-control"]:nth-of-type(9):checked ~ .content > section:nth-child(9),
input[name="tab-control"]:nth-of-type(10):checked ~ .content > section:nth-child(10),
input[name="tab-control"]:nth-of-type(11):checked ~ .content > section:nth-child(11),
input[name="tab-control"]:nth-of-type(12):checked ~ .content > section:nth-child(12),
input[name="tab-control"]:nth-of-type(13):checked ~ .content > section:nth-child(13),
input[name="tab-control"]:nth-of-type(14):checked ~ .content > section:nth-child(14),
input[name="tab-control"]:nth-of-type(15):checked ~ .content > section:nth-child(15),
input[name="tab-control"]:nth-of-type(16):checked ~ .content > section:nth-child(16),
input[name="tab-control"]:nth-of-type(17):checked ~ .content > section:nth-child(17),
input[name="tab-control"]:nth-of-type(18):checked ~ .content > section:nth-child(18),
input[name="tab-control"]:nth-of-type(19):checked ~ .content > section:nth-child(19),
input[name="tab-control"]:nth-of-type(20):checked ~ .content > section:nth-child(20) {
    display: block;
}

/* Анимация */
@keyframes content {
    from {
        opacity: 0;
        transform: translateY(5%);
    }

    to {
        opacity: 1;
        transform: translateY(0%);
    }
}

/* Адаптив */
@media (max-width: 950px) {
    .tabs ul li label {
        padding: 5px;
        border-radius: 5px;
    }

    .tabs ul li {
        width: auto;
    }

    .tabs .slider {
        display: none;
    }

    .tabs .content {
        margin-top: 20px;
    }

    input[name="tab-control"]:checked ~ ul > li label {
        background: rgba(0, 0, 0, 0.08);
    }
}
