/*
*
 red - 8D230F
 blue - 1E434C
 rust - 9B4F0F
 gold - C99E10
 beige - E4DCB2
*
*/

@font-face {
    font-family: helvetica;
    src: url("fonts/helvetica.ttf");
}

@font-face {
    font-family: helvetica-bold;
    src: url("fonts/helvetica-bold.ttf");
}

* {
    -moz-box-sizing: border-box;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}

html {
    text-align: left;
    font-size: 16px;
    line-height: 1.5rem;
}

body {
    background-color: #E4DCB2;
}

img {
    width: 100%;
}

h1 {
    font-family: helvetica-bold;
    font-size: 1.5rem;
    text-align: left;
}

h2 {
    font-family: helvetica-bold;
    font-size: 1.3rem;
    text-align: left;
}

h3 {
    font-family: helvetica-bold;
    font-size: 1.1rem;
    text-align: left;
}

.menu {
    background-color: #1E434C;
    color: #fff;
    position: fixed;
    top: 0px;
    bottom: 0px;
    left: 0px;
    height: auto;
    width: 40%;
    padding: 20px;
    text-decoration: none;
    overflow-y: scroll;
    z-index: 3;
}

::-webkit-scrollbar {
    /* Hide the scrollbar from the menu overflow */
    display: none;
}

.menu-container {
    width: 100%;
    border: 2px solid #ffffff;
}

table.menu-items {
    padding: 0px;
    margin: 0px;
    border-collapse: collapse;
    width: 100%;
}

table.menu-items td {
    background-color: #1E434C;
    border: 1px solid #ffffff;
    color: #fff;
    padding: 10px;
    text-align: center;
    vertical-align: middle;
}

table.menu-items a {
    color: #fff;
    text-decoration: none;
}

table.menu-items td:hover {
    color: #fff;
    background-color: #3d8496;
}

.button {
    border: none;
    color: white;
    padding: 10px;
    line-height: 1.2rem;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
    border-radius: 3px;
    white-space: pre-wrap;
    /* css-3 */
    word-wrap: break-word;
}

.button1 {
    background-color: #925726;
    width: 95%;
    margin: 5px;
    font-size: .9rem;
}

.button1:hover {
    background-color: #f5ae73;
    color: #000000;
}

.button2 {
    background-color: #e4e3e3;
    line-height: 1rem;
    padding: 5px;
    margin-bottom: 20px;
    color: #000000;
    border: 1px solid #000000;
}

#window-selectedFileName {
    border: 2px solid #ffffff;
    padding: 5px;
    font-weight: bold;
    letter-spacing: .1rem;
}

#output-selectedFileName {
    font-size: 1.1rem;
}

#progress {
    width: 100%;
    height: 1em;
    background-color: #fff;
}

#inprogress {
    width: 10%;
    height: 1em;
    background-color: #4A0;
}

#progress.hidden {
    display: none;
}

.section-header {
    background-color: #9ec4ce;
    color: #333333;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 140px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    margin-left: 150px;
}

#input-text,
#input-textToSearchFor,
#input-textToSearchIn {
    z-index: 99;
    width: 96%;
    height: 5rem;
    padding: 10px;
}

#input-urlToSearch {
    z-index: 99;
    width: 96%;
    height: auto;
    padding: 10px;
}

.main-content {
    width: 60%;
    float: right;
    z-index: 1;
}

#section-stringManipulation,
#section-stringConversion,
#section-databaseLookup,
#section-textAnalysis,
#section-lettersNumbers,
#section-bacon,
#section-combined,
#section-railfence,
#section-caesarShift,
#section-vigenere,
#section-morse,
#section-letterSkipper,
#section-anagrams,
#section-atbash,
#section-beale,
#section-searchTextInText,
#section-playfair,
#section-rot13,
#section-substitutionImages,
#section-substitutionText,
#section-periodicTable,
#section-caesaredWordSearch {
    position: relative;
    top: 0px;
    left: 0px;
    z-index: 1;
    padding: 20px 20px 300px 20px;
    height: auto;
    width: 100%;
    border: 2px solid #333333;
    overflow: auto;
}

#input-cipherText {
    width: 80%;
}

#output-stringManipulation,
#output-stringConversion,
#output-databaseLookup,
#output-caesarShift,
/* #output-beale, */
#bealeResult,
#bealeResultIncludingSpaces,
#bealeResultIncludingAllCharacters,
#output-bealeStatistics,
#output-lettersNumbers,
#output-bacon,
#output-morse,
#output-railfence,
#output-combined,
#output-atbash,
#output-letterSkipper,
#output-substitutionText,
#output-playfair,
#output-rot13,
#output-substitutionImages,
#output-substitutionText,
#output-substitutionTextInterimResults,
#output-searchTextInTextCommonWords,
#output-searchTextInTextLongestPhrase,
#output-periodicTableNumber,
#output-periodicTableWeight,
#output-caesarWordsearchWordsFound {
    bottom: 0%;
    height: auto;
    padding: 5px;
    border: 1px solid #333333;
    /* white-space: pre; */
    word-wrap: break-word;
    overflow: auto;
}


/*************************************************************************
                    FORMATTING FOR BEALE
**************************************************************************/
#bealeContainer{
    width:90%;
}

#cipherTextNumberString{
    width: 100%;
    height: 100px;
    padding: 10px;
    box-sizing: border-box;
    
}




#radioButtons{
    margin-top: 2px;
}


.likely-english {
color: green;
}

.not-english {
color: red; 
}


/*************************************************************************
                    FORMATTING FOR LETTER SKIPPER
**************************************************************************/

#startSkipNum {
    width: 30px;
}

#repeatSkipNum {
    width: 30px;
}

#shiftNum {
    width: 30px;
}


/*************************************************************************
                    FORMATTING FOR DATABASE LOOKUP
**************************************************************************/

#output-databaseLookup img {
    max-height: 200px;
    width: auto;
    /* Maintain aspect ratio */
}


/*************************************************************************
                    FORMATTING FOR ANAGRAMS PAGE
**************************************************************************/

#anagramsTable {
    border-collapse: collapse;
}

#anagramsTable td {
    padding: 3px 5px;
}

#anagramsTable td:has(>button) {
    text-align: center;
}

#anagramsTable td>button {
    margin-right: 1em;
    margin-left: 1em;
}

#anagramsTable td.firstcol {
    text-align: right;
}

#anagramsTable.form {
    border-collapse: separate;
    border-spacing: 0 5px;
}

#anagramsTable.form td {
    background-color: #fea;
    padding: 3px;
}

#anagramsTable.form .formLabel {
    text-align: left;
    width: 40%;
    border: 1px solid #333333;
}

#anagramsTable.form .formSubmit {
    text-align: center;
}

#anagramsTable.form .formSubmit button {
    margin-right: 2em;
    margin-left: 2em;
}

#anagramsTable.sentence {
    border-collapse: collapse;
    border: 1px solid black;
    display: inline-block;
    margin-right: 10px;
}

#anagramsTable.compatible {
    /* border: 1px solid magenta; */
    /* max-width: 100%; */
    width: 100%;
}

#anagramsTable.sentence td {
    border: 1px solid black;
    padding: 3px;
}

#anagramsTable.sentence .word.isSelected,
#anagramsTable.compatible .word.isSelected {
    background-color: blue;
    color: white;
}


/*************************************************************************
  for Anagrams permanent delete words from dictionary popup confirmation.
**************************************************************************/

.popup {
    /* used to prevent access to background */
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 50;
    display: none;
    opacity: 0;
    background-color: rgb(255, 255, 255, 0.75);
    transition: opacity 1s;
}

.popup .popupcontent {
    --contentbg: #ffd;
    --inputbg: #ffa;
    --inputbghover: #fd8;
    position: absolute;
    display: inline-block;
    background-color: var(--contentbg);
    left: 50%;
    transform: translate(-50%, 50px);
    padding: 20px;
    border: 1px solid black;
    border-radius: 20px;
    text-align: center;
}

.popup .title {
    font-weight: bold;
    font-size: 150%;
}

.popup .close {
    display: block;
    font-weight: bold;
    font-size: 150%;
    margin: 0;
    position: absolute;
    top: 2%;
    right: 2%;
    width: 1.3em;
    height: 1.3em;
    text-align: center;
    line-height: 1.3em;
    border-radius: 50%;
    /* makes a circle */
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid black;
    cursor: default;
}

.popup .close:hover {
    background-color: black;
    color: white;
}

.popup .popupbutton {
    font-size: 125%;
    padding: 0 10px;
    background-color: var(--inputbg);
    border: 1px solid black;
    border-radius: 5px;
}

.popup .popupbutton:hover {
    background-color: var(--inputbghover);
}


/*************************************************************************
                    FORMATTING FOR GENERIC TABLE ROWS
**************************************************************************/

tr:nth-child(odd) {
    background-color: #ffa;
}

tr:nth-child(even) {
    background-color: #ffc;
}


/*************************************************************************
                    FORMATTING FOR NON-ANAGRAM TABLES
**************************************************************************/

#tableStringManipulation,
#tableStringConversion,
#tableAnalysis,
#tableBeale {
    width: 95%;
    margin: auto;
    border-collapse: collapse;
    border: 2px solid #333333
}

#tableStringManipulation td,
#tableStringConversion td,
#tableAnalysis td,
#tableBeale td {
    padding: 5px;
    border: 1px solid #333333;
    box-sizing: border-box;
}

#tableAnalysis td:nth-child(1),
#tableStringConversion td:nth-child(1) {
    width: 25%;
}

#tableAnalysis td:nth-child(2),
#tableStringConversion td:nth-child(2) {
    width: 70%;
}

#tableAnalysis td:nth-child(3),
#tableStringConversion td:nth-child(3) {
    width: auto;
}

#tableStringConversion td:nth-child(4) {
    width: auto;
}

#tableSubstitutionInputImages {
    width: 80%;
    min-width: 300px;
    table-layout: fixed;
    border-collapse: collapse;
    margin: 40px;
}

#tableSubstitutionInputImages td {
    width: 8%;
    height: auto;
    padding: 0;
    margin: 0;
    border: 1px solid black;
}


/*************************************************************************
                    FORMATTING FOR OUTPUTS FROM TEXT ANALYSIS
**************************************************************************/

#output-analysisTotalParagraphsCount,
#output-analysisTotalLineCount,
#output-analysisTotalSentenceCount,
#output-analysisTotalWordCount,
#output-analysisMissingLetters,
#output-letterFrequency,
#output-numberFrequency,
#output-analysisFirstLetterByLine,
#output-analysisFirstLetterBySentence,
#output-analysisLastLetterByLine,
#output-analysisLastLetterBySentence,
#output-analysisCornerLetters,
#output-analysisWordCountByLine,
#output-analysisLetterCountByLine,
#output-analysisWordCountBySentence {
    height: 1.5rem;
    width: 100%;
    border: 1px solid #333333;
}


/*************************************************************************
                    FORMATTING FOR OUTPUTS FOR SUBSTITUTIION
**************************************************************************/

#output-substitutionImages {
    width: 80%;
    min-width: 300px;
    margin: 40px;
}

#output-substitutionImages table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

#output-substitutionImages td {
    display: block;
    float: left;
    height: auto;
    padding: 0;
    margin: 0;
    border: 1px solid black;
    text-align: center;
}

#output-substitutionText {
    width: 80%;
    margin: 40px;
}


/*************************************************************************
                    FORMATTING FOR FOOTER
**************************************************************************/

#section-footer {
    position: relative;
    top: 0px;
    left: 0px;
    z-index: 1;
    padding: 20px;
    height: auto;
    width: 100%;
    border: 2px solid #333333;
}

#button-menu {
    display: none;
    /* Hide the button by default. is should only be visible on small screens. */
    background-color: #1E434C;
    color: #fff;
    border: none;
    position: fixed;
    top: 10px;
    right: 10px;
    padding: 10px;
    font-size: 1.2em;
    cursor: pointer;
    z-index: 2;
}


/*************************************************************************
                    FORMATTING FOR STRING MANIPULATION BUTTONS
**************************************************************************/

#tableStringManipulation {
    width: 100%;
}


/*************************************************************************
                    FORMATTING FOR STRING CONVERSION TABLE
**************************************************************************/

#tableStringConversion button {
    width: 75px;
}

#tableStringConversion td:first-child,
th:first-child {
    width: 200px;
}

#tableStringConversion textarea {
    width: 100%;
    height: 100%;
    box-sizing: border-box;
}

#tableStringConversion td:nth-child(3),
#tableStringConversion td:nth-child(4) {
    width: auto;
    padding: 5px;
}


/*************************************************************************
                    FORMATTING FOR MOBILE MENU BUTTON
**************************************************************************/

#button-menu {
    display: none;
    /* Hide the button by default. is should only be visible on small screens. */
    background-color: #1E434C;
    color: #fff;
    border: none;
    position: fixed;
    top: 10px;
    right: 10px;
    padding: 10px;
    font-size: 1.2em;
    cursor: pointer;
    z-index: 2;
}


/*************************************************************************
  FORMATTING FOR CAESARED WORD SEARCH
**************************************************************************/

/* Flexbox to align tables horizontally */
.table-container {
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Align items at the top */
    gap: 20px; 
    flex-wrap: nowrap; 
}

/* Wrapper for individual table and label */
.table-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 50%;
}

/* Tables adjust dynamically to fit the container */
#caesaredWordSearchInputTable,
#caesaredWordSearchOutputTable {
    border-collapse: collapse;
    background-color: white;
    max-width: 100%;
    flex: 1; /* Allow tables to grow/shrink equally */
}

#caesaredWordSearchInputTable td,
#caesaredWordSearchOutputTable td {
    width: 1em; 
    height: 1em;
    text-align: center;
    font-size: calc(1.1em); /* Dynamically adjust font size */
    border: 1px solid #ccc;
    box-sizing: border-box;
}

/* Ensure input text fits within square cells */
input[type="text"] {
    border: none;
    font-size: 0.95;
    outline: none;
    text-align: center;
    width: 100%; 
    height: 100%;
    line-height: normal; /* Prevent clipping */
}

/* Adjust font size for smaller screens */
@media (max-width: 768px) {
    #caesaredWordSearchInputTable td,
    #caesaredWordSearchOutputTable td {
        width: 1.5em;
        height: 1.5em;
        font-size: calc(1.2em); /* Adjust font size for smaller screens */
    }
}






/*************************************************************************
  FORMATTING TO DISABLE A DIV WHILE LEAVING IT VISIBLE. 
  ADD <DIV ID='DISABLED'> AROUND ANY DIV OR TEXT DESIRED.
**************************************************************************/

#disabled {
    pointer-events: none;
    opacity: 0.5;
    filter: grayscale(100%);
}


/*************************************************************************
  FORMATTING FOR MOBILE DEVICES.
**************************************************************************/


/*360 and 375 widths for phones
768 and 1280 for tablets
1280 for desktop */


/* For screens with a maximum width of 1000px */

@media only screen and (max-width: 1000px) {
    .menu {
        width: 40%;
        display: inline-block;
    }
    .main-content {
        width: 60%;
        display: inline-block;
    }
}

#tableStringManipulation td,
#tableBeale td {
    width: 50%;
    float: left;
    box-sizing: border-box;
}


/* Media query for screen sizes less than 600px*/

@media only screen and (max-width: 600px) {
    .menu {
        position: relative;
        left: 0px;
        width: 100%;
    }
    .main-content {
        position: relative;
        left: 0px;
        width: 100%;
        clear: both;
    }
    /* Show the menu button */
    #button-menu {
        display: block;
    }
    /* Reformat the tables */
    #tableStringManipulation,
    #tableBeale {
        width: 100%;
    }
    #tableStringManipulation td,
    #tableBeale td {
        width: 100%;
        display: block;
    }
}


/* For screens with a maximum width of 500px */


/* @media only screen and (max-width: 500px) {
    #tableStringManipulation td {
        width: 100%;
        float: left;
        box-sizing: border-box;
    }
} */


/*  */


/*  */


/*  */


/*  */


/*  */


/*  */


/*  */


/*  */


/*  */


/* ######################## I THINK THESE ARE SURPLUS FROM EARLIER THINGS ??? ########################### */


/* #output {
    bottom: 0%;
    height: auto;
    padding: 5px;
    border: 1px solid #333333
}

#output .error {
    color: red;
} */


/* ul {
    list-style-type: none;
} */


/* .divider {
    height: 3px;
    background-color: #333333;
} */