/*
 * Body
 */

* {
    margin: 0;
    padding: 0;
}

body {
    /* min-width: 800px; */
}

ol {
    margin-left: 1rem;
}

/*
 * Basic structure
 */

#header {
    background: white;
    margin-bottom: 2rem;
    padding: 0;
    width: 100%;
}

.head {
    margin-bottom: 0.5rem;
}

#content {
    margin: auto;
    margin-top: 2rem;
    /* min-width: 720px; */
    overflow: hidden;
    width: 90%;
}

#footer {
    margin-top: 2rem;
    padding: 1em 0;
    text-align: center;
    width: 100%;
}

/* Logo */
#logo {
    background: url("/static/common/logos/bookish.png") no-repeat center;
    background-size: contain;
    width: 250px;
    height: 50px;
    margin: 0 0 0 10%;

    a {
        border: none;
        display: block;
        width: 100%;
        height: 50px;
    }

    a:hover {
        border: none;
    }
}

/* Content container */
.box {
    background-color: white;
    /* border: 2px solid rgba(0, 0, 0, 0.01); */
    margin-bottom: 1rem;
}

/* Main column and sidebar */
@mixin column-flex($width) {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    max-width: $width;
    min-height: 0;
    padding: 0 0.25rem;
}

.main_column {
    @include column-flex(65%);

    table {
        margin-bottom: 1rem;
    }
}

.sidebar {
    @include column-flex(35%);
    float: right;
}

/* Links */
div.linkbox {
    text-align: center;
    padding: 0.5rem;
}

.pad {
    padding: 1rem;

    h3,
    h4 {
        margin-top: 0;
        padding-top: 0;
    }
}

/**
 * Aside elements
 */
aside {
    max-width: 66%;

    p {
        text-align: center;
    }

    /**
     * "Please consult the Upload Rules"
     * admonishment on torrent_form.class.php.
     */
    &.upload_notice {
        @include transparent-border($R: 255, $A: 0.5);
        margin: 1rem auto;
        text-align: center;
    }

    /* Announce and source */
    &.announce_source {
        margin: 1rem auto;
    }

    /* Torrent upload error */
    &.upload_error {
        color: red;
        margin: 2rem auto;
        font-size: larger;
    }
}

/* Misc */
.torrents_nomatch {
    margin-top: 1rem;
}

.vertical_space {
    margin-bottom: 1rem;
}

/* Textarea preview button */
.preview_button {
    margin-top: 1rem;
}

/* Torrents page */
.show_torrents {
    width: 21px;
    height: 28px;
    background: url("/static/common/forums/show2.png") no-repeat center center;
}

.hide_torrents {
    width: 21px;
    height: 28px;
    background: url("/static/common/forums/hide2.png") no-repeat center center;
}

.show_torrents_link {
    border: none;
    width: 28px;
    height: 28px;
    display: block;
    cursor: pointer;
}

.filter_torrents {
    background: white;
    margin: auto;
    width: 75%;

    .submit {
        vertical-align: middle;
    }
}

#content form.search_form + .torrent_table {
    margin-top: 20px;
}

#content form.search_form .submit {
    text-align: center;
}

.cat_list tr td {
    border: none;
}

.torrent_table tr {
    /* vertical-align: top; */
    vertical-align: middle;
}

.torrent_table .number_column {
    text-align: center;
}

.torrent_table,
.torrent_table td {
    border: none;
}

/* Text elements */
h1,
h2,
h3,
h4 {
    margin: 0.5em 0;
    font-weight: bold;
}

p {
    margin: 1em 0.5rem;
}

li {
    margin: 0.5em 2rem;
}

.torrent_title {
    font-size: larger;
}

/* Permissions page */
.permissions {
    width: 90%;
    margin: 1em auto;
}

.permission_head {
    width: 50%;
    margin: 1em auto;
}

.permission_container {
    margin: auto;
    float: left;
    max-width: 33%;
    padding: 1rem;

    input {
        margin: 0px 3px 5px 0px;
        vertical-align: top;
    }
}

/* Invite tree */
ul .invitetree {
    margin: 0px 0px 0px 25px;
}

.invitetree li {
    list-style: none;
    margin: 10px 2px;
}

/* User options */
.user_options .options_list li {
    margin: 0;
}

/* Store, badges, and BP */
#comm_badge_tr .badge_icon,
#user_badge_edit_tr .badge_icon {
    margin-right: 0.1rem;
    margin-left: 0;
    white-space: nowrap;
}

.store_table .badge_icon {
    display: inline-block;
    width: 4rem;
    /* width: 16px; */
}

.store_table .badge_icon img {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.point_gift_box p {
    margin: 7px 2px 0px;
}

.point_gift_box input[type="text"],
.point_gift_box textarea {
    width: 100%;
    box-sizing: border-box;
}

/* Polls */
.left_poll {
    display: none;
    width: 2px;
    height: 9px;
    float: left;
    margin: 0px;
    padding: 0px;
}

.center_poll {
    height: 0.75rem;
    background: $lb50;
    border-radius: 0;
    float: left;
    margin: 0.25rem 0;
    padding: 0;
}

.right_poll {
    display: none;
    width: 2px;
    height: 9px;
    float: left;
    margin: 0px;
    padding: 0px;
}

/* Curtain? */
.curtain {
    position: fixed;
    top: 0%;
    left: 0%;
    width: 100%;
    height: 100%;
    background: black;
    z-index: 1001;
    -moz-opacity: 0.8;
    opacity: 0.8;
    filter: alpha(opacity=80);
}

/* Lightbox */
.lightbox {
    position: fixed;
    text-align: center;
    top: 5%;
    left: 5%;
    width: 90%;
    height: 90%;
    padding: 0;
    z-index: 1002;
    overflow: auto;

    img {
        background: white;
    }
}

/* BibTeX overflow partial fix */
.torrentdetails {
    * {
        box-sizing: border-box;
        max-width: inherit;
    }

    blockquote {
        max-width: 90%;
        margin: 1rem 5%;
    }

    pre {
        max-width: 100%;
    }

    /*
    .spoilerContainer,
    .hideContainer {
    }
    */
}

/* User and torrent stats */
.chart {
    max-height: 30rem;
}
