* {
    font-size: 16px;
}

/* Resetting and general styles */
body {
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    background-color: #ddd;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    overflow-y: auto;
    background-image: url(background.png);
}

/* Container hidden state */
body:not(.content-ready) .container {
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.5s ease-in; /* Smooth fade-in */
}

/* Container visible state */
body.content-ready .container {
    visibility: visible;
    opacity: 1;
}

/* Content container */
.container {
    text-align: center;
    padding: 20px;
    border-radius: 10px;
    max-width: 600px;
    max-width: 100%;
    overflow-x: hidden;
    margin-top: 80px; /* Adjust margin for header */
    width: 100%;
}

h1 {
    margin: 0;
    color: #4CAF50; /* Green color for the header text */
    font-size: 2em; /* Set the font size for consistency */
    text-transform: lowercase
}

h1::first-letter {
    text-transform: uppercase
  }

p {
    font-size: 1.2em;
    color: #666;
    margin-bottom: 20px;
}

.categories {
    margin-top: 20px;
}

h2 {
    font-size: 1.25em;
    color: white;
    margin-bottom: 10px;
    margin-top: 10px;
}

#category-list, #story-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.category-item {
    background: #007bff;
    color: white;
    padding: 10px 15px;
    margin: 5px 0;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
    display: flex;
    flex-direction: column; /* ✅ make room for two lines */
    align-items: stretch;
    width: 100%;
    box-sizing: border-box; /* ✅ fix width + padding overflow */
    user-select: none;
}

.category-text {
    margin-left: 10px;
}

.completion-status {
    margin-left: auto;
    padding-left: 10px;
    font-weight: bold;
}

.emoji-container {
    text-align: center;
    font-size: 50px;
}

#special-emoji {
    font-size: 65px;
    display: none;
    user-select: none;
}

#welcome-text {
    display: none;
}

/* Modal styles */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0, 0, 0, 0.5); /* Black w/ opacity */
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto; /* 15% from the top and centered */
    padding: 20px;
    border: 1px solid #888;
    width: 80%; /* Could be more or less, depending on screen size */
    max-width: 500px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close-button:hover,
.close-button:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.modal-button {
    background-color: #007BFF;
    color: white;
    padding: 10px 20px;
    margin: 10px 5px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}

.modal-button:hover {
    background-color: #0056b3;
}

.modal-button:focus {
    outline: none;
}

.modal h2 {
    margin-top: 0;
}

.modal-footer {
    display: flex;
    justify-content: center; /* Centers the buttons horizontally */
    margin-top: 20px; /* Optional: Adds space above the buttons */
}

.trash-icon {
    font-size: 24px; /* Adjust the font size to make the icon larger */
    margin-right: 8px; /* Add margin-right for spacing between icon and text */
}

div#language-dropdown.dropdown-content.show {
    left: -45px;
}

.category-line {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 10px;
    align-items: center;
    padding: 8px 0;
  }

.meta-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    flex-wrap: nowrap;
    overflow: hidden;
}

.meta-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
  }

    .left-block {
        display: flex;
        align-items: center;
        flex-wrap: nowrap;
        gap: 6px;
      }
      
      .right-block {
        display: flex;
        align-items: flex-start;
        justify-content: flex-end;
        white-space: nowrap;
        min-width: 60px;
      }

    .emoji-block {
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    }

    .text-container {
        display: grid;
        grid-template-columns: 1fr auto; /* left column grows, right column shrinks */
        row-gap: 4px;
      }
      
      .text-right {
        display: flex;
        flex-direction: column;
        justify-content: center;
      }

      .category-text {
        font-weight: bold;
        white-space: normal;
        word-break: break-word;
        text-align: left;
        margin: 0;
      }


.score-text {
  font-weight: bold;
  white-space: nowrap;
  margin-left: 10px;
}

.top-row, .bottom-row {
    display: contents; /* allows children to align inside grid directly */
  }
  
      .difficulty-text {
        font-style: italic;
        white-space: nowrap;
      }

.date-text {
    text-align: left;
  }

  .category-text,
  .date-text {
    grid-column: 1; /* left side */
  }
  
  .score-text,
  .difficulty-text {
    grid-column: 2; /* right side */
    text-align: right;
  }  

.difficulty-easy {
    background-color: gray; /* silver */
}

.difficulty-medium {
    background-color: #cd7f32; /* bronze */
}

.difficulty-hard {
    background-color: #DAA520; /* gold */
}

.mode-header {
    text-decoration: underline;
    text-underline-offset: 0.25em;
    font-size: 2em;
    text-shadow: 2px 2px 2px black;
}

.boxed {
    background: #4CAF50;
    padding: 16px;
    border-radius: 12px;
    max-width: 90%;
    margin: 0 auto;
    color: white;
    margin-bottom: 20px;
}

.storygap {
    margin-top: 60px;
}