/* THEMES CHOOSER*/

/*#ebook-data, #main, body {
overflow-y: hidden;
}*/

.theme {
    height: 100%;
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
}

#theme-chooser {
    position: fixed;
    width: 100%;
    height: 100%;
    /*background-color: #E9E9E9;*/
    background-color: #fff;
    padding: 78px 40px 40px 40px;
    left: 0;
    top: 0;
    z-index: 100;
    overflow-y: auto;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

#theme-chooser-content {
    max-width: 1000px;
    width: 100%;
    display: block;
    margin: auto;
    position: relative;
    width: 100%;
}

#theme-chooser-header {
    position: fixed;
    top: 79px;
    /*background-color: rgba(233,233,233,0.85);*/
    background-color: rgba(255,255,255,0.85);
    width: 100%;
    max-width: 1000px;
    z-index: 10000;
    height: 70px;
}

#theme-chooser h2 {
    text-align: center;
    display: block;
    height: 3em;
    line-height: 3em;
    vertical-align: middle;
    font-size: 1.6em;
    font-weight: 100;
    text-transform: uppercase;
}

#theme-chooser ul#theme-tabs { /* CHANGED - @new */
    list-style-type: none;
    list-style-position: inside;
    padding: 22px 10px;
}

ul#theme-tabs li { /* CHANGED - @new */
    display: inline-block;
    text-transform: uppercase;
    vertical-align: middle;
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 0.05em;
    color: #aaa;
    cursor: pointer;
    margin-right: 16px;
}

ul#theme-tabs li.current {
    color: rgb(78,78,78);
    cursor: default;
}

ul#theme-tabs li:last-of-type {
    cursor: default;
}

ul#theme-tabs button.new-theme { /* CHANGED - @new */
    vertical-align: text-bottom;
    min-width: 100px;
    margin-left: 8px;
}

#themes-container,
.themes-container {
    max-width: 750px;
    width: 100%;
    height: auto;
    overflow-y: auto;
    display: inline-block;
}

#themes-container {
    margin-top: 70px;
}

.themes-container {
    margin-top: 16px;
}

#theme-preview-container,
.theme-preview-container {
    width: 250px;
    display: inline-block;
    /*background-color: #6d6e71;*/
    background-color: #F0F0F0;
    color: #666;
    vertical-align: text-top;
    position: fixed;
    margin-top: 70px;
    height: 78%;
    overflow-y: auto;
    border: 10px solid #F0F0F0;
    border-radius: 4px; /* @new */
    /*pointer-events: none;  @new */
    white-space: normal; /* @new */
    bottom: 10px;
    top: 80px;
    overflow-y: auto;
    height: auto;
    pointer-events: auto;
}

#theme-preview-container div.active-label,
.theme-preview-container div.active-label {
    width: 100%;
    text-align: center;
    text-transform: uppercase;
    font-weight: bold;
    color: rgb(232, 167, 36);
}

#theme-preview-content {
    overflow-y: auto;
}

#themes-container section.themes,
.themes-container section.themes {
    display: none;
}

.themes-container section.themes {
    margin-left: -8px;
    margin-right: -8px;
}

#themes-container section.themes.current {
    display: block;
}

.themes-container section.themes.current {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
}

#themes-container section.themes div.theme-container,
.themes-container section.themes div.theme-container > div { /* CHANGED - WRITE 4.0 */
    width: 356px;
    height: 300px;
    display: inline-block;
    margin: 0 6px 16px 6px;
    background-color: #fff;
    border: 1px solid #d9d9d9;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 1px;
}

.themes-container section.themes div.theme-container > div {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
}

.themes-container section.themes div.theme-container {
    margin-left: 0;
    margin-right: 0;
    padding-left: 8px;
    padding-right: 8px;
}

#themes-container .fa-check,
.themes-container .fa-check {
    position: absolute;
    top: 10px;
    right: 10px;
    color: rgb(232,167,36);
    display: none;
    font-size: 1.4em;
    border: 2px solid rgb(232,167,36);
    padding: 5px 4px 3px 4px;
    border-radius: 50%;
}

#themes-container .theme-container.active .fa-check,
.themes-container .theme-container.active .fa-check {
    display: block;
}

.theme_page {
    width: 210px;
    height: 250px;
    background-color: #fff;
    -webkit-box-shadow: 2px 2px 2px rgba(0,0,0,0.4);
    box-shadow: 2px 2px 2px rgba(0,0,0,0.4);
    display: block;
    margin: 10px;
    position: relative;
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
}

#theme-chooser .close_dialog { /* CHANGED - @new */
    top: 20px;
    /*color: rgb(78, 78, 78);*/
    color: #000;
    font-size: 15px;
    padding: 0 5px;
    margin: 0;
}

#theme-preview-container .theme-details {
    max-width: 210px;
    display: block;
    margin: 1em auto;
}

#theme-preview-container .theme-details h3 {
    font-size: 1.8em;
    font-weight: 100;
    margin-bottom: 0.5em;
    text-transform: capitalize;
}

#theme-preview-container .medium-button {
    border-radius: 10px;
    height: 28px;
    /*padding: 4px;*/
    width: 210px;
    display: block;
    margin: auto;
    text-transform: uppercase;
    font-weight: 300;
    font-size: 1em;
    text-align: center;
    cursor: pointer;
    display: none;
    pointer-events: auto;
    line-height: 28px;
    letter-spacing: 0.05em;
}

#theme-preview-container .activate-theme.medium-button {
    background-color: #fff;
    border: 2px solid rgb(232, 167, 36);
    /*color: rgb(68,68,68);*/
    color: #000;
    line-height: 24px;
    font-weight: bold;
    letter-spacing: 0.05em;
}

#theme-preview-container .preview_theme.medium-button,
#theme-preview-container .edit_theme.medium-button,
#theme-preview-container .customize_theme.medium-button {
    /*background-color: rgb(78,78,78);*/
    background-color: #000;
    color: #fff;border: 0;
    margin-top: 10px;
    margin-bottom: 10px;
    font-weight: 600;
    pointer-events: auto;
}

#themes-container div.theme-container.active .fa-check,
.themes-container div.theme-container.active .fa-check {
    display: inline;
}

.theme-container .theme {
    width: 338px;
    height: 240px;
    background-position: 50% -25px;
    display: block;
    margin: auto;
    margin-bottom: 8px;
}

.themes-container .theme-container .theme {
    width: 100%;
}

.theme-container .theme-name { /* CHANGED - @new */
    background-color: #F0F0F0;
    padding: 0 18px;
    width: 100%;
    height: 50px;
    text-transform: uppercase;
    font-size: 0.8em;
    font-weight: 300;
    letter-spacing: 0.1em;
    text-align: left;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
}

div.theme_page div.preview_theme{
    position: absolute;
    width: 100%;
    text-align: center;
    display: none;
    font-size: 14px;
    background-color: rgba(255,255,255,0.6);
    height: 100%;
    top: 0;
}

div.theme_page:hover div.preview_theme,
#theme-preview-content:hover div.preview_theme{
    display:block;
}

div.theme_page div.preview_theme span,
.small-button { /* CHANGED - @new */
    text-transform: uppercase;
    display: inline-block;
    min-width: 170px;
    height: 26px;
    line-height: 2.1em;
    /*background-color: rgb(78,78,78);*/
    background-color: #000;
    color: #fff;
    font-weight: bold;
    font-size: 0.8em;
    padding: 1px;
    padding-left: 6px;
    padding-right: 6px;
    border-radius: 8px;
    -webkit-border-radius: 8px;
    -moz-border-radius: 8px;
    -ms-border-radius: 8px;
    cursor: pointer;
}

.small-button span.fa {
    min-width: auto;
    height: auto;
    line-height: auto;
    background-color: transparent;
    font-weight: auto;
    padding: 0;
    border-radius: 0;
    cursor: auto;
}

div.theme_page div.preview_theme span{
    margin-top: 60%;
}

.theme-container .preview-button {
    font-size: 1.4em;
    background-color: transparent;
    color: rgb(74,74,74);
    opacity: 0.5;
    width: 26px;
}

.theme-container .preview-button:hover {
    opacity: 1;
}

.update-spinner {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    text-align: center;
    background-color: rgba(255,255,255,0.8);
}

.update-spinner .fa.fa-spin {
    position: absolute;
    text-align: center;
    left: 50%;
    top: 50%;
    margin-left: -0.5em;
    margin-top: -0.5em;
}

.update-spinner .update-message {
    position: absolute;
    width: 100%;
    left: 0;
    text-align: center;
    top: 50%;
    margin-top: 2em;
    font-weight: bold;
    font-style: italic;
    color: #888;
}

#my_themes-themes .theme {
    background-position-y: 0;
}

/* NEW THEME DIALOG */

#new-theme-dialog .theme-selector p{
    margin-bottom: 1em;
}

#new-theme-dialog .create-button {
    margin-top: 2em;
}

#new-theme-name.required {
    border: 1px solid red;
}

/* RWD */

.theme-actions {
    position: absolute;
    right: 4px;
    bottom: 11px;
}

.theme-actions .button {
    margin-right: 8px;
    line-height: 22px;
}

.theme-actions button.theme-action {
    font-size: 22px;
    background-color: transparent;
    color: rgb(74,74,74);
    opacity: 0.5;
    width: 36px;
    cursor: pointer;
}

.theme-actions button,
.theme-actions .button.small-button {
    display: none;
}

.theme-actions button.preview-button {
    display: inline-block;
}

.theme-actions button.theme-action:hover {
    opacity: 1;
}

.theme-container .theme-details.visible + .theme-actions .info-button {
    color: rgb(232,167,36);
    opacity: 1;
}

.theme-container .theme-active-label {
    font-size: 14px;
    font-weight: bold;
    line-height: 22px;
    color: rgb(232,167,36);
    text-transform: uppercase;
    margin-right: 8px;
    display: none;
}

.theme-container .activate-button {
    display: inline-block;
}

.theme-container.active .activate-button {
    display: none !important;
}

.theme-container .theme-details {
    background-color: #6d6e71;
    color: #fff;
    font-weight: normal;
    height: 240px;
    position: absolute;
    top: 4px;
    right: 4px;
    left: 4px;
    padding: 40px;
    display: none;
}

.theme-container .theme-details.visible {
    display: block;
}

#themes-container .theme-container .theme-actions .fa-check,
.themes-container .theme-container .theme-actions .fa-check{
    display: inline-block;
    font-size: 18px;
    border: 0px none;
    position: static;
    padding: 4px 0;
}

.theme-container .theme-details h3 {
    font-size: 1.8em;
    font-weight: 100;
    margin-bottom: 0.5em;
    text-transform: capitalize;
}

.theme-container .theme-details .theme-description {
    white-space: normal;
}

.theme-container.selected {
    color: rgb(232,167,36);
    font-weight: bold;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    border-top: 1px solid rgb(232,167,36) !important;
    border-bottom: 1px solid rgb(232,167,36) !important;
    border-left: 1px solid rgb(232,167,36) !important;
    border-right: 1px solid rgb(232,167,36) !important;
}

.theme-container.selected .theme-name { /* @new */
    color: rgb(78,78,78);
}

.theme-container .theme .activate-button { /* @new */
    float: right;
    margin: 6px;
    min-width: 70px;
}

/* MEDIA QUERY */


@media only screen and (max-width: 480px) {

    #theme-preview-container {
        display: none;
    }

    #themes-container,
    .themes-container {
        width: 100%;
        margin-top: 20px;
    }

    #themes-container section.themes div.theme-container,
    .themes-container section.themes div.theme-container > div {
        max-width: 300px;
        display: block;
        margin-left: auto;
        margin-right: auto;
        height: 300px;
    }

    .theme-container .theme {
        height: 240px;
    }

    .theme-actions {
        display: -webkit-box;
        display: -ms-flexbox;
        display: flex;
    }

    .theme-actions .button.small-button {
        min-width: 50px;
    }

    .theme-container .theme-name {
        padding: 7px 180px 5px 8px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .theme-actions button,
    .theme-actions .button.small-button,
    .theme-container.active .theme-active-label {
        display: inline-block;
    }

    .theme-actions .button { /* @new */
        line-height: 20px;
    }

    .theme-actions button.theme-action { /* @new */
        margin-left: 8px;
    }

    #theme-preview-container { /* @new */
        position: fixed;
        display: none;
        z-index: 1000000;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
        pointer-events: auto;
        opacity: 0;
    }

    #theme-preview-container .close_dialog { /* @new */
        color: #dedede;
    }

    #theme-preview-container .theme-details { /* @new */
        margin-top: 50px;
    }

}

@media only screen and (min-width: 481px) { 

    #themes-container section.themes div.theme-container,
    .themes-container section.themes div.theme-container {
        cursor: pointer;
    }

    .theme-container .activate-button {
        display: none;
    }

    #theme-preview-container .close_dialog {
        display: none;
    }

}

@media only screen and (min-width: 460px) and (max-width: 600px) { 

    #themes-container section.themes div.theme-container {
        width: calc(100% - 10px);  /* TO BE FIX VIA JAVASCRIPT */
        display: block;
    }

}

@media only screen and (min-width: 481px) and (max-width: 600px) { 

    .themes-container section.themes div.theme-container {
        width: 50%;
    }

}


@media only screen and (max-width: 600px) { /* @new */

    #theme-chooser {
        padding-top: 120px
    }

}

@media only screen and (min-width: 481px) and (max-width: 740px) { 


    #themes-container section.themes div.theme-container,
    .themes-container section.themes div.theme-container > div {
        height: 220px;
    }

    .theme-container .theme {
        height: 160px;
    }

}

@media only screen and (max-width: 800px) { /* @new */

    #theme-chooser {
        z-index: 1000;
        top: 79px;
        height: calc(100% - 79px);
        padding-top: 42px !important;
    }

    #theme-chooser ul#theme-tabs {
        padding: 0 10px;
    }

    #theme-chooser-header {
        height: 42px;
    }

    ul#theme-tabs li {
        height: 42px;
        line-height: 42px;
    }

    #theme-chooser .close_dialog {
        top: 4px;
        font-size: 18px;
    }

    #themes-container, 
    #theme-preview-container,
    .themes-container,
    .theme-preview-container {
        margin-top: 4px;
    }
    
    #theme-preview-container, 
    .theme-preview-container {
        bottom: 10px;
        top: 122px;
        overflow-y: auto;
        height: auto;
        pointer-events: auto;
    }

}

@media only screen and (min-width: 741px) and (max-width: 800px) { 

    #themes-container section.themes div.theme-container,
    .themes-container section.themes div.theme-container > div {
        height: 260px;
    }

    .theme-container .theme {
        height: 200px;
    }

}

@media only screen and (min-width: 601px) and (max-width: 960px) { 

    #themes-container section.themes div.theme-container {
        width: calc(50% - 10px);  /* TO BE FIX VIA JAVASCRIPT */
    }

    .themes-container section.themes div.theme-container {
        width: 50%;
    }
}

@media only screen and (max-width: 960px) {

    #theme-chooser-header {
        left: 10px;
        right: 10px;
    }

    #theme-chooser {
        padding-left: 10px;
        padding-right: 10px;
    }

}

@media only screen and (min-width: 961px) and (max-width: 1100px) {

    #theme-chooser-header {
        left: 40px;
        right: 40px;
    }

    #themes-container section.themes div.theme-container {
        width: calc(33.333% - 10px);  /* TO BE FIX VIA JAVASCRIPT */
    }

}

@media only screen and (min-width: 481px) and (max-width: 1100px) {

    #themes-container {
        max-width: 100%;
        width: calc(100% - 250px);  /* TO BE FIX VIA JAVASCRIPT */
    }

    #themes-container section.themes div.theme-container {
        margin-left: 0;
        margin-right: 4px;
    }

}

@media only screen and (min-width: 801px) and (max-width: 1100px) {


    #themes-container,
    #theme-preview-container {
        margin-top: 0;
        bottom: 10px;
        top: 150px;
        overflow-y: auto;
        height: auto;
        pointer-events: auto;
    }

    #theme-chooser {
        padding-top: 149px;
    }

    #theme-chooser ul#theme-tabs {
        padding: 13px 10px;
    }

}

@media only screen and (max-width: 1100px) {

    #theme-chooser-header {
        width: auto;
        max-width: 100%;
    }


    #theme-chooser-content {
        max-width: 100%;
    }

    .theme-container .theme {
        width: 100%;
    }

    ul#theme-tabs li {
        height: 44px;
        line-height: 44px;
        font-size: 14px;
        font-weight: bold;
    }

    #theme-chooser .close_dialog {
        padding-right: 0;
    }

    .close_dialog span {
        display: block;
    }

    ul#theme-tabs button.new-theme {
        vertical-align: baseline;
        min-width: 50px;
    }

}
