/* Merfolk Sentence Maker - Main Stylesheet */

/* CSS Variables for theming */
:root {
    /* Dark mode colors (default) - OLED black background */
    --bg-color: #000000;
    --text-color: #e0e0e0;
    --border-color: #444;
    --highlight-bg: rgb(200, 80, 80);
    --highlight-text: #ffffff;
    --input-focus: #4a9eff;
    --button-bg: #1a1a1a;
    --button-text: #e0e0e0;
    --button-hover-bg: #2a2a2a;
}

body[data-theme="light"] {
    /* Light mode colors */
    --bg-color: #ffffff;
    --text-color: #000000;
    --border-color: #ccc;
    --highlight-bg: rgb(255, 137, 137);
    --highlight-text: rgb(14, 14, 14);
    --input-focus: #007bff;
    --button-bg: #f0f0f0;
    --button-text: #000000;
    --button-hover-bg: #e0e0e0;
}

@font-face {
    font-family: "Geologica";
    src: url("fonts/Geologica-VariableFont_CRSV,SHRP,slnt,wght.ttf") format("truetype");
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
}

@font-face {
    font-family: "EB Garamond";
    src: url("fonts/EBGaramond-VariableFont_wght.ttf") format("truetype");
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
}

@font-face {
    font-family: "EB Garamond";
    src: url("fonts/EBGaramond-Italic-VariableFont_wght.ttf") format("truetype");
    font-style: italic;
    font-weight: 100 900;
    font-display: swap;
}

/* Highlight for unacceptable words */
.highlight {
    background-color: var(--highlight-bg);
    color: var(--highlight-text);
}

/* Word button structural styling (non-theme-specific) */
.word-button {
    padding: 5px 10px;
    margin: 5px;
    overflow-wrap: break-word;
    word-break: break-all;
    display: inline-block;
    font-family: "Geologica", sans-serif;
    cursor: pointer;
}

/* Word in list styling in textbox (shares structure with word buttons) */
.word-in-list {
    padding: 5px 10px;
    margin: 0 2px;
    overflow-wrap: break-word;
    word-break: break-all;
    display: inline-block;
    font-family: "Geologica", sans-serif;
}

/* Word buttons container */
#wordButtons {
    padding: 10px;
}

/* Responsive design for mobile devices */
@media (max-width: 600px) {
    .word-button {
        font-size: 14px; /* Adjust the size as needed */
        padding: 10px; /* Adjust the padding as needed */
    }
}

/* Buttons container layout */
.buttons-container {
    width: 100%; /* Add this line */
}

/* Body layout */
body {
    display: flex;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Use EB Garamond for page text by default; input and word buttons keep Geologica */
html, body, .centered-content, h1, h2, h3, p, input, button, label {
    font-family: "EB Garamond", Georgia, "Times New Roman", serif;
}

/* Centered content container */
.centered-content {
    text-align: center;
    overflow: auto;
    scrollbar-width: none; /* For Firefox */
    -ms-overflow-style: none;  /* For Internet Explorer and Edge */
    padding-bottom: 50px; 
    margin: 0 auto; 
    width: 100%;
}

/* Hide scrollbar for WebKit browsers */
.centered-content::-webkit-scrollbar {
    display: none; /* For Chrome, Safari and Opera */
}

/* Text input area styling */
#textInput {
    min-height: 200px;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow-y: auto;
    text-align: left;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: "Geologica", sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
}

/* Text input focus state */
#textInput:focus {
    outline: 2px solid var(--input-focus);
    outline-offset: -1px;
}

/* Button styling */
button {
    background-color: var(--button-bg);
    color: var(--button-text);
    border: 1px solid var(--border-color);
    transition: background-color 0.2s ease, transform 0.2s ease;
}

button:hover {
    background-color: var(--button-hover-bg);
}

/* Input styling */
input {
    background-color: var(--bg-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

/* Theme toggle button */
#themeToggle {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    z-index: 1000;
}

#themeToggle:hover {
    transform: scale(1.05);
}

/* Wordlist selector styling */
.wordlist-selector {
    margin-top: 30px;
    padding: 20px;
    text-align: center;
}

/* Edit mode controls - hide 'Define your word list' section by default */
#defineWordListHeading,
#defineWordListDescription,
#wordInput,
#updateWordsButton,
#sortWordsButton {
    display: none;
}

/* Show 'Define your word list' section when edit mode is active */
body.edit-mode #defineWordListHeading,
body.edit-mode #defineWordListDescription {
    display: block;
}

body.edit-mode #wordInput,
body.edit-mode #updateWordsButton,
body.edit-mode #sortWordsButton {
    display: inline-block;
}

/* Hide remove icons by default */
.remove-icon {
    display: none;
}

/* Show remove icons when edit mode is active */
body.edit-mode .remove-icon {
    display: inline;
}


.wordlist-selector label {
    margin-right: 10px;
    font-weight: 500;
}

.wordlist-selector select {
    padding: 8px 12px;
    margin-right: 10px;
    background-color: var(--bg-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: "EB Garamond", Georgia, "Times New Roman", serif;
    cursor: pointer;
}

.wordlist-selector select:focus {
    outline: 2px solid var(--input-focus);
    outline-offset: -1px;
}

.wordlist-selector button {
    padding: 8px 20px;
    cursor: pointer;
    border-radius: 4px;
}
