#main-page {
    background: #AA1D1D; /* fallback when the header background image is loaded slowly */
}

/***************************************
 ************ custom header *************
 ***************************************/

.header-wrapper {
    color: white;
}

.header-background {
    background: url('../img/bg_rectangles_full.png') center center;
    background-size: cover;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: -1;
}

.header-wrapper h3 {
    font-weight: 500;
}

.header-text {
    margin-bottom: 40px;
    width: 100%;
}

.header-wrapper .get-newpipe-wrapper {
    position: relative;
    bottom: -25px;
}


.header-wrapper .get-newpipe-wrapper {
    -webkit-box-shadow: 0px -1px 10px -4px black, 0 2px 10px -4px black;
    -moz-box-shadow: 0px -1px 10px -4px black, 0 2px 10px -4px black;
    box-shadow: 0px -1px 10px -4px black, 0 2px 10px -4px black;
    -moz-border-radius: 5px;
    -webkit-border-radius: 5px;
    border-radius: 5px;
}

.header-wrapper .get-newpipe-wrapper:hover {
    -webkit-box-shadow: 0px -1px 10px -3px black, 0 2px 10px -3px black;
    -moz-box-shadow: 0px -1px 10px -3px black, 0 2px 10px -3px black;
    box-shadow: 0px -1px 10px -3px black, 0 2px 10px -3px black;
}


.header-box-wrapper > .container {
    position: relative;
}

.header-box-wrapper .phone {
    display: inline;
    position: absolute;
    right: 60px;
    top: 20px;
    height: 500px;
    width: calc(2158 / 4291 * 500px);
}

.header-box-wrapper .logo {
    width: auto;
    position: absolute;
    left: calc(50% - 41px);
    margin-top: 20px;
    margin-bottom: 10px;
}

.header-box-wrapper .logo > img {
    height: 90px;
}

.header-box-wrapper .phone > img {
    height: 100%;
    position: absolute;
    left: 0;
}

.header-box-wrapper .phone > video {
    position: relative;
    top: 48px;
    left: 15px;
    width: 223px;
    height: 397px;
    background: black;
    display: inline-block;
}

@media (max-width: 991px) {
    .header-box-wrapper .phone {
        height: 450px;
        width: calc(2158 / 4291 * 450px);
    }

    .header-box-wrapper .phone > video {
        top: 43px;
        left: 13px;
        width: 201px;
        height: 358px;
    }
}

@media (max-width: 767px) {
    .header-box-wrapper .pull-left {
        float: none !important;
    }
    .header-wrapper .logo {
        text-align: center;
        position: relative;
        left: 0;
    }
    .header-wrapper .get-newpipe-wrapper {
        text-align: center;
    }
    .header-wrapper .get-newpipe-wrapper {
        width: 160px;
        margin: auto;
        left: 0;
        right: 0;
    }
}

@media (min-width: 768px) {
    .header-background {
        background-size: cover;
    }
    .header-text {
        margin-bottom: 100px;
        width: auto;
    }
    .header-wrapper .get-newpipe-wrapper {
        position: absolute;
        bottom: -25px;
    }
}

/***************************************
 ************ feature tile *************
 ***************************************/

#features {
    background: #f3eff2;
}

#features #features-title {
    font-size: 28px;
    color: #cd201f;
    text-align: center;
    margin-bottom: 30px;
}

@media (min-width: 768px) {
    #features #features-title {
        display: none;
    }
}

#features .row.is-flex > [class*='col-'] {
    flex: 1 auto;
}

#features #features-sidebar {
    background: #E2DEE0;
    display: block;
    /* padding 0 to draw the separators, that is why .list-group-item has a double padding of 30px on each side */
    padding-left: 0;
    padding-right: 0;
    min-height: 0;
}

@media (min-width: 992px) {
    #features #features-sidebar {
        border-left: 1px solid #BBB;
        min-height: 590px;
    }
}

#features #features-sidebar .list-group {
    width: 100%;
    margin-top: 0;
    margin-bottom: 0;
    background: #E2DEE0;
    font-size: 18px;
    font-weight: bold;
}

#features #features-sidebar .list-group .list-group-item {
    background: none;
    border: none;
    color: #cd201f;
    padding: 15px 30px;
    border-top: 7px solid #f3eff2;
    border-radius: 0;
    display: flex;
}

#features #features-sidebar .list-group > .active > .list-group-item {
    background: #d0cdcd;
}

@media (min-width: 768px) and (max-width: 991px) {
    #features #features-sidebar .list-group .list-group-item {
        width: 50%;
        float: left;
    }
    #features #features-sidebar .list-group a:nth-child(2n-1) .list-group-item {
        border-right: 4px solid #f3eff2;
    }
    #features #features-sidebar .list-group a:nth-child(2n) .list-group-item {
        border-left: 3px solid #f3eff2;
    }
}

@media (min-width: 992px) {
    #features #features-sidebar .list-group {
        margin-top: 23px;
        margin-bottom: 20px;
    }
    #features #features-sidebar .list-group .list-group-item {
        padding: 17px 30px;
        border-top-width: 0;
    }
    #features #features-sidebar .list-group > .active > .list-group-item {
        border: 1px solid #BBB;
        border-left-color: #d0cdcd;
        border-right-width: 0;
        border-radius: 0;
        padding-top: 16px;
        padding-bottom: 16px;
        margin-left: -1px;
        padding-left: 30px;
    }
}

#features #features-sidebar .list-group .list-group-item span.icon {
    width: 25px;
    margin-right: 10px;
    font-size: 25px;
    line-height: 25px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

#features .feature-detail {
    background: #d0cdcd;
    display: none;
    float: left;
    padding-top: 20px;
    padding-left: 30px;
    font-size: 16px;
}

#features .feature-detail.active {
    display: block;
}

@media (max-width: 767px) {
    #features .feature-detail.active {
        position: fixed;
        top: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        /* Fix overflow caused by to small screens */
        max-height: 100%;
        min-height: 100%;
        overflow-y: scroll;
        padding-right: 30px;
    }
    #features .feature-detail.active .back {
        display: block;
    }
}

#features .feature-detail h3 {
    color: #cd201f;
    text-align: center;
    text-indent: 20px;
    margin-bottom: 30px;
    padding-left: 20px;
    padding-right: 20px;
}

@media (min-width: 768px) {
    #features .feature-detail h3 {
        padding-left: 0;
        padding-right: 0;
        text-indent: 0;
    }
}

#features .feature-detail .feature-media,
.tile-media {
    position: relative;
    width: 100%;
    margin-bottom: 30px;
    text-align: center;
}

#features .feature-detail .feature-media > img,
.tile-media > img {
    display: inline;
}

@media (min-width: 768px) {
    #features .feature-detail .feature-media,
    .tile-media {
        width: calc(50% - 15px);
        margin-right: 15px;
        float: left;
    }
}

#features .feature-detail .feature-description,
.tile-description {
    position: relative;
    float: left;
    margin-left: 15px;
    margin-bottom: 30px;
}

@media only screen and (min-width: 768px) and (max-height: 725px) {
    #features .feature-detail .feature-media {
        width: calc(33% - 15px);
    }
    #features .feature-detail .feature-description {
        width: calc(66% - 15px);
    }
}

#features .feature-close-detail {
    display: none;
    position: absolute;
    top: 24px;
    left: 15px;
    font-size: 20px;
    color: #cd201f;
    padding: 15px;
    cursor: pointer;
}

@media (max-width: 767px) {
    #features .feature-detail.active .feature-close-detail {
        display: block;
    }
}

#features .icon {
    float: left;
    margin-right: 30px;
    width: 54px;
}

#features .icon h3 {
    margin-top: 0;
    margin-bottom: 0;
    font-weight: 600;
    line-height: 2em !important;
    vertical-align: middle;
}

#features #lightweight .feature-description {
    width: 100% !important;
}

.container.container-double .row.is-flex > [class*="col-"] {
    display: block;
    margin-bottom: 15px;
}

#features .description {
    color: #cd201f;
    font-weight: 600;
    width: 100%;
    text-align: center;
}

#features .feature-description a {
    color: #cd201f;
}

#features .feature-description .text-success,
ul.check > li.text-success {
    color: #29a400;
}

#features .feature-description ul > li,
ul.check {
    list-style: none;
    padding-left: 15px;
    line-height: 2;
    text-indent: -25px;
}

#features .feature-description ul > li:before,
ul.check > li:before {
    /* FontAwesome Unicode for check icon */
    content: "\f00c";
    font-family: FontAwesome;
    display: inline-block;
    margin-left: 0;
    padding-left: 25px;
    height: 100%;
}

#features .feature-description ul > li.heart:before,
ul.check > li.heart:before {
    content: "\f004";
}

#features .c100 {
    margin-right: auto;
    margin-left: auto;
    float: none;
}

#features .c100 ~ p {
    text-align: center;
    font-size: 18px;
}

#features #lightweight .feature-description {
    margin-top: 45px;
}

#features #lightweight .feature-description [class^="col"] {
    margin-bottom: 45px;
}

/* Progress circles
   Idea Sergio Pedercini https://medium.com/@pppped/how-to-code-a-responsive-circular-percentage-chart-with-svg-and-css-3632f8cd7705 */

.single-chart {
    max-width: 100px;
    justify-content: space-around;
    position: relative;
    transform: rotate(0deg);
    animation-play-state: running;
    margin: 15px auto;
}

.circular-chart {
    display: block;
    margin: 0 auto;
    max-width: 100%;
}

.circle-bg {
    fill: #E2DEE0;
    stroke: #c5c5c5;
    stroke-width: 2.5;
}

.circle {
    fill: none;
    stroke-width: 0;
}

.single-chart.in .circle {
    stroke-width: 2.5;
    animation: progress 1.5s ease-out forwards;
}

@keyframes progress {
    0% {
        stroke-dasharray: 0 100;
    }
}

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

@keyframes circle-rotate-text {
    0% {
        transform: rotate(360deg);
    }
    100% {
        transform: rotate(0deg);
    }
}

.circular-chart.red .circle {
    stroke: #cd201f;
}

.circle-text {
    color: #cd201f;
    position: absolute;
    width: 100%;
    text-align: center;
    line-height: 1em;
    font-size: 30px;
    margin-top: calc(-50% - 0.5em);
}

.single-chart.animated .circle-text {
    animation: circle-rotate-text 1.5s ease;
}

.single-chart.animated {
    animation: circle-rotate 1.5s ease;
}

.single-chart .fa-mobile-wrapper {
    font-size: 40px;
}

/***************************************
 *********** services tiles ************
 ***************************************/

#services .service-tile {
    width: 100%;
    margin-bottom: 7px;
    display: flex;
    flex-direction: column;
    padding-bottom: 25px;
    color: #fff;
}

#services .service-tile:hover {
    filter: brightness(115%);
}

@media (min-width: 768px) {
    /* 2 tiles per row */
    #services .service-tile {
        margin-left: 7px;
        width: calc((100% - 7px) / 2);
    }
    #services .service-tile:nth-child(2n - 1) {
        margin-left: 0;
    }
    #services .service-tile:nth-child(5) {
        margin-left: calc((100% - 7px) / 4);
    }
}

@media (min-width: 992px) {
    /* 3 tiles per row */
    #services .service-tile {
        width: calc((100% - 2 * 7px) / 3);
    }
    #services .service-tile:nth-child(2n - 1) {
        margin-left: 7px;
    }
    #services .service-tile:nth-child(3n - 2) {
        margin-left: 0;
    }
    /* center last row with only 2 items */
    #services .service-tile:nth-child(4){
        margin-left: calc((100% - 2 * 7px) / 6);
    }
}

#services .service-title {
    text-align: center;
    font-weight: bold;
    font-size: 150%;
    line-height: 2;
}

#services .service-logo {
    text-align: center;
}

#services .service-logo + .service-title {
    display: none;
}

#services .service-description {
    flex-grow: 1;
    margin-bottom: 5px;
}

#services .service-description a {
    color: white;
    font-style: italic;
}

#services .service-link {
    color: #fff;
}

#services .service-link:hover {
    font-weight: bold;
}

#services .service-link::before {
    content: '\f0aa';
    font-family: FontAwesome;
    transform: rotate(45deg);
    -ms-transform: rotate(45deg);
    margin-right: 7px;
    margin-left: 0;
    vertical-align: middle;
    display: inline-block;
}

#services .service-link:hover::before {
    font-weight: normal;
}

#service-youtube {
    background-color: #CD322E;
}

#service-soundcloud {
    background-color: #ff9100;
}

#service-peertube {
    background-color: #ff6f00;
}

#service-bandcamp {
    background-color: #17a0c4;
}

#service-mediacccde {
    background-color: #9e9e9e;
}

/***************************************
 ************ download tile ************
 ***************************************/

.tile.tile-bordered {
    padding: 0 15px;
    background: none;
}

.tile.tile-bordered > .row > [class^="col-"],
.tile.tile-bordered > .row.is-flex > [class^="col-"] {
    margin-bottom: 7px;
    margin-left: 0;
    margin-right: 0;
    padding: 10px;
    background: #E2DEE0;
}

.tile.tile-bordered > .row > .col-md-8 {
    padding: 30px 30px 15px 30px;
}

@media (min-width: 768px) and (max-width: 991px) {
    .tile.tile-bordered > .row > .col-sm-6:nth-child(1) {
        margin-right: 4px;
        width: calc(50% - 4px);
    }
    .tile.tile-bordered > .row > .col-sm-6:nth-child(2) {
        margin-left: 3px;
        margin-right: 0;
        width: calc(50% - 3px);
    }
}

.download-version-container {
    text-align: center;
    padding: 15px;
}

.download-version-container .download-version-icon {
    margin-bottom: 15px;
}

.download-version-container .download-version-icon img {
    width: 100%;
    max-height: 10em;
    max-width: 10em;
    margin-left: auto;
    margin-right: auto;
}

.download-version-container .download-version-requirements {
    font-size: small;
}

#download-info-carousel-container {
    height: 100%;
}

#download1 .carousel {
    height: calc(100% - 24px); /* height of indicators */
}

#download1 .carousel .carousel-inner {
    height: 100%;
}

#download1 .carousel .carousel-inner .item {
    padding: 10px 10px 0 10px;
}

#download1 .carousel .carousel-inner .item .col-lg-6 {
    margin-bottom: 0;
}

#download1 .carousel .carousel-control.left,
#download1 .carousel .carousel-control.right {
    display: none;
    color: black;
    opacity: 1;
}

#download1 .carousel .carousel-control.left,
#download1 .carousel:hover .carousel-control.left,
#download1 .carousel .carousel-control.left:hover,
#download1 .carousel .carousel-control.right,
#download1 .carousel:hover .carousel-control.right,
#download1 .carousel .carousel-control.right:hover {
    background: none;
    display: block;
    font-size: 25px;
    bottom: 0;
    top: unset;
}

#download1 .carousel .carousel-indicators {
    position: relative;
    bottom: 6px;
    margin-bottom: 0;
}

#download1 .carousel .carousel-indicators > li {
    border-color: #333;
    background-color: #333;
    width: 8px;
    height: 8px;
}

#download1 .carousel .carousel-indicators > li.active {
    width: 10px;
    height: 10px;
}

#download1-fdroid-newpipe-repo {
    background: #ff9e1f;
    color: white;
}

#download1-fdroid-newpipe-repo h4 {
    color: white;
    font-size: 25px;
}

#download-newpipe-qr-code-container-col {
    display: none;
}

#download-newpipe-qr-code-container {
    width: 100%;
}

#download1-fdroid,
#download1-fdroid-newpipe-repo {
    padding: 30px;
}
#download1-fdroid-newpipe-repo > .row.is-flex > [class*="col-"] {
    margin-bottom: 0;
}
.download-info-content code {
    display: block;
    width: 100%;
    line-break: anywhere;
    margin-top: 5px;
}
#download1-apk-info {
    padding: 10px 30px;
}
.download-info-content ul {
    padding-right: 15px;
}
@media (min-width: 768px) {
    /* align "read more" button with "download NewPipe Legacy" button */
    /* <bad code> */
    #download1 .download-info-container {
        /* 100% - height of heading - padding bottom of .download-version-container */
        height: calc(100% - 29.8px - 15px);
    }
    #download1 .download-info-content {
        height: 100%;
    }
    #download1 .download-info-content .button-small {
        margin-bottom: 5px;
    }
    #download-info-changelog,
    #download-info-help {
        height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }
    /* </bad code> */
}

@media (min-width: 992px) {
    #download-newpipe-qr-code-container-col {
        display: block;
    }
    #download-newpipe-qr-code-container img {
        width: 100%;
        max-width: 12.5em;
    }
    #download1-direct-download {
        order: 1;
    }
    #download1-apk-info {
        order: 2;
    }
    #download1-release-highlights {
        order: 3;
    }
    #download1-installation-help {
        order: 4;
    }
    #download1-fdroid-newpipe-repo {
        order: 5;
    }
    #download1-fdroid {
        order: 6;
    }
    .tri-col {
        width: calc(50% - 7px / 2);
    }
    .tri-col:nth-child(2n - 1) {
        margin-right: 7px !important;
    }
}

@media (min-width: 1200px) {
    #download1 > .row.is-flex > .tri-col {
        width: calc((100% - (2 * 7px)) / 3);
    }
    /*#download1 > .row.is-flex > .tri-col:nth-child(3n - 2),*/
    /*#download1 > .row.is-flex > .tri-col:nth-child(3n - 1) {*/
    /*    margin-right: 7px;*/
    /*}*/
    /* Re-order grid on medium and larger devices */
    /* Just as a British Speaker used to call in a very honourable house:Oooooorder! */
    #download1 > .row.is-flex > #download1-direct-download {
        order: 2;
        margin-right: 7px;
    }
    #download1 > .row.is-flex > #download1-release-highlights {
        order: 1;
        margin-right: 7px;
    }
    #download1 > .row.is-flex > #download1-apk-info {
        order: 3;
    }
    #download1 > .row.is-flex > #download1-direct-download-legacy {
        order: 3;
        margin-right: 7px;
        width: calc(100% / 3 - 7px);
        display: none;
    }
    #download1 > .row.is-flex > #download1-installation-help {
        order: 6;
    }
    #download1 > .row.is-flex > #download1-fdroid {
        order: 5;
        width: calc((100% - 2 * 7px) * 2 / 3 + 7px);
        margin-right: 7px;
    }
    #download1 > .row.is-flex > #download1-fdroid-newpipe-repo {
        order: 4;
        width: calc(100%);
    }
}

/***************************************
 ********** open-source tile ***********
 ***************************************/


#tile-opensource.tile {
    padding-top: 30px;
    padding-bottom: 30px;
}

#tile-opensource .tile-media {
    display: none;
}

#tile-opensource .tile-description {
    margin-left: 0;
}

#tile-opensource .tile-description h4 {
    margin-bottom: 20px;
}

#tile-opensource .button-wrapper {
    text-align: center;
    margin-top: 15px;
    margin-bottom: 0;
}

#tile-opensource .button-wrapper .button:not(:last-child) {
    margin-bottom: 15px;
}

@media (min-width: 768px) {
    #tile-opensource .tile-description h4 {
        text-align: left;
        font-size: 24px;
    }
    #tile-opensource .button-wrapper {
        text-align: left;
    }
}

@media (min-width: 992px) {
    #tile-opensource .tile-media {
        max-width: 300px;
        margin-bottom: 0;
        display: block;
    }
    #tile-opensource .tile-description {
        max-width: calc(100% - 330px);
        margin-right: 15px;
        float: right;
    }
}

#tile-opensource .button.action {
    margin-right: 15px;
}

#tile-like-np > h4 + p {
    /* #tile-free has UL with a line-height of 32px as first element after the heading.
       The first element (p) has a line-height of 24px.
       This fixes the baseline of both tiles. */
    padding-top: 4px;
}

#user-voices.tile {
    text-align: center;
    padding-bottom: 35px;
}

#user-voices h3 {
    font-weight: bold;
}

#user-voices-carousel .carousel-inner .user-thumbnail {
    font-size: 100px;
    min-height: 100px;
    max-height: 100px;
    line-height: 1;
    margin-top: 15px;
}

#user-voices-carousel .carousel-inner .user-thumbnail a {
    height: 100px;
}

#user-voices-carousel .carousel-inner .user-thumbnail img {
    display: inline-block;
    vertical-align: top;
}

#user-voices-carousel .carousel-inner .user-name {
    margin-top: 10px;
}

#user-voices-carousel .carousel-inner .user-name a {
    color: #333;
}

#user-voices-carousel .carousel-inner .user-statement {
    color: #CD201F;
    font-size: 22px;
    margin: 15px 0 15px 0;
}

#user-voices-carousel ol.carousel-indicators {
    position: relative;
    bottom: 0;
}

#user-voices-carousel ol.carousel-indicators > li {
    border-color: #333;
    background-color: #333;
    width: 8px;
    height: 8px;
    border-radius: 100%;
}

#user-voices-carousel ol.carousel-indicators > li.active {
    width: 10px;
    height: 10px;
}

#user-voices-carousel .carousel-control {
    top: -26px;
    /* height of h3 heading to center controls */
    background: none;
    opacity: 0;
    transition: opacity 0.2s ease-in;
    color: #333;
}

html.touch #user-voices-carousel .carousel-control,
#user-voices:hover #user-voices-carousel .carousel-control {
    opacity: 1;
}

/***************************************
 *********** donate banner *************
 ***************************************/

#main-page #donate {
    border-top: 3px solid #CD201F;
    padding: 100px 0 130px;
    background: url("/img/bg_rectangles.png") center center;
    background-size: cover;
    color: white;
}

#main-page #donate .button.action {
    border: 3px solid white;
}

#main-page #donate .col-md-4 {
    text-align: center;
}

#main-page #donate .col-md-4:first-child h3 {
    margin-bottom: 45px;
}

#main-page #donate .col-md-4:last-child h3 {
    margin-top: 45px;
}

@media (min-width: 992px) {
    #main-page #donate .col-md-4:first-child h3 {
        text-align: right;
        margin: 20px 0 10px;
    }
    #main-page #donate .col-md-4:last-child h3 {
        text-align: left;
        margin: 20px 0 10px;
    }
}
