/* Base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #0d5f89;
  --secondary-color: #2c3e50;
  --accent-color: #3498db;
  --success-color: #2ecc71;
  --warning-color: #f1c40f;
  --danger-color: #e74c3c;
  --light-color: #f8f9fa;
  --dark-color: #2c3e50;
  --border-color: #dee2e6;
  --text-color: #2c3e50;
  --text-light: #6c757d;
  --spacing-unit: 1rem;
  --header-height: 60px;
  --tab-height: 50px;
  --border-radius: 8px;
  --box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Login page styles */
.login-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-color: #f5f7fa;
}

.login-container {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 400px;
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-header img {
  height: 40px;
  margin-bottom: 1rem;
}

.login-header h1 {
  font-size: 1.5rem;
  color: #0d5f89;
}

.login-form .form-group {
  margin-bottom: 1rem;
}

.login-form label {
  display: block;
  margin-bottom: 0.5rem;
  color: #2c3e50;
}

.login-form input {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
}

.login-form input:focus {
  border-color: #0d5f89;
  outline: none;
}

.login-button {
  width: 100%;
  padding: 0.8rem;
  background-color: #0d5f89;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: background-color 0.2s;
}

.login-button:hover {
  background-color: #0b4f73;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f5f7fa;
  color: #333;
  line-height: 1.6;
  height: 100vh;
}

/* App container */
.main-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--header-height));
  overflow: hidden;
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 25px;
  background-color: #0d5f89; /* Bank of Ireland blue */
  color: white;
  border-bottom: 1px solid #ddd;
}

.logo {
  display: flex;
  align-items: center;
  gap: 15px;
}

.boi-logo {
  height: 32px;
  width: auto;
  filter: brightness(0) invert(1); /* Make logo white */
}

.logo h1 {
  font-size: 20px;
  font-weight: 600;
  color: #ffffff;
  border-left: 1px solid rgba(255, 255, 255, 0.3);
  padding-left: 15px;
}

.conversation-info {
  display: flex;
  align-items: center;
  gap: 15px;
}

.conversation-id-container {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
  background-color: rgba(255, 255, 255, 0.1);
  padding: 6px 12px;
  border-radius: 20px;
}

.conversation-id-container .label {
  color: #bdc3c7;
  font-weight: 500;
}

.conversation-id-container .value {
  color: #3498db;
  font-family: monospace;
  font-weight: bold;
}

.status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  background-color: rgba(255, 255, 255, 0.1);
  padding: 6px 12px;
  border-radius: 20px;
}

.status i {
  font-size: 10px;
  color: #2ecc71;
}

.status i.error {
  color: #e74c3c;
}

.logout-button {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  background-color: rgba(255, 255, 255, 0.1);
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: background-color 0.2s;
  border: none;
  color: inherit;
  font-family: inherit;
}

.logout-button:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.logout-button i {
  font-size: 14px;
}

.logout-button:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}

/* Main content */
.app-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

/* Speaker settings */
.speaker-settings {
  background-color: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
  padding: 15px 20px;
}

.settings-container {
  max-width: 800px;
  margin: 0 auto;
}

.settings-container h3 {
  font-size: 16px;
  font-weight: 600;
  color: #0d5f89;
  margin-bottom: 12px;
}

.speaker-inputs {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  align-items: flex-end;
}

.speaker-input {
  flex: 1;
  min-width: 200px;
}

.speaker-input label {
  display: block;
  font-size: 14px;
  margin-bottom: 5px;
  color: #495057;
}

.speaker-input input {
  width: 100%;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  transition: background-color 0.2s;
}

.analyze-button:hover:not(.disabled) {
  background-color: #0b4f73;
}

.analyze-button.disabled,
.analyze-button:disabled {
  background-color: #ccc;
  cursor: not-allowed;
  opacity: 0.7;
}

.analyze-button i {
  font-size: 16px;
}

.analysis-content {
  margin-top: 1rem;
  flex: 1;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.analysis-section {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e9ecef;
}

.analysis-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.analysis-section h4 {
  color: #0d5f89;
  margin-bottom: 10px;
  font-size: 16px;
}

.analysis-section p {
  color: #495057;
  margin: 0;
  line-height: 1.5;
}

.analysis-section ul {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

.analysis-section li {
  padding: 8px 0;
  border-bottom: 1px solid #e9ecef;
  color: #495057;
}

.analysis-section li:last-child {
  border-bottom: none;
}

/* Main container */
.main-container {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  height: calc(100vh - var(--header-height));
  max-height: calc(100vh - var(--header-height));
  overflow: hidden;
}

/* Conversation container */
.conversation-container {
  flex: 2;
  display: flex;
  flex-direction: column;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  position: relative;
  padding-bottom: 80px;
}

.currently-transcribing {
  background-color: var(--light-color);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: var(--spacing-unit);
  margin-bottom: var(--spacing-unit);
  position: sticky;
  top: 0;
  z-index: 1;
  width: 100%;
}

/* Tab Navigation */
.tab-navigation {
  display: flex;
  background-color: var(--light-color);
  border-bottom: 1px solid var(--border-color);
  height: var(--tab-height);
  padding: 0 var(--spacing-unit);
}

.tab-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 var(--spacing-unit);
  height: 100%;
  border: none;
  background: none;
  color: var(--text-light);
  font-size: 1rem;
  cursor: pointer;
  position: relative;
  transition: all 0.3s ease;
}

.tab-button:hover {
  color: var(--primary-color);
}

.tab-button.active {
  color: var(--primary-color);
  font-weight: 500;
}

.tab-button.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--primary-color);
}

/* Tab Content */
.tab-content {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.tab-pane {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transform: translateX(20px);
  transition: all 0.3s ease;
}

.tab-pane.active {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

.analysis-container {
  flex: 1;
  padding: 1rem;
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  overflow-y: auto;
  height: calc(100vh - 96px); /* Full height minus header and padding */
  min-width: 300px;
  max-width: 400px;
  display: flex;
  flex-direction: column;
}

.analysis-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e9ecef;
}

.analysis-header h3 {
  margin: 0;
  color: #0d5f89;
  font-size: 1.2rem;
}

.analysis-buttons {
  display: flex;
  gap: 10px;
  align-items: center;
}

.analyze-button,
.download-button {
  padding: 8px 16px;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  transition: all 0.2s;
}

.analyze-button {
  background-color: #0d5f89;
}

.analyze-button:hover {
  background-color: #0b4f73;
}

.download-button {
  background-color: #27ae60;
}

.download-button:hover {
  background-color: #219a52;
}

.analyze-button:disabled,
.download-button:disabled {
  background-color: #ccc;
  cursor: not-allowed;
  opacity: 0.7;
}

.analyze-button i,
.download-button i {
  font-size: 16px;
}

.transcript-container {
  flex: 1;
  overflow-y: auto;
  padding: var(--spacing-unit);
  position: relative;
  width: 100%;
}

/* Welcome message */
.welcome-message {
  text-align: center;
  padding: 30px;
  color: #7f8c8d;
}

.welcome-message h2 {
  font-size: 24px;
  margin-bottom: 10px;
  color: #2c3e50;
}

.welcome-message p {
  font-size: 16px;
  max-width: 500px;
  margin: 0 auto;
}

/* Current transcription container at the top */
.current-container {
  background-color: #f8f9fa;
  border: 1px solid #e9ecef;
  border-left: 4px solid #0d5f89; /* Bank of Ireland blue */
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 25px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 10px;
  z-index: 10;
  width: 100%;
}

.current-header {
  font-size: 14px;
  font-weight: 600;
  color: #0d5f89; /* Bank of Ireland blue */
  margin-bottom: 8px;
  display: flex;
  align-items: center;
}

.current-header::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: #0d5f89; /* Bank of Ireland blue */
  border-radius: 50%;
  margin-right: 8px;
  animation: pulse-blue 1.5s infinite;
}

@keyframes pulse-blue {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(13, 95, 137, 0.7); /* Bank of Ireland blue */
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(13, 95, 137, 0); /* Bank of Ireland blue */
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(13, 95, 137, 0); /* Bank of Ireland blue */
  }
}

.current-text {
  font-size: 16px;
  line-height: 1.5;
  color: #333;
  font-style: italic;
  padding: 5px 0;
  min-height: 24px; /* Ensure container has height even when empty */
}

.current-text.placeholder {
  color: #95a5a6;
  font-style: italic;
}

.current-timestamp {
  font-size: 12px;
  color: #95a5a6;
  text-align: right;
}

.transcript-separator {
  height: 1px;
  background-color: #e9ecef;
  margin: 20px 0;
  position: relative;
}

.transcript-separator::after {
  content: 'Transcript';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background-color: white;
  padding: 0 10px;
  font-size: 12px;
  color: #95a5a6;
}

.final-transcriptions {
  padding-top: 10px;
}

/* Message styles */
.message {
  margin-bottom: 20px;
  padding: 15px;
  border-radius: 8px;
  max-width: 80%;
  position: relative;
}

.speaker-message {
  background-color: #ecf0f1;
  margin-left: auto;
}

/* Agent message styling */
.message.agent {
  background-color: #e6f3f8;
  border-left: 4px solid #0d5f89;
  margin-right: auto;
}

/* Customer message styling */
.message.customer {
  background-color: #f0f4f8;
  border-left: 4px solid #6c757d;
  margin-left: auto;
}

/* Unknown speaker styling */
.message.unknown {
  background-color: #f8f9fa;
  border-left: 4px solid #adb5bd;
  margin-left: auto;
}

.current-message {
  display: none; /* Hide current messages in the main transcript as they're shown at the top */
}

.message-speaker {
  font-weight: bold;
  margin-bottom: 5px;
  color: #2c3e50;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.speaker-label {
  flex: 1;
}

.edit-speaker-button {
  background: transparent;
  border: none;
  color: #0d5f89;
  cursor: pointer;
  font-size: 12px;
  padding: 2px 5px;
  opacity: 0.5;
  transition: opacity 0.2s ease;
}

.message:hover .edit-speaker-button {
  opacity: 1;
}

.message-text {
  font-size: 16px;
  word-wrap: break-word;
}

.message-timestamp {
  font-size: 12px;
  color: #95a5a6;
  text-align: right;
  margin-top: 5px;
}

/* Controls container */
.controls.main-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: 100%;
}

.controls-container {
  display: flex;
  gap: 10px;
  padding: 15px;
  background-color: #f8f9fa;
  border-top: 1px solid #e9ecef;
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: auto;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  z-index: 100;
  justify-content: center;
}

.control-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  padding: 10px;
  border-radius: 5px;
  transition: background-color 0.2s;
}

.control-button:hover {
  background-color: #e0e6ed;
}

.control-button i {
  font-size: 20px;
  color: #0d5f89; /* Bank of Ireland blue */
}

.control-button span {
  font-size: 12px;
  font-weight: 500;
}

/* Record button */
.record-button-container {
  position: relative;
}

.record-button {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

.outline {
  display: none;
}

.recording .outline {
  display: block;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 2px solid rgba(231, 76, 60, 0.5);
  animation: pulse 2s;
  animation-timing-function: ease-out;
  animation-iteration-count: infinite;
  position: absolute;
}

.button {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #0d5f89; /* Bank of Ireland blue */
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.button i {
  font-size: 24px;
  color: white;
}

.recording .button {
  background: #e74c3c;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

#delayed {
  animation-delay: 0.5s;
}

/* Modal for full transcript */
.modal-container {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background-color: white;
  width: 80%;
  max-width: 800px;
  max-height: 90vh;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  justify-content: space-between;
  align-items: center;
}

.m-analysis-container {
  width: 100%;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: sticky;
  top: 0;
  z-index: 50;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background-color: #2c3e50;
  color: white;
  border-bottom: 1px solid #ddd;
}

.modal-header h2 {
  margin: 0;
  font-size: 20px;
}

.close-button {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  max-height: 60vh;
}

.modal-footer {
  padding: 15px 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid #ddd;
  background-color: #f5f7fa;
}

.action-button {
  padding: 8px 16px;
  background-color: #0d5f89; /* Bank of Ireland blue */
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s;
}

.action-button:hover {
  background-color: #084567; /* Darker Bank of Ireland blue */
}

.full-transcript {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.transcript-entry {
  padding: 12px;
  border-radius: 6px;
  background-color: #f8f9fa;
  border-left: 4px solid #3498db;
}

.transcript-speaker {
  font-weight: bold;
  margin-bottom: 5px;
  color: #2c3e50;
}

.transcript-text {
  font-size: 16px;
  line-height: 1.5;
  color: #333;
  margin-bottom: 5px;
}

.transcript-time {
  font-size: 12px;
  color: #95a5a6;
  text-align: right;
}

.empty-transcript {
  text-align: center;
  color: #7f8c8d;
  font-style: italic;
  padding: 20px;
}

/* Footer */
.app-footer {
  padding: 15px;
  text-align: center;
  font-size: 14px;
  background-color: #0d5f89; /* Bank of Ireland blue */
  color: #ecf0f1;
}

.app-footer a {
  color: #ffffff;
  font-weight: bold;
  text-decoration: none;
}

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

/* Responsive adjustments */
@media (max-width: 768px) {
  .app-header {
    flex-direction: column;
    gap: 10px;
    padding: 15px;
  }
  
  .message {
    max-width: 90%;
  }
  
  .controls-container {
    padding: 10px;
  }
  
  .button {
    width: 50px;
    height: 50px;
  }
}
