
// Look! responsiveish!
@media screen and (max-width: 1200px) {
    #documents {
        .pagination {
            li.next a:before {
                content: 'Next ';
            }
            li.prev a:after {
                content: ' Prev';
            }
        }
    }
}

@media screen and (max-width: 860px), screen and (max-height: 860px) {
    .masthead.epic.welcome {
        padding: 40px 20px;
        h1 { font-size: 90px; }
        h2 { font-size: 60px; }
        p  { font-size: 24px; }
    }
}

@media screen and (max-width: 860px) {
    .masthead {
        padding: 40px 20px;
        margin-right: -20px;
        margin-left:  -20px;
        &.epic {
            padding: 40px 20px;
            h1 { font-size: 90px; }
            h2 { font-size: 60px; }
            p  { font-size: 24px; }
        }
    }

    .modal-editor {
        left:  20px;
        right: 20px;
        width: auto;
        margin-left: 0;
    }
    table {
        .table-condensed;
        td.action-column {
            padding-top: 2px;
        }
    }
    #documents {
        .pagination {
            li.prev a:after, li.next a:before {
                content: '';
            }
        }
    }

    #keyboard-shortcuts {
        width: 440px;
        margin-left: -220px;
    }
}

@media only screen and (max-width: 480px), only screen and (max-height: 680px) {
    .masthead.epic.welcome {
        h1 { font-size: 60px; }
        h2 { font-size: 40px; }
        p  { font-size: 20px; }
    }
}

@media only screen and (max-width: 480px) {
    .container {
        padding: 0;
    }

    // navvvv
    .navbar {
        .nav {
            float: none;
        }

        .btn.search {
            display: inline-block;
            z-index: 10;
        }
        body.section-documents &, body.section-document & {
            form {
                display: none; // deal with this guy later
                height: 0;
                overflow: hidden;
            }
        }

        .brand {
            display: none;
            body.section-servers &,
            body:not(.has-section) & {
                display: block;
                text-align: center;
                float: none;
            }
        }

        .nav-section {
            position: absolute;
            background: none;

            .dropdown-menu {
                display: none;
            }

            body.section-servers &.servers,
            body.section-servers &.server,
            body.section-servers &.database,
            body.section-servers &.collection,
            body.section-databases &.database,
            body.section-databases &.collection,
            body.section-collections &.servers,
            body.section-collections &.collection,
            body.section-documents &.servers,
            body.section-documents &.server,
            body.section-document &.servers,
            body.section-document &.server {
                display: none;
            }

            // "previous" button
            body.section-databases &.servers,
            body.section-collections &.server,
            body.section-documents &.database,
            body.section-document &.database {
                display: inline-block;
                float: left;
                padding: 16px 0 0 2px;
                z-index: @zindexFixedNavbar + 2;
                > a.dropdown-toggle, > a {
                    .btn;
                    .back-button;
                    .transition(none);
                    z-index: 10;
                    overflow: visible;
                }
                &.dropdown .dropdown-toggle {
                    padding: 4px 14px;
                }
            }

            // "current" section heading
            body.section-databases &.server,
            body.section-collections &.database,
            body.section-documents &.collection,
            body.section-document &.collection {
                width: 12em;
                left:  50%;
                margin-left: -6em;
                padding-top: 20px;
                display: inline-block;
                float: none;
                text-align: center;
                z-index: @zindexFixedNavbar + 1;
                > a {
                    font-family: "Rokkitt", serif;
                    font-size:   24px;
                    line-height: 24px;
                }
                .dropdown-toggle {
                    padding: 0;
                }
            }
        }
    }

    .masthead {
        text-align: center;
        .container {
            padding: 0 20px;
        }
        &.epic {
            h1 { font-size: 60px; }
            h2 { font-size: 40px; }
            p  { font-size: 20px; }
        }
    }

    .app-section {
        border: none;
        .border-radius(0);
    }

    /* Force table to not be like tables anymore */
    table, thead, tbody, th, td, tr {
        display: block;
    }

    table {
        border: none;

        /* Hide table headers (but not display: none;, for accessibility) */
        thead tr {
            position: absolute;
            top: -9999px;
            left: -9999px;
        }

        tr {
            border: 1px solid #DDD;
            border-bottom: none;
            &:last-child {
                border-bottom: 1px solid #DDD;
            }
            &:first-child, &:first-child > td:first-child {
                .border-top-left-radius(5px);
                .border-top-right-radius(5px);
            }
            &:last-child, &:last-child > td:last-child {
                .border-bottom-left-radius(5px);
                .border-bottom-right-radius(5px);
            }
        }

        td {
            /* Behave  like a "row" */
            border: none;
            position: relative;
            padding-left: 35%;
        }

        td:before {
            /* Now like a table header */
            position: absolute;
            /* Top/left values mimic padding */
            top: 6px;
            left: 6px;
            width: 30%;
            padding-right: 10px;
            white-space: nowrap;
            font-weight: bold;
        }

    }

    #keyboard-shortcuts {
        width: 360px;
        margin-left: -180px;
    }


    /* Label the data */
    #servers {
        table {
            td:nth-of-type(1):before { content: "name"; }
            td:nth-of-type(2):before { content: "databases"; }
            td:nth-of-type(3):before { content: "size"; }
            td:nth-of-type(4), td.action-column { display: none; }
        }
    }

    #databases {
        table {
            td:nth-of-type(1):before { content: "name"; }
            td:nth-of-type(2):before { content: "collections"; }
            td:nth-of-type(3):before { content: "size"; }
            td:nth-of-type(4), td.action-column { display: none; }
        }
    }

    #collections {
        table {
            td:nth-of-type(1):before { content: "name"; }
            td:nth-of-type(2):before { content: "documents"; }
            td:nth-of-type(3):before { content: "indexes"; }
            td:nth-of-type(4), td.action-column { display: none; }
        }
    }
}
