* {
  box-sizing: border-box;
}

body {
  font-family: 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  margin: 0;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  background: linear-gradient(135deg, #f7f7f7 0%, #ffffff 100%);
  min-height: 100vh;
  height: auto;
  overflow-y: auto;
  box-sizing: border-box;
}

/* Summary page specific styling */
body.summary-page {
  height: auto;
  min-height: 100vh;
  justify-content: flex-start;
  padding-top: 40px;
}

h1 {
  color: #2d3e3f;
  font-size: 32px;
  margin-bottom: 30px;
}

#interview-form {
  margin-bottom: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 500px;
}

#interview-setup {
  width: 100%;
  height: 120px;
  padding: 15px;
  margin-bottom: 20px;
  font-size: 16px;
  resize: vertical;
  border: 1px solid #4a90e2;
  border-radius: 5px;
  font-family: inherit;
}

#start-interview {
  font-size: 18px;
  padding: 12px 24px;
  cursor: pointer;
  background-color: #2c5282;
  color: white;
  border: none;
  border-radius: 5px;
  transition: background-color 0.3s ease;
}

#start-interview:hover {
  background-color: #1a365d;
}

#rep-image {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
  flex: 1;
  justify-content: center;
  min-height: 500px;
  max-height: none;
  width: 100%;
}

#rep-image img {
  width: 100%;
  max-width: 900px;
  height: auto;
  max-height: 70vh;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

/* Large screen optimizations */
@media (min-width: 1400px) {
  #rep-image {
    min-height: 700px;
  }
  
  #rep-image img {
    max-width: 1100px;
    max-height: 75vh;
  }
}

@media (min-width: 1200px) and (min-height: 900px) {
  #rep-image {
    min-height: 600px;
  }
  
  #rep-image img {
    max-width: 1000px;
    max-height: 65vh;
  }
}

@media (min-width: 1600px) {
  #rep-image {
    min-height: 750px;
  }
  
  #rep-image img {
    max-width: 1200px;
    max-height: 80vh;
  }
}

/* Responsive adjustments for smaller screens */
@media (max-height: 800px) {
  #rep-image {
    min-height: 400px;
  }
  
  #rep-image img {
    max-height: 40vh;
    max-width: 600px;
  }
}

@media (max-height: 700px) {
  #rep-image {
    min-height: 300px;
    gap: 15px;
  }
  
  #rep-image img {
    max-height: 30vh;
    max-width: 500px;
  }
}

@media (max-width: 768px) {
  #rep-image {
    min-height: 300px;
    gap: 15px;
  }
  
  #rep-image img {
    max-width: 90%;
  }
}

/* Laptop-specific optimizations - only for limited height screens */
@media (min-width: 1024px) and (max-height: 768px) {
  /* Common laptop resolution: 1024x768 or similar aspect ratios */
  body {
    padding: 15px;
  }
  
  #glyphic-logo-container {
    margin-bottom: 10px;
    padding: 5px;
  }
  
  body:not(.summary-page) #glyphic-logo {
    max-width: 160px;
  }
  
  #rep-image {
    min-height: 250px;
    gap: 15px;
  }
  
  #rep-image img {
    max-height: 25vh;
    max-width: 450px;
  }
}

@media (min-width: 1366px) and (max-height: 768px) {
  /* Common laptop resolution: 1366x768 - only for limited height */
  body:not(.summary-page) #glyphic-logo {
    max-width: 180px;
  }
  
  #rep-image img {
    max-width: 500px;
    max-height: 28vh;
  }
}

@media (min-width: 1200px) and (max-height: 900px) and (max-width: 1600px) {
  /* Larger laptops with limited height - but not ultra-wide screens */
  body:not(.summary-page) #glyphic-logo {
    max-width: 190px;
  }
  
  #rep-image {
    min-height: 350px;
  }
  
  #rep-image img {
    max-height: 35vh;
    max-width: 600px;
  }
}

button {
  font-size: 18px;
  padding: 12px 32px;
  cursor: pointer;
  background-color: #2d3e3f;
  color: white;
  border: none;
  border-radius: 8px;
  transition: all 0.3s ease;
  font-weight: 500;
}

button:hover {
  background-color: #1e2b2c;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(45, 62, 63, 0.3);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

#video-container {
  width: 100%;
  max-width: 960px;
  height: calc(100vh - 300px);
  max-height: 600px;
  min-height: 400px;
  margin: 0 0 20px 0;
  overflow: hidden;
  position: relative;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

#video-stream {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: relative;
  z-index: 2;
}

#audio-stream {
  display: none;
}

#loading-spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  background-color: rgba(240, 248, 255, 0.9);
  backdrop-filter: blur(4px);
}

#loading-spinner img {
  width: 80px;
  height: 80px;
  animation: spin 1.5s linear infinite;
}

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

#stream-controls {
  margin: 20px 0;
  display: flex;
  justify-content: center;
}

#end-interview {
  background-color: #2c5282;
  color: white;
  border: none;
  border-radius: 5px;
  padding: 12px 24px;
  font-size: 18px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

#end-interview:hover {
  background-color: #1a365d;
}

#end-interview:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#feedback-container {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 32px;
  background-color: white;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

#feedback-loading-spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100px;
}

#feedback-loading-spinner img {
  width: 50px;
  height: 50px;
  animation: spin 1.5s linear infinite;
}

#feedback-content {
  text-align: center;
}

#feedback-content h2 {
  color: #1a4a7c;
  font-size: 28px;
  margin-bottom: 24px;
  font-weight: 600;
}

#feedback-text {
  text-align: left;
  font-size: 16px;
  line-height: 1.6;
  color: #2d3748;
}

#feedback-text h1, 
#feedback-text h2, 
#feedback-text h3 {
  color: #2c5282;
  margin-top: 24px;
  font-weight: 600;
}

#feedback-text p {
  margin-bottom: 16px;
}

#feedback-text ul, 
#feedback-text ol {
  margin: 16px 0 16px 24px;
}

#feedback-text li {
  margin-bottom: 8px;
}

#feedback-text code {
  background-color: #f7fafc;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Monaco', 'Consolas', monospace;
  font-size: 14px;
}

/* #return-to-start {
  margin-top: 32px;
} */

#summary-container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 20px;
}

#glyphic-logo-container {
  text-align: center;
  margin-bottom: 20px;
  padding: 10px;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}

#glyphic-logo {
  max-width: 300px;
  height: auto;
}

/* Logo styling for main page */
body:not(.summary-page) #glyphic-logo-container {
  margin-bottom: 20px;
  padding: 10px;
}

body:not(.summary-page) #glyphic-logo {
  max-width: 200px;
}

/* Responsive logo styling */
@media (max-width: 1200px) {
  body:not(.summary-page) #glyphic-logo {
    max-width: 180px;
  }
}

@media (max-width: 900px) {
  body:not(.summary-page) #glyphic-logo {
    max-width: 160px;
  }
  
  #glyphic-logo-container {
    margin-bottom: 15px;
    padding: 8px;
  }
}

@media (max-width: 600px) {
  body:not(.summary-page) #glyphic-logo {
    max-width: 140px;
  }
  
  #glyphic-logo-container {
    margin-bottom: 10px;
    padding: 5px;
  }
}

@media (max-height: 700px) {
  /* For smaller laptop screens with limited height */
  body:not(.summary-page) #glyphic-logo {
    max-width: 150px;
  }
  
  #glyphic-logo-container {
    margin-bottom: 10px;
    padding: 5px;
  }
  
  #rep-image {
    min-height: 300px;
  }
}

#summary-content {
  background-color: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(45, 62, 63, 0.1);
  padding: 40px;
  text-align: left;
  border: 1px solid #f0f0f0;
}

#summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

#summary-content h2 {
  color: #2d3e3f;
  font-size: 28px;
  margin: 0;
  font-weight: 600;
  flex: 1;
}

#copy-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background-color: #f0c674;
  color: #2d3e3f;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

#copy-summary:hover {
  background-color: #edb95e;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(240, 198, 116, 0.3);
}

#copy-summary svg {
  flex-shrink: 0;
}

@media (max-width: 600px) {
  #summary-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  
  #summary-content h2 {
    text-align: center;
  }
}

#summary-text {
  font-size: 16px;
  line-height: 1.6;
  color: #2d3e3f;
  margin-bottom: 32px;
}

#summary-text h1,
#summary-text h2,
#summary-text h3,
#summary-text h4 {
  color: #2d3e3f;
  margin-top: 24px;
  margin-bottom: 12px;
  font-weight: 600;
}

#summary-text h1 {
  font-size: 24px;
  border-bottom: 2px solid #f0c674;
  padding-bottom: 8px;
}

#summary-text h2 {
  font-size: 20px;
}

#summary-text h3 {
  font-size: 18px;
}

#summary-text strong {
  color: #2d3e3f;
  font-weight: 600;
}

#summary-text p {
  margin-bottom: 16px;
}

#summary-text ul,
#summary-text ol {
  margin: 16px 0;
  padding-left: 24px;
}

#summary-text li {
  margin-bottom: 8px;
}

#summary-text blockquote {
  border-left: 4px solid #f0c674;
  margin: 16px 0;
  padding: 8px 16px;
  background-color: #fefdf8;
  font-style: italic;
}

#summary-text code {
  background-color: #f7fafc;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Monaco', 'Consolas', monospace;
  font-size: 14px;
}

#summary-text pre {
  background-color: #f7fafc;
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 16px 0;
}

#summary-text pre code {
  background: none;
  padding: 0;
}

#summary-actions {
  display: flex;
  flex-direction: row;
  gap: 16px;
  margin-bottom: 32px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  width: 100%;
}

#summary-container #return-to-start,
#summary-container #book-call-link,
#summary-container #glyphic-home-link {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 20px;
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.3s ease;
  cursor: pointer;
  text-align: center;
  flex: 0 0 auto;
  height: 56px;
  line-height: 1.2;
  box-sizing: border-box;
  white-space: nowrap;
}

#summary-container #return-to-start {
  background-color: #2d3e3f;
  color: white;
  border: none;
}

#summary-container #return-to-start:hover {
  background-color: #1e2b2c;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(45, 62, 63, 0.3);
}

#summary-container #book-call-link {
  background-color: #7bc175;
  color: white;
}

#summary-container #book-call-link:hover {
  background-color: #6bb165;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(123, 193, 117, 0.3);
}

#summary-container #glyphic-home-link {
  background-color: #f0c674;
  color: #2d3e3f;
  border: 2px solid #f0c674;
}

#summary-container #glyphic-home-link:hover {
  background-color: #edb95e;
  border-color: #edb95e;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(240, 198, 116, 0.3);
}

@media (max-width: 600px) {
  #summary-actions {
    flex-direction: column;
    align-items: stretch;
  }
  
  #summary-container #return-to-start,
  #summary-container #book-call-link,
  #summary-container #glyphic-home-link {
    width: 100%;
    min-width: auto;
  }
}

#user-info-form {
  width: 100%;
  max-width: 400px;
  margin-top: 20px;
  padding: 20px;
  background-color: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(45, 62, 63, 0.1);
  border: 1px solid #f0f0f0;
  text-align: center;
  flex-shrink: 0;
}

#start-call {
  display: block;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: #2d3e3f;
  font-weight: 500;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  font-size: 16px;
  color: #2d3e3f;
  background-color: #fafafa;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #2d3e3f;
  box-shadow: 0 0 0 3px rgba(45, 62, 63, 0.1);
}

.form-group input::placeholder {
  color: #a0aec0;
}

.form-group select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%232d3748' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 40px;
}