/* CSS Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  font-family: 'Segoe UI', 'Roboto', 'Arial', sans-serif;
  background: #f7f8fa;
  color: #222;
  line-height: 1.6;
  min-height: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 900px;
  margin: 40px auto;
  padding: 24px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.07);
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  margin-bottom: 0.7em;
}

a {
  color: #3789B1;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: 1em;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  padding: 0.5em 1em;
  outline: none;
  transition: border 0.2s;
}
button:focus, input:focus, select:focus, textarea:focus {
  border-color: #3789B1;
}

button {
  background: #3789B1;
  color: #fff;
  border: none;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.2s;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

button:hover {
  background: #2c6d8c;
  animation: pulse 1s ease-in-out infinite;
}

/* Calm Communicator custom styles */
body.calm-communicator {
  background: linear-gradient(135deg, #e0f7fa 0%, #fce4ec 100%);
  background-attachment: fixed;
  min-height: 100%;
  height: 100%;
}

h1.calm-communicator-title {
  text-align: center;
  color: #3789B1 !important;
  margin-top: 16px;
  margin-bottom: 5px;
  font-size: 2.5rem;
  letter-spacing: 1px;
  position: relative;
  z-index: 1;
}

#main-grid {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin: 48px auto;
  max-width: 900px;
  position: relative;
  padding-right: 320px; /* Reserve space for history */
  flex: 1;
}

#buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin: 0;
  max-width: 900px;
  justify-content: center;
  min-height: 400px;
  min-width: 600px;
}

#history {
  position: fixed;
  top: 250px;
  right: 20px;
  width: 225px;
  height: 47vh;
  background: #f8fafc;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  padding: 24px 16px;
  font-size: 1.2rem;
  color: #333;
  display: flex;
  flex-direction: column;
}

#history h2 {
  font-size: 1.1rem;
  margin-bottom: 0.7em;
  color: #3789B1;
  text-align: left;
  flex-shrink: 0;
}

#history-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
  flex-grow: 1;
  overflow-y: auto; /* Make the list scrollable */
  max-height: 350px; /* Adjust as needed for your design */
  padding-right: 8px; /* Optional: for scrollbar space */
}

#history-list li {
  overflow-wrap: break-word;
  padding: 8px 12px;
  margin: 4px 0;
  border-radius: 8px;
  transition: all 0.3s ease;
}

#history-list li.history-new {
  overflow-wrap: break-word;
  background-color: #f0f9ff;
  animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Style the scrollbar for better appearance */
#history-list::-webkit-scrollbar {
  width: 8px;
}

#history-list::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

#history-list::-webkit-scrollbar-thumb {
  background: #3789B1;
  border-radius: 4px;
}

#history-list::-webkit-scrollbar-thumb:hover {
  background: #2c6d8c;
}

.calm-btn {
  font-size: clamp(1.2rem, 2vw, 1.7rem);
  padding: 0.2em 0.5em;
  border-radius: 2em;
  background: #fffbe7;
  color: #333;
  border: 2px solid #ffe082;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  margin: 0.5em;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s, border 0.2s;
  outline: none;
  font-family: inherit;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 180px;
  max-width: 320px;
  min-height: 70px;
  user-select: none;
  white-space: normal;
  text-align: center;
}

.calm-btn:focus, .calm-btn:hover {
  background: #fffde7;
  border-color: #ffd54f;
  box-shadow: 0 4px 16px rgba(55, 137, 177, 0.10);
  animation: pulse 1s ease-in-out infinite;
}

.spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 120px;
  width: 100%;
  grid-column: 1 / -1;
  justify-self: center;
}

.spinner-circle {
  border: 8px solid #e0e7ef;
  border-top: 8px solid #3789B1;
  border-radius: 50%;
  width: 64px;
  height: 64px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Media Queries */
@media (max-width: 1000px) {
  #main-grid {
    flex-direction: column;
    padding-right: 0;
    max-width: 98vw;
    margin-top: 20px;
    margin-bottom: 20px;
  }
  
  #buttons {
    grid-template-columns: repeat(2, 1fr);
    max-width: 100%;
    justify-self: center;
    min-width: 280px;
  }
  
  #history {
    position: relative !important;
    top: auto !important;
    right: 0 !important;
    height: auto !important;
    width: 300px;
    min-width: 300px;
    max-width: 100vw;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
    margin-top: 32px;
    padding-right: 40px;
    flex-shrink: 0;
  }
  
  .calm-btn {
    padding-left: 0.3em;
    padding-right: 0.3em;
    min-width: 80px;
  }
  
  .main-content {
    padding: 1.2em 0.7em;
    margin-top: 1.2em;
    margin-bottom: 1.2em;
  }
  
  h1.calm-communicator-title {
    font-size: 2rem;
    margin-top: 0.4em;
    margin-bottom: 0.4em;
  }
  
  .navbar {
    flex-direction: column;
    gap: 0.7em;
    padding: 0.7em 1em;
  }
  
  footer {
    padding: 1.2em 0 1em 0;
    font-size: 1em;
  }
}

@media (max-width: 600px) {
  .special-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .action-button {
    font-size: 0.95rem;
    padding: 4px 8px;
  }
  footer {
    font-size: 0.85em;
  }
}

.history-relative {
  position: relative;
}

.action-buttons {
  display: flex;
  flex-direction: row;
  gap: 8px;
  margin-bottom: 12px;
  justify-content: flex-start;
  width: 100%;
}

.action-button {
  cursor: pointer;
  font-size: 1.1rem;
  background: #e3f2fd;
  border-radius: 6px;
  padding: 6px 12px;
  z-index: 2;
  transition: background 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.action-button:hover, .action-button:focus {
  background: #dbeafe;
}

.print-icon {
  position: absolute;
  top: 18px;
  right: 18px;
  cursor: pointer;
  font-size: 1.1rem;
  background: #e3f2fd;
  border-radius: 6px;
  padding: 6px 12px;
  z-index: 2;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.print-icon:hover, .print-icon:focus {
  background: #dbeafe;
}

/* Navigation bar styles */
.navbar {
  background: #e3f2fd;
  padding: 1em 2em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #cfd8dc;
  gap: 2em;
  border-radius: 0 0 14px 14px;
  box-shadow: 0 2px 8px rgba(55, 137, 177, 0.04);
  margin-bottom: 1.5em;
  position: relative;
}

.nav-logo {
  height: 50px;
  width: auto;
  display: block;
}

.navbar a {
  color: #3789B1;
  text-decoration: none;
  font-weight: bold;
  font-size: 1.1em;
  padding: 0.4em 1.1em;
  border-radius: 6px;
  transition: background 0.2s, color 0.2s;
}

.navbar a:hover {
  background: #dbeafe;
  color: #2c6d8c;
}

/* Hamburger menu styles */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 21px;
  cursor: pointer;
  z-index: 100;
}

.hamburger span {
  display: block;
  height: 3px;
  width: 100%;
  background-color: #3789B1;
  border-radius: 3px;
  transition: all 0.3s ease;
}

.nav-links {
  display: flex;
  gap: 2em;
  align-items: center;
}

/* Main content area */
.main-content {
  max-width: 700px;
  margin: 2.5em auto;
  padding: 0 2em 2em 2em;
  text-align: left;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 4px 24px rgba(55, 137, 177, 0.07);
  flex: 1;
  width: 100%;
}

.main-content p {
  margin-bottom: 1em;
  font-size: 1.1rem;
}

.main-content ul {
  list-style-position: inside;
  margin-bottom: 1em;
  padding-left: 1em;
}

.main-content li {
  font-size: 1.1rem;
  margin-bottom: 0.5em;
  line-height: 1.6;
}

.main-content h1:not(.calm-communicator-title), 
.main-content h2 {
  margin-top: 1.5em;
  margin-bottom: 1em;
}

/* Footer styles */
footer {
  background: #f8fafc;
  padding: 2em 0;
  margin-top: auto;
  text-align: left;
}

.footer-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  text-align: left;
}

.footer-column {
  flex: 1;
  text-align: left;
}

.footer-column a { 
  color: #3789B1; 
  text-decoration: none; 
}

.footer-column a:hover { 
  text-decoration: underline; 
}

@media (max-width: 600px) {
  .footer-content {
    grid-template-columns: 1fr;
    gap: 1em;
  }
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0px;
}

@media (max-width: 900px) {
  .navbar {
    position: relative;
    justify-content: flex-start;
    padding: 1em;
  }
  .hamburger {
    display: flex;
    position: relative;
    z-index: 2;
    margin: 0;
    padding: 0;
  }
  .nav-logo {
    position: absolute;
    left: 1em;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
    padding: 0;
    height: 40px;
  }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #e3f2fd;
    flex-direction: column;
    padding: 1em;
    gap: 1em;
    border-radius: 0 0 14px 14px;
    box-shadow: 0 4px 8px rgba(55, 137, 177, 0.08);
    z-index: 99;
  }
  .nav-links.active {
    display: flex;
  }
  h1.calm-communicator-title {
    font-size: 1rem;
    margin-top: 0;
    margin-bottom: 0em;
  }
  #buttons {
    gap: 4px;
  }
}

/* Styles for screens between 900px and 1000px */
@media (min-width: 900px) and (max-width: 1000px) {
  .navbar {
    padding: 1.2em 1.5em;
    justify-content: space-between;
  }
  
  .nav-logo {
    position: absolute;
    left: 1em;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
    padding: 0;
    height: 40px;
  }
  
  .nav-links {
    gap: 1.5em;
    position: static;
    display: flex;
    flex-direction: row;
    background: none;
    box-shadow: none;
    padding: 0;
  }
  
  .navbar a {
    font-size: 1em;
    padding: 0.3em 0.9em;
  }
  
  h1.calm-communicator-title {
    font-size: 2.2rem;
  }
}

.footer-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-list li {
  margin-bottom: 0.5em;
}

.footer-list li:last-child {
  margin-bottom: 0;
}

.special-row .calm-btn {
  border-color: #3789B1;
}

.input-row .calm-btn {
  border-color: #166534;
}

@media (min-width: 1000px) {
  #history {
    min-width: 225px;
    width: clamp(225px, 30vw, 400px);
    max-width: 100vw;
  }
}

/* Table Styles */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 2em 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  background: white;
}

thead {
  background: #f0f9ff;
}

th {
  padding: 1em;
  text-align: left;
  font-weight: 600;
  color: #3789B1;
  border-bottom: 2px solid #e0f7fa;
}

td {
  padding: 1em;
  border-bottom: 1px solid #e0f7fa;
  vertical-align: top;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: #f8fafc;
}

/* Code block styling within tables */
td code {
  background: #f0f9ff;
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.9em;
  color: #3789B1;
}

.feature-image {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin: 2rem auto;
  display: block;
  width: 100%;
  max-width: 600px;
}

@media (max-width: 768px) {
  .feature-image {
    max-width: 90%;
    margin: 1.5rem auto;
  }
}

@media (max-width: 480px) {
  .feature-image {
    max-width: 100%;
    margin: 1rem auto;
    border-radius: 6px;
  }
} 