@font-face {
    font-family: main;
    src: url('/fonts/blender-pro-book.woff');
}

@font-face {
    font-family: main;
    src: url('/fonts/blender-pro-bold.woff');
    font-weight: bold;
}

body {
    background-color: #f6f6f6;
    padding: 0;
    margin: 0;
}

.hidden {
    display: none !important;
}

:root {
    --red: #c31818;
    --gray: #333333;
}

h1 {
    color: var(--red);
    font-family: main;
    font-size: 40px;
    text-align: center;
}

h2 {
    color: var(--gray);
    font-family: main;
    font-size: 30px;
    text-align: center;
}

span {
    font-family: main;
    font-size: 16px;
}

span.large {
    font-size: 18px;
}

span.bold {
    font-weight: bold;
}

#header {
    position: fixed;
    top: 20px;
    left: 20px;
}

#plan .title {
    padding: 1vw;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background-color: white;
    border-radius: 1vw;
    width: 70%;
    margin: auto;
    margin-top: 50px;
    box-shadow: 2px 2px 5px 2px rgba(0,0,0,0.1);
}

#plan .title h1 {
    margin: 0;
}

#plan .title h2 {
    margin: 0;
}

#plan .title .divider {
    height: 1vw;
}

#plan .title .motto-table {
    width: 50%;
    margin: auto;
    justify-content: center;
    display: grid;
    gap: 0.5vw;
    grid-template-columns: 1fr 3fr 1fr;
}

#plan #booking {
    margin-top: 100px;
}

#plan #booking .table {
    width: 70vw;
    margin: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
    gap: 1vw;
}

#plan td {
    font-family: main;
    font-size: 18px;
}

#plan #booking .table > div {
    background-color: white;
    border-radius: 10px;
    box-shadow: 2px 2px 5px 2px rgba(0,0,0,0.1);
}

#plan #booking .table .left {
    padding: 1vw;
}

#plan #booking .table .left .grid {
    /* display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr; */
    gap: 1vw;
    padding: 1vw;
    border: solid 3px black;
    display: flex;
    flex-direction: column;
}

#plan #booking .table .left .grid:nth-child(2) {
    border-top: none;
}

#plan #booking .table .left .grid .row {
    display: flex;
    gap: 1vw;
}

#plan #booking .table .left .grid .instructor {
    height: 4vw;
    background-image: url(/img/spinning_bike_instructor.png);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    position: relative;
    width: 100%;
}

#plan #booking .table .left .grid .bike {
    height: 4vw;
    background-image: url(/img/spinning_bike.png);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    position: relative;
    width: 100%;
}

#plan #booking .table .left .grid .bike.disabled {
    background-image: url(/img/spinning_bike_gray.png);
}

#plan #booking .table .left .grid .bike.selected {
    background-image: url(/img/spinning_bike_green.png);
}

#plan #booking .table .left .grid .box {
    grid-column: span 2;

    width: 100%;
}

#plan #booking .table .left .grid .box > div {
    border: solid 2px;
}
#plan #booking .table .left .grid .box > div:nth-child(2) {
    border-top: 0;
}

#plan #booking .table .left .grid .box h1 {
    margin: 0;
    font-family: main;
    padding: 0 1vw;
    text-align: center;
    font-size: 1.5vw;
}

#plan #booking .table .left .grid .bike._8 {
    grid-column: span 2;

    width: 100%;
}

#plan #booking .table .left .grid .door {
    grid-column: span 2;
    position: relative;
    top: 1vw;
    height: 4vw;
    background-image: url(/img/door.svg);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;

    width: 100%;
}

@media (orientation: portrait) {
    #plan #booking .table {
        grid-template-columns: 1fr;
        width: 90%;
    }

    #plan #booking .table .left .grid .instructor span {
        top: 8vw !important;
    }

    #plan #booking .table .left .grid .instructor {
        margin-bottom: 2vw;
    }

    #plan #booking .table .left .grid .bike, #plan #booking .table .left .grid .instructor, #plan #booking .table .left .grid .box, #plan #booking .table .left .grid .door {
        height: 8vw;
    }
    
    #plan .title {
        width: 90%;
    }

    #plan .title .motto-table {
        width: 90%;
        grid-template-columns: 1fr 2fr 1fr;
    }

    #plan #booking .table .left .grid .box h1 {
        font-size: 2.5vw !important;
    }

    #plan #booking .table .left .grid .bike span, #plan #booking .table .left .grid .instructor span {
        font-size: 2vw !important;
    }
    #settingsForm, #mailtextForm, #loginform, #bookings {
        width: 90% !important;
    }
    
    h1 {
        font-size: 80px !important;
    }
    h2 {
        font-size: 60px !important;
    }
    span, label, input, select, option, button, #plan #booking span {
        font-size: 32px !important;
    }
    span.larg {
        font-size: 36px !important;
    }
    #footer span {
        font-size: 36px !important;
    }
}


#plan #booking .table .left .grid .bike span, #plan #booking .table .left .grid .instructor span {
    position: absolute;
    font-size: 1vw;
    font-weight: bold;
    border: none;
    left: 50%;
    top: 50%;
    transform: translateX(-50%);
    pointer-events: none;
    padding: 0;
    margin: 0;
}
#plan #booking .table .left .grid .instructor span {
    top: 4vw;
    height: fit-content;
}

.bike.disabled span {
    display: none;
}

.instructor span {
    color: #007BC5;
}

.bike.selected span {
    color: #4DC600;
}

#plan #booking .table .right {
    padding: 1vw;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

#plan .error {
    color: red;
    font-family: 'main';
    font-weight: bold;
}

#plan .success {
    color: #54d903;
    font-family: 'main';
    font-weight: bold;
}

._100, #payment-element {
    grid-column: span 2;
}

.input {
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
    width: 100%;
}

.input._50 {
    float: left;
    width: calc(50% - 10px);
    margin-right: 10px;
}

.input._25 {
    float: left;
    width: calc(25% - 10px);
    margin-right: 10px;
}

#schedule_form {
    padding: 1vw;
    background-color: white;
    border-radius: 1vw;
    width: 90%;
    margin: auto;
    margin-top: 150px;
    box-shadow: 2px 2px 5px 2px rgba(0, 0, 0, 0.1);
}

.schedule-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr calc(4vw + 10px);
}
button.remove_schedule_row {
    width: 4vw;
    margin-left: 10px;
}

label {
    color: var(--red);
    font-family: main;
    margin-bottom: 10px;
    font-size: 16px;
}

input, select {
    border: none;
    border-bottom: solid 3px var(--red);
    padding: 10px;
    font-family: main;
    font-size: 16px;
}

input:focus, select {
    outline: none;
}

#plan #booking #payment {
    display: grid;
    grid-template-columns: 1fr 1fr;
    row-gap: 10px;
}

#plan #booking #payment label {
    grid-column: span 2;
    margin-bottom: 0;
}

#plan #booking span {
    font-family: main;
    font-size: 16px;
    border-bottom: solid 1px var(--red);
    padding: 10px;
}

#plan #booking span.sum {
    border-bottom: solid 3px var(--red);
    font-weight: bold;
}

#plan #booking span.price {
    text-align: right;
}

#plan #booking #payment-element {
    width: calc(100% - 10px);
}

button {
    margin-top: 10px;
    background-color: var(--red);
    color: white;
    font-family: main;
    font-weight: bold;
    padding: 20px;
    width: 100%;
    font-size: 16px;
    border: none;
}

button:disabled {
    background-color: #f18c8c;
}

button:hover {
    cursor: pointer;
}

button:disabled:hover {
    cursor: unset;
}

#top-actions {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 8px;
    z-index: 10;
}

#top-actions .button {
    display: inline-block;
    padding: 8px 16px;
    background-color: var(--red);
    color: white;
    text-decoration: none;
    font-family: main;
    font-weight: bold;
    font-size: 16px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    margin: 0;
}

#top-actions .button:hover {
    opacity: 0.9;
}

#footer {
    padding: 50px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    align-items: center;
}

#footer span {
    font-size: 18px;
}

#loginform {
    padding: 1vw;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background-color: white;
    border-radius: 1vw;
    width: 30%;
    margin: auto;
    margin-top: 150px;
    box-shadow: 2px 2px 5px 2px rgba(0,0,0,0.1);
}

#download_data {
    padding: 1vw;
    background-color: white;
    border-radius: 1vw;
    width: 90%;
    margin: auto;
    margin-top: 150px;
    box-shadow: 2px 2px 5px 2px rgba(0,0,0,0.1);
}

#bookings-container {
    padding: 1vw;
    background-color: white;
    border-radius: 1vw;
    width: 90%;
    margin: auto;
    margin-top: 150px;
    box-shadow: 2px 2px 5px 2px rgba(0,0,0,0.1);
}

#bookings {
    width: 100%;
    border-collapse: collapse;

    input {
        width: 100%;
    }
    tr:nth-child(even) {
        padding-top: 5px;
        background-color: #efefef;
    }
    
    td:nth-child(n+1) {
        padding-left: 15px;
    }
}

#settingsForm {
    padding: 1vw;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    background-color: white;
    border-radius: 1vw;
    width: 30%;
    margin: auto;
    margin-top: 150px;
    box-shadow: 2px 2px 5px 2px rgba(0,0,0,0.1);
}

/* The test-mail form is a second card under the settings one: same box, no big top
   margin, because it is not the first thing on the page. */
#testmailForm {
    padding: 1vw;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    background-color: white;
    border-radius: 1vw;
    width: 30%;
    margin: 20px auto 150px;
    box-shadow: 2px 2px 5px 2px rgba(0,0,0,0.1);
}

#testmailForm .hint {
    grid-column: span 2;
    margin: 0;
    font-size: 13px;
    line-height: 1.4;
    color: #666;
}

#settings .msg {
    width: 30%;
    margin: 20px auto 0;
    padding: 12px 1vw;
    border-radius: 1vw;
    font-weight: bold;
    box-sizing: border-box;
}

#settings .msg.ok    { background-color: #e6f4ea; color: #1e6b34; }
#settings .msg.error { background-color: #fdecea; color: #a31c12; }

.button {
    padding: 1vw;
    background-color: var(--red);
    color: white;
    text-decoration: none;
}

.button:visited {
    color: white;
}

/* The mail text card: same box as the others, a little wider because it holds a
   whole letter. */
#mailtextForm {
    padding: 1vw;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    background-color: white;
    border-radius: 1vw;
    width: 80%;
    max-width: 1400px;
    margin: 20px auto 0;
    box-shadow: 2px 2px 5px 2px rgba(0,0,0,0.1);
}

#mailtextForm textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 10px;
    font: 15px/1.5 Verdana, sans-serif;
    border: 1px solid #ccc;
    border-radius: 4px;
    resize: vertical;
}

#mailtextForm .tokens {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 6px 0 8px;
}

#mailtextForm .tokens button,
#mailtextForm button.secondary {
    margin: 0;
    padding: 8px 12px;
    width: auto;
    font-size: 13px;
    background-color: white;
    color: var(--red);
    border: 1px solid var(--red);
}

#mailtextForm button.secondary {
    width: 100%;
    margin-top: 10px;
    padding: 20px;
    font-size: 16px;
}

#mailtextForm .hint {
    grid-column: span 2;
    margin: 0;
    font-size: 13px;
    line-height: 1.4;
    color: #666;
}

/* Editor and preview side by side; below 1100px under each other. */
#mailtextForm .mail-editor {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

#mailtextForm .preview iframe {
    width: 100%;
    min-height: 300px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: white;
    margin-top: 6px;
}

@media (max-width: 1100px) {
    #mailtextForm .mail-editor {
        grid-template-columns: 1fr;
    }
}
