/* Fonts */

@font-face {
    font-family: titleFont;
    src: url(titleFont.otf);
}

@font-face {
    font-family: swis721;
    src: url(swis721.ttf);
}

@font-face {
    font-family: swis721;
    src: url(swis721Bold.ttf);
    font-weight: bold;
}

body {
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
    color: antiquewhite;
    font-family: swis721;
    margin: 0;
}

.background {
    position: fixed; /* Covers entire viewport */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: -2;
  }

.low_res {
    background-image: url('moonstone_sky_compressed.jpg');
}

.hi_res {
    background-image: url('moonstone_sky.jpg');
    opacity: 0; /* Start hidden */
    z-index: -1;
}

.title {
    font-family: titleFont;
    margin: 0;
}

table#indexTable, table#formTable {
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    border: 3px solid black;
    table-layout: fixed;
    padding: 10px;
    border-radius: 5px;
}

#indexTable th, #formTable th{
    font-size: 50px;
    padding: 10px;
}

#indexTable td{
    font-size: 22px;
    padding: 10px;
}

#formTable td {
    font-size: 22px;
    padding: 7px;
}

#indexTable input[type=text], input[type=password], input[type=date], #formTable input[type=text], input[type=password], input[type=date] {
    padding: 4px;
    background-color: antiquewhite;
    border: 3px solid black;
    width: 95%;
    max-width: 400px;
}

#indexTable input[type=submit], #formTable input[type=submit] {
    padding: 10px;
    width: 200px;
    background-color: antiquewhite;
    border: 3px solid black;
    font-size: 22px;
    transition-duration: 0.4s;
}

#indexTable input[type=submit]:hover, #formTable input[type=submit]:hover, .signup input[type=submit]:hover {
    background-color: #8a2be2;
}

.wrapper {
    position: relative; /* Required for z-index to work */
    display: flex;
    justify-content: center;
    align-items: center;
    height: 80%;
    flex-direction: column;
    padding-top: 100px;
}

.signup {
    text-align: center;
    margin-top: 50px;
}

.signup input[type=submit] {
    padding: 10px;
    width: 200px;
    background-color: antiquewhite;
    border: 3px solid black;
    font-size: 22px;
    transition-duration: 0.4s;
}


/*----------------------- Header ------------------------------*/

.sidenav {
    height: 100%;
    width: 0;
    position: fixed;
    top: 0;
    left: 0;
    background-color: #111;
    overflow-x: hidden;
    transition: 0.5s;
    padding-top: 60px;
    z-index: 2;
}

.sidenav a {
    padding: 8px 8px 8px 32px;
    text-decoration: none;
    font-size: 25px;
    color: #818181;
    display: block;
    transition: 0.3s;
}

.sidenav a:hover {
    color: #f1f1f1;
}

.sidenav .closebtn {
    position: absolute;
    top: 0;
    right: 25px;
    font-size: 36px;
    margin-left: 50px;
}

header {
    position: relative;
    z-index: 1;
    height: auto;
    background-color: #300b51;
    display:flex;
}

header form {
    margin-bottom: 0px;
}

header form input[type=submit] {
    height: 90%;
    margin-top: calc(5% - 2px);
}

header h1 {
    font-size: 34px;
    padding-top: 10px;
    padding-bottom: 10px;
}

@media (max-width:900px){
    header h1 {
        font-size: 24px;
        padding-top: 15px;
        padding-bottom: 15px;
    }
}
    
.active {
    background-color: #300b51;
}

header input[type=submit] {
    align-self: center;
    height: 40px;
    width: 100px;
    background-color: antiquewhite;
    border: 3px solid black;
    font-size: 16px;
    transition-duration: 0.4s;
    font-family: swis721;
    cursor: pointer;
}

/*--------------------- Chess ------------------------*/

.chess-title {
    font-size: 128px;
    padding: 5px 24px;
    position: relative;

    text-align: center
}

.chess-container { 
    display: flex;
    justify-content: center;
}

.chess-table {
    border: 5px solid blueviolet;
    table-layout: fixed;
    position: relative;

    border-collapse: collapse;
    border-spacing: 0;
}

.chess-table td {
    height: 80px;
    width: 80px;
    font-size: 48px;
    text-align: center;
    opacity: 0.95;
    padding: 0;
    user-select: none;
}

.info-container {
    width: 200px;
    border: 5px solid blueviolet;
    position: relative;

    background-color: rgba(34, 36, 46, 0.95);
    font-size: 16px;
}

.info-table {
    width: 100%;
}

.board-container {
    display: flex;
    justify-content: center;
}

.white {
    background-color: antiquewhite;
    color: black;
}

.black {
    background-color: lightslategrey;
    color: black;
}

.selected {
    background-color: red;
}

.piece {
    cursor: pointer;
}

.valid-move {
    cursor: pointer;
    text-align: center;
}

.capture-move {
    background-color: purple;
}

/* -----------------Chat------------------------ */

.user {
    color: lightcoral;
    margin: 5px 0;
}

.botThinking {
    color: lightgreen;
    margin: 5px 0;
    font-family: 'consolas';
}

.botResponse {
    color: antiquewhite;
    margin: 5px 0;
    font-family: 'consolas';
}

.chat-container {
    max-width: 1000px;
    margin: 20px auto 20px;
    height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
    background-color: rgba(48, 11, 81, 0.88);
    border-radius: 2px;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.system-message {
    text-align: center;
    color: #ccc;
    font-style: italic;
    padding: 10px;
}

.chat-input-container {
    display: flex;
    gap: 10px;
    padding: 20px;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 2px0 0 10px 10px;
}

#message-input {
    flex: 1;
    padding: 12px;
    border: 1px solid #555;
    border-radius: 2px;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    resize: none;
    font-family: inherit;
}

#message-input:focus {
    outline: none;
    border-color: #4CAF50;
}

.chat-header button {
    padding: 5px 15px;
    color: antiquewhite;
    border: none;
    border-radius: 2px;
    cursor: pointer;
    font-size: 16px;
    font-family: swis721;
}

.chat-header button:disabled, #send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#send-btn:disabled:hover {
    cursor: not-allowed;
}

#clear-btn {
    background-color: #f44336;
}

#clear-btn:hover {
    background-color: #d32f2f;
}

#save-btn {
    background-color: #4CAF50;
}

#save-btn:hover {
    background-color: #3e8540;
}

#load-btn {
    background-color: #4c4eb1;
}

#load-btn:hover {
    background-color: #3d3f94;
}

#send-btn {
    font-family: swis721;
    background-color: antiquewhite;
}

#send-btn:hover {
    cursor: pointer;
    background-color: #cfc4b6;
}