body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    background-color: #f8f9fa;
    color: #343a40;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.page-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    width: 100%;
    margin: 0 auto;
}

header {
    background-color: #fff;
    color: #343a40;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e9ecef;
    width: 100%;
    box-sizing: border-box;
}

.logo {
    font-size: 1.5em;
    font-weight: bold;
    color: #007bff;
    text-decoration: none;
    cursor: pointer;
}

.logo:hover {
  color: #0056b3;
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
}

nav ul li {
    margin-left: 20px;
}

nav ul li a {
    text-decoration: none;
    color: #495057;
    font-weight: 500;
    transition: color 0.3s ease;
}

nav ul li a:hover {
    color: #007bff;
}

main.container {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin: 20px auto;
    width: 80%;
    max-width: 960px;
    flex: 1;
}

#input-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

label {
    display: block;
    font-weight: bold;
    color: #495057;
}

textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 0;
    border: 1px solid #ced4da;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 16px;
    font-family: inherit;
    min-height: 200px;
    resize: none;
}

select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 16px;
    font-family: inherit;
}

button {
    background-color: #007bff;
    color: white;
    padding: 14px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
    align-self: flex-start;
    margin-top: 20px;
}

button:hover {
    background-color: #0056b3;
}

#results-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #e9ecef;
}

.hidden {
    display: none;
}

#score-breakdown h3, #graph-section h3, #overall-feedback h3 {
    color: #343a40;
    margin-bottom: 15px;
}

.scores-list {
    list-style: none;
    padding: 0;
}

.scores-list li {
    margin-bottom: 10px;
    color: #495057;
    font-weight: 500;
}

#graph-section {
    display: flex; /* Keep flexbox for horizontal layout */
    flex-wrap: nowrap; /* Prevent wrapping to ensure all in one row */
    gap: 10px; /* Reduce the gap between graphs */
    margin-top: 20px; /* Add some top margin below the title */
}

.graph-container {
    flex: 1; /* Distribute space equally */
    min-width: 100px; /* Adjust minimum width to allow more to fit */
    height: 80px; /* Reduce the height of the graphs */
    border: 1px solid #e9ecef;
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.8em; /* Adjust font size inside the graph */
    color: white; /* Make score text white for visibility on blue */
    background-color: #007bff; /* Set a background color for the bar */
    position: relative; /* For positioning the label */
    overflow: hidden; /* Prevent content from overflowing if width is small */
}

.graph-container::after {
    content: attr(data-label); /* Get the data-label attribute */
    position: absolute;
    bottom: -20px; /* Position label below the bar */
    left: 50%;
    transform: translateX(-50%);
    color: #555;
    font-size: 0.9em;
}

#graph-section > h3 {
    flex-basis: 100%; /* Make the "Score Visualization" title take full width */
    margin-bottom: 10px;
    text-align: left; /* Align title to the left */
}

#graph-section > div {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#graph-section > div > .graph-container {
    margin-bottom: 5px; /* Space between graph and label */
}

#graph-section > div > span {
    font-size: 0.9em;
    color: #555;
}

footer {
    background-color: #343a40; /* Dark gray background */
    color: #f8f9fa; /* Light text */
    text-align: center;
    padding: 20px;
    margin-top: auto;
    font-size: 0.9em;
}

footer a {
    color: #adb5bd; /* Subtle link color */
    text-decoration: none;
    margin: 0 10px;
}

footer a:hover {
    color: #ffffff; /* Brighter on hover */
    text-decoration: underline;
}

#loading-spinner {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2em;
    color: #007bff;
  }
  
  .spinner {
    border: 6px solid #f3f3f3;
    border-top: 6px solid #007bff;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
  }
  
  @keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
  }
  .hidden {
    display: none !important;
  }

#total-score-section {
  margin-top: 20px;
}

.score-highlight {
  font-size: 2em;
  font-weight: bold;
  color: #007bff;
}

.graph-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 200px; /* sets visual max height */
    min-width: 80px;
    margin: 0 5px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    position: relative;
    overflow: hidden;
}
.bar-fill {
    background-color: #007bff;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    color: white;
    font-size: 0.9em;
    font-weight: bold;
    border-radius: 6px 6px 0 0;
    transition: height 0.6s ease-in-out;
}
.bar-label {
    margin-top: 6px;
    font-size: 0.9em;
    color: #444;
    text-align: center;
}

.graph-card {
    width: 80%;
    max-width: 900px;
    margin: 40px auto;
    background-color: white;
    border: 1px solid #eaeaea;
    border-radius: 12px;
    padding: 30px 40px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  }
  
  .graph-heading {
    font-size: 1.5em;
    font-weight: 600;
    color: #343a40;
    margin-bottom: 20px;
    text-align: left;
  }
  
  .chart-container {
    width: 100%;
    display: flex;
    justify-content: center;
  }
  
  #scoreChart {
    max-width: 700px;
    width: 100%;
    height: 300px;
  }

  #score-section {
    display: flex;
    justify-content: space-between;
    gap: 40px;
    align-items: flex-start;
    margin-top: 30px;
    flex-wrap: wrap;
  }
  
  #score-breakdown {
    flex: 1;
    min-width: 250px;
  }
  
  .mini-chart-container {
    flex: 1;
    min-width: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  
  #scoreChart {
    max-width: 100%;
    height: auto;
  }
  

  #rewrite-section {
    margin-top: 30px;
    text-align: left;
  }
  
  #rewrite-button {
    background-color: #007bff;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
  }
  
  #rewrite-button:hover {
    background-color: #0056b3;
  }


  #qa-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
  }
  
  #qa-section h3 {
    margin-bottom: 10px;
    color: #343a40;
  }
  
  .qa-item {
    margin-bottom: 20px;
  }
  
  .qa-item label {
    font-weight: bold;
    display: block;
    margin-bottom: 6px;
  }
  
  .qa-item textarea {
    width: 100%;
    min-height: 80px;
    padding: 10px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
  }

  #submit-answers-button {
    background-color: #007bff;
    color: white;
    padding: 10px 20px;
    font-size: 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 20px;
  }
  
  #submit-answers-button:hover {
    background-color: #0056b3;
  }
  
  #refined-prompt-section {
    margin-top: 30px;
    background-color: #f8f9fa;
    padding: 20px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
  }
  
  #refined-prompt-output {
    white-space: pre-wrap;
    font-family: monospace;
    color: #212529;
  }

.button {
  display: inline-block;
  padding: 0.5rem 1rem;
  background-color: #007bff;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  margin-top: 1rem;
  cursor: pointer;
}

.button:hover {
  background-color: #0056b3;
}




.hidden { display: none !important; }