/* Copyright (c) 2018 Dory
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */

body {
    background-color: #222222;
    color: #DDDDDD;
    padding-bottom: 8px;
    font-family: sans-serif;
    margin: 0px;
}
a {
    text-decoration: none;
    color: inherit;
}
a:hover {
    background-color: #555555;
}
td, th {
    padding: 0;
}

/* ========================== Landing page ============================ */
#pagetitle {
    display: block;
    margin: 0px 0px 10px 0px;
    padding: 7px 15px 5px 15px;
    background-color: #333333;
    box-shadow: 2px 2px 8px black;
}
#apptitle {
    font-size: larger;
    font-weight: bold;
    margin: 0px 10px;
}
#appsubtitle {
    font-size: smaller;
    font-weight: bolder;
    font-style: italic;
    margin: 0px 8px;
}

.series {
    box-sizing: border-box;
    display: block;
    text-decoration: none;
    width: 400px;
    height: 200px;
    padding: 5px;
    margin: 5px 15px;
    float: left;
}
.series a {
    display: block;
}
.series .cover img, #series-view .cover img {
    height: 180px;
    float: left;
    border: 2px solid gray;
    margin-right: 10px;
    box-shadow: 1px 1px 3px black;
}
.series .field, #series-view .field {
    text-shadow: 1px 1px 3px black;
    padding: 2px 5px 2px 5px;
}
.series .title {
    border-bottom: 2px solid gray;
    font-weight: bold;
    font-size: larger;
    font-style: normal;
}
.series a {
    font-style: italic;
    font-weight: bold;
}
.series .author, .series .latest, .series .latest-time, .series .buy,
.series .status, .series .progress, .series .begin {
    font-size: small;
    display: block;
}
.series .author {
    margin-bottom: 10px;
}
.series .latest-time {
    font-size: smaller;
    font-weight: normal;
    font-style: italic;
    color: #AAAAAA;
}
.series .progress, .series .begin {
    margin-top: 10px;
}
.series .author:before, #series-view .author:before {
    content: "Artist: ";
    font-style: italic;
    font-size: smaller;
    font-weight: normal;
    color: #999999;
}
.series .buy:before {
    content: "Buy from ";
    font-style: italic;
    font-size: smaller;
    font-weight: normal;
    color: #999999;
}
.series .status:before {
    content: "Status: ";
    font-style: italic;
    font-size: smaller;
    font-weight: normal;
    color: #999999;
}
.series .latest:before {
    content: "Latest: ";
    font-style: italic;
    font-size: smaller;
    font-weight: normal;
    color: #999999;
}
.series .progress:before, .series .begin:before {
    content: "Read: ";
    font-style: italic;
    font-size: smaller;
    font-weight: normal;
    color: #999999;
}

.series .cover:hover + .title, .series .title:hover, .series .latest:hover {
    background-color: #555555;
}

/* =========================== Series view ============================ */
#series-view #series-info {
    margin: 5px 5px 10px 10px;
}
#series-view .cover img {
    height: 50px;
}
#series-view .title {
    border-bottom: 2px solid gray;
    font-weight: bold;
    font-size: larger;
}
#series-view .volume-download {
    font-size: small;
    font-style: italic;
}
#series-view .volume-download a {
    color: #999999;
}
#series-view .author {
    font-size: small;
    display: block;
}
#series-view #vol-list {
    clear: both;
    padding: 5px;
    margin-left: 5px;
    margin-right: 5px;
}
.volume {
    clear: both;
    padding: 10px;
}
.volume-cover-large {
    width: 120px;
    border: 1px solid gray;
    margin: 0px;
    box-shadow: 1px 1px 3px black;
}
.volume-cover-small {
    display: none;
    height: 50px;
    border-top: 1px solid gray;
    border-left: 1px solid gray;
    border-right: 1px solid gray;
    margin: 0px 7px 0px 0px;
}
.volume .title {
    border-bottom: 1px solid gray;
    font-weight: bold;
    font-size: medium;
    padding: 5px 10px 2px 20px;
    text-shadow: 1px 1px 3px black;
}
.volume .chap-list {
    padding-left: 10px;
    padding-top: 5px;
}
.volume .chapter {
    font-size: small;
    position: relative;
    top: 0px;
    left: 0px;
}
.volume .chapter a {
    display: inline-block;
    padding: 2px 10px 2px 10px;
}
.volume .chapter a + .tooltip {
    visibility: hidden;
    opacity: 0;
    transition: opacity 1s;
    max-height: 100px;
    background-color: #111111;
    color: #fff;
    text-align: center;
    padding: 5px 5px;
    margin-left: 15px;
    border-radius: 6px;

    position: absolute;
    bottom: -10px;
    z-index: 1;
}
.volume .chapter a + .tooltip::after {
    content: " ";
    position: absolute;
    bottom: 16px;
    right: 100%;
    margin-top: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: transparent black transparent transparent;
}
.volume .chapter a:hover + .tooltip {
    visibility: visible;
    opacity: 1;
}
.volume .chapter a + .tooltip img {
    max-width: 120px;
    max-height: 180px;
    display: none;
}
.volume .chapter a:hover + .tooltip img {
    max-width: 120px;
    max-height: 180px;
    display: inherit;
}

/* ========================== Chapter view ============================ */
#chapter-view {
    padding: 0px 5px 5px 5px;
}
#chapter-info {
    padding-left: 10px;
}
#series-thumb, #chapter-thumb {
    max-height: 21px;
    vertical-align: top;
    border: 1px solid gray;
    box-sizing: border-box;
}
#series-title a {
    font-size: large;
    font-weight: bold;
    padding: 1px 8px;
    display: inline-block;
}
#chapter-title {
    font-size: smaller;
    font-weight: bolder;
    font-style: italic;
    margin: 0px 6px;
    display: inline-block;
}
#pagenum {
    font-size: small;
    margin: 0px 6px;
    display: inline-block;
}
#thumbbar {
    display: none;
    margin: 1px 3px 6px 3px;
}
.thumbbox {
    height: 100px;
    display: inline-block;
    vertical-align: top;
    margin: 1px;
}
.thumbbox img {
    border: 2px solid gray;
    max-width: 100%;
    max-height: 100%;
    box-sizing: border-box;
    margin: auto;
}
.thumbbox[data-current=yes]:after, .thumbbox:hover:after {
    background: #333;
    background: rgba(0,0,0,.7);
    border-radius: 5px;
    color: #fff;
    content: attr(data-id);
    padding: 3px 10px;
    position: relative;
    top: -33px;
    left: 10px;
    width: 30px;
    height: 20px;
    text-align: center;
    z-index: 1;
    font-weight: bold;
    text-decoration: none;
    display: block;
}
#navbar {
    margin: 3px;
}
.navbtn {
    border: 2px solid gray;
    display: inline-block;
    padding: 2px;
    font-size: small;
    text-decoration: none;
    color: inherit;
    margin: 1px;
    cursor: pointer;
}

#pageview {
    box-sizing: border-box;
    width: 100%;
    text-align: center;
}
#pageview #img-container {
    display: inline-block;
    position: relative;
    left: 0px;
    top: 0px;
    width: 1000px;
}
#pageview img {
    max-width: 1800px;
    box-shadow: 0 0 15px black;
}
#pageview img.preview {
    width: 100%;
}

#pageview a#left:focus, #pageview a#right:focus {
    outline: none;
}
#pageview #left {
    position: absolute;
    top: 0;
    left: 0;
    right: 65%;
    bottom: 0;
}
#pageview #left:hover {
    background-image: url('left.png');
    background-repeat: no-repeat;
    background-position: left 15px center;
}
#pageview #right {
    position: absolute;
    top: 0;
    left: 65%;
    right: 0;
    bottom: 0;
}
#pageview #right:hover {
    background-image: url('right.png');
    background-repeat: no-repeat;
    background-position: right 15px center;
}
#pageview #right:hover, #pageview #left:hover {
    background-color: inherit;
}
#preloader {
    height: 1px;
}
#preloader img {
    width: 1px;
    height: 1px;
    opacity: 0.01;
}

/* ===================== small screen width overrides ====================== */
@media handheld, (max-width: 900px), (max-device-width: 900px) {
    #pageview #img-container, #pageview img {
        width: 100% !important;
    }
}
/* =========================== Mobile overrides ============================ */
@media handheld, (max-width: 700px), (max-device-width: 700px) {
    #pagetitle {
        margin-bottom: 5px;
    }
    .series {
        float: none;
        width: 100%;
        margin-left: 0px;
        margin-right: 0px;
        padding: 10px;
    }
    .series .cover img {
        width: 120px !important;
        height: inherit;
    }

    /* --- */
    #series-view #series-info {
        margin-left: 3px;
    }
    #vol-list {
        margin-left: 0px !important;
        margin-right: 0px !important;
        padding: 0px !important;
    }
    .volume {
        padding: 6px;
    }
    .volume-cover-large {
        display: none;
    }
    .volume-cover-small {
        display: block;
    }
    .volume .title {
        padding: 0px;
    }
    .volume .chap-list {
        padding-left: 0px;
    }
    .volume .chapter:not(:last-child) {
        border-bottom: 1px solid #303030;
    }
    .volume .chapter a {
        padding: 4px 3px 4px 5px;
    }
    .volume .chapter a + .tooltip {
        display: none !important;
    }

    /* --- */
    #chapter-view {
        padding: 2px;
    }
    #navbar {
        margin-left: 0px;
        margin-right: 0px;
    }
    #chapter-info {
        padding-left: 1px;
    }
    #series-thumb, #chapter-thumb {
        display: none;
    }
    #series-title a, .navbtn {
        padding-left: 5px;
        padding-right: 5px;
        padding-bottom: 1px;
        padding-top: 3px;
        background-color: #111111;
        border: 1px solid gray;
        font-size: small;
    }
    #chapter-title {
        margin-left: 0px;
        margin-right: 0px;
    }
    #pagenum {
        margin-left: 1px;
        margin-right: 0px;
    }
    #pageview #left:hover, #pageview #right:hover {
        background-image: none;
    }
}
