/* Novel Tech page specific styles */

/* Import learn.css base styles */
@import url('learn.css');

/* Use learn.css button styling with layout improvements */
.demo button {
  padding: 5px 10px;
  cursor: pointer;
  background: var(--bg-color);
  color: var(--text-color);
  border: 1px solid var(--border-color);
  font-family: inherit;
  font-size: 14px;
  transition: all 0.2s;
  display: block;
  margin: 10px auto;
}

.demo button:hover {
  background: var(--text-color);
  color: var(--bg-color);
  border-color: var(--text-color);
}

.demo button:focus {
  outline: 2px solid var(--link-color);
  outline-offset: 2px;
}

.demo button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.demo button:disabled:hover {
  background: var(--bg-color);
  color: var(--text-color);
  border-color: var(--border-color);
}

/* Left align all demo text */
.demo {
  text-align: left;
}

.demo-note {
  text-align: left;
}

/* Machine Vision Demo */
.portal-simulator {
  border: 2px solid var(--border-color);
  border-radius: 4px;
  background: var(--bg-color);
  margin-bottom: 15px;
}

.portal-header {
  background: #0066cc;
  color: white;
  padding: 10px;
  font-weight: bold;
}

body.dark-mode .portal-header {
  background: #004499;
}

.portal-content {
  padding: 15px;
  position: relative;
  overflow: hidden;
}

.portal-content.scanning::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 102, 204, 0.3), transparent);
  animation: scan 2s linear infinite;
}

@keyframes scan {
  to { left: 100%; }
}

.patient-info {
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

.test-results h5 {
  margin: 10px 0;
}

.lab-result {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 14px;
}

.test-name {
  font-weight: bold;
}

.test-status {
  color: #2d5016;
  font-weight: bold;
}

.test-date {
  color: var(--muted-color);
  font-size: 12px;
}

.proof-display {
  margin-top: 20px;
}

.proof-display pre {
  font-size: 12px;
  overflow-x: auto;
  background: var(--code-bg);
  padding: 10px;
  border: 1px solid var(--border-color);
}

/* API Demo */
.api-flow {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 20px 0;
  flex-wrap: wrap;
  gap: 10px;
}

.api-step {
  text-align: center;
  flex: 1;
  min-width: 80px;
  margin: 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.api-step .step-icon {
  width: 40px;
  height: 40px;
  line-height: 40px;
  text-align: center;
  border-radius: 50%;
  background: var(--border-color);
  color: var(--text-color);
  margin: 0 auto 8px;
  font-weight: bold;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.api-step.active .step-icon {
  background: #0066cc;
  color: white;
  animation: pulse 1s infinite;
}

.api-step.complete .step-icon {
  background: #2d5016;
  color: white;
}

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

.api-step .step-text {
  font-size: 12px;
  text-align: center;
  width: 100%;
}

.provider-select {
  margin-top: 15px;
  text-align: center;
}

.provider-select select {
  display: block;
  margin: 0 auto 10px;
  padding: 5px;
  background: var(--bg-color);
  color: var(--text-color);
  border: 1px solid var(--border-color);
  width: 200px;
}

/* AI Demo */
.document-demo {
  text-align: left;
}

.doc-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  margin-bottom: 15px;
  font-size: 18px;
  font-weight: bold;
}

.icon-document {
  color: var(--muted-color);
}

.icon-warning {
  color: #8b5a2b;
}

.icon-storage, .icon-trash, .icon-check {
  transition: all 0.3s;
}

.doc-preview-content {
  border: 1px solid var(--border-color);
  padding: 15px;
  margin: 10px 0;
  background: var(--bg-color);
  font-family: monospace;
  font-size: 14px;
  text-align: left;
}

.storage-indicator {
  margin-top: 10px;
  padding: 10px;
  background: rgba(139, 90, 43, 0.08);
  border: 1px solid rgba(139, 90, 43, 0.2);
  border-radius: 4px;
  text-align: left;
  font-weight: bold;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
}

.storage-indicator svg {
  flex-shrink: 0;
}

.storage-indicator.deleted {
  background: rgba(45, 80, 22, 0.1);
  border-color: rgba(45, 80, 22, 0.3);
  color: #2d5016;
  font-weight: bold;
}

.progress-bar {
  width: 100%;
  height: 20px;
  background: var(--border-color);
  border-radius: 10px;
  overflow: hidden;
  margin-top: 10px;
}

.progress-fill {
  height: 100%;
  background: #0066cc;
  transition: width 0.5s ease;
}

/* Tech Demo */
.tech-selector {
  margin-bottom: 20px;
  text-align: center;
}

/* Desktop layout for tech buttons */
@media (min-width: 769px) {
  .tech-selector {
    display: flex;
    justify-content: center;
    gap: 0;
    flex-wrap: wrap;
  }
  
  .tech-btn {
    margin: 5px 2px;
  }
  
  /* Desktop API flow improvements */
  .api-flow {
    justify-content: space-between;
    max-width: 600px;
    margin: 20px auto;
  }
  
  .api-step {
    flex: 0 1 auto;
    min-width: 100px;
    max-width: 120px;
  }
  
  .api-step .step-text {
    font-size: 13px;
  }
  
  /* Desktop TEE demo improvements */
  .device-diagram {
    gap: 80px;
    margin: 25px auto;
  }
  
  .tee-visual {
    max-width: 700px;
    margin: 0 auto;
  }
}

.tech-btn {
  margin: 5px;
  padding: 5px 15px;
  background: var(--code-bg);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  cursor: pointer;
  transition: all 0.2s;
  display: inline-block;
  font-family: inherit;
  font-size: 14px;
}

.tech-btn:hover {
  background: var(--text-color);
  color: var(--bg-color);
  border-color: var(--text-color);
}

.tech-btn.active {
  background: var(--text-color);
  color: var(--bg-color);
  border-color: var(--text-color);
}

.tech-btn.active:hover {
  background: var(--text-color);
  color: var(--bg-color);
  border-color: var(--text-color);
}

.tech-content {
  padding: 20px 0;
}

.tee-visual {
  text-align: center;
}

.tee-visual p {
  margin: 15px 0;
  font-style: italic;
  color: var(--muted-color);
}

.tee-visual button {
  margin-top: 20px;
}

.zkvm-visual {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 20px 0;
  gap: 20px;
  flex-wrap: wrap;
}

.input-box, .output-box {
  flex: 1;
  min-width: 150px;
  text-align: center;
}

.input-box label, .output-box label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}

.input-box input {
  width: 90%;
  max-width: 200px;
  padding: 5px;
  border: 1px solid var(--border-color);
  background: var(--bg-color);
  color: var(--text-color);
  margin: 0 auto;
  display: block;
}

#zkvm-output {
  padding: 10px;
  background: var(--code-bg);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  margin-top: 5px;
  font-family: monospace;
  font-size: 12px;
}

.zkvm-box {
  flex: 1;
  min-width: 150px;
  text-align: center;
  padding: 20px;
  border: 2px solid var(--border-color);
  border-radius: 4px;
  background: #000;
  color: #0f0;
  font-family: monospace;
}

.zkvm-processing {
  display: none;
  animation: blink 1s infinite;
}

.hidden-computation {
  font-size: 12px;
  margin-top: 10px;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.device-diagram {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 20px auto;
  position: relative;
  gap: 60px;
  min-height: 100px;
}

.main-processor, .tee-chip {
  padding: 20px 25px;
  border: 2px solid var(--border-color);
  border-radius: 4px;
  background: var(--code-bg);
  text-align: center;
  font-weight: bold;
  position: relative;
  z-index: 2;
  white-space: nowrap;
  transition: all 0.3s ease;
  min-width: 120px;
  font-size: 14px;
}

.main-processor.processing {
  border-color: #8b5a2b;
  background: rgba(139, 90, 43, 0.1);
  animation: processorPulse 2s ease-in-out infinite;
}

.tee-chip {
  border-color: #2d5016;
  background: rgba(45, 80, 22, 0.1);
}

.tee-chip.active {
  border-color: #0066cc;
  background: rgba(0, 102, 204, 0.1);
  animation: teePulse 1.5s ease-in-out infinite;
}

body.dark-mode .tee-chip {
  background: rgba(45, 80, 22, 0.2);
}

body.dark-mode .tee-chip.active {
  background: rgba(0, 102, 204, 0.2);
}

body.dark-mode .main-processor.processing {
  background: rgba(139, 90, 43, 0.2);
}

@keyframes processorPulse {
  0%, 100% { 
    transform: scale(1);
    opacity: 1;
  }
  50% { 
    transform: scale(1.05);
    opacity: 0.8;
  }
}

@keyframes teePulse {
  0%, 100% { 
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(0, 102, 204, 0.7);
  }
  50% { 
    transform: scale(1.05);
    box-shadow: 0 0 0 10px rgba(0, 102, 204, 0);
  }
}

.data-flow {
  position: absolute;
  top: 50%;
  left: 44%;
  transform: translateX(-50%);
  width: 60px;
  height: 2px;
  background: var(--border-color);
  z-index: 0;
}

.data-flow.active::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 2px;
  background: #0066cc;
  animation: flow 1.5s linear infinite;
}

@keyframes flow {
  from { left: 0; }
  to { left: calc(100% - 20px); }
}

/* Mobile-specific TEE animation */
.tee-mobile-indicator {
  display: none;
  text-align: center;
  margin: 20px 0;
  font-size: 14px;
  color: var(--muted-color);
}

.tee-mobile-indicator.active {
  color: #0066cc;
  font-weight: bold;
}

.tee-status-indicators {
  display: none;
  flex-direction: column;
  gap: 10px;
  margin: 20px 0;
  padding: 15px;
  background: var(--code-bg);
  border: 1px solid var(--border-color);
  border-radius: 4px;
}

.tee-status-indicators.active {
  display: flex;
}

.tee-status-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color);
  opacity: 0.5;
  transition: all 0.5s ease;
}

.tee-status-item:last-child {
  border-bottom: none;
}

.tee-status-item.active {
  opacity: 1;
}

.tee-status-item.complete {
  opacity: 1;
  color: #2d5016;
}

.tee-status-icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: white;
  font-weight: bold;
}

.tee-status-item.active .tee-status-icon {
  background: #0066cc;
  animation: iconPulse 1s infinite;
}

.tee-status-item.complete .tee-status-icon {
  background: #2d5016;
  animation: none;
}

@keyframes iconPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

.ledger-entries {
  max-height: 150px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  padding: 10px;
  margin-bottom: 15px;
  background: var(--code-bg);
  font-family: monospace;
  font-size: 13px;
}

.ledger-entry {
  padding: 5px;
  margin: 5px 0;
  transition: all 0.3s;
}

.ledger-entry.new {
  background: rgba(0, 102, 204, 0.1);
  animation: slideIn 0.5s ease;
}

@keyframes slideIn {
  from { 
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.ledger-entry.verifying {
  background: rgba(139, 90, 43, 0.15);
  border-left: 3px solid #8b5a2b;
}

.ledger-entry.verified {
  background: rgba(45, 80, 22, 0.2);
  border-left: 3px solid #2d5016;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .demo button {
    display: block;
    width: 100%;
    max-width: 280px;
    margin: 15px auto;
    padding: 14px 20px;
    font-size: 16px;
  }
  
  .tech-btn {
    display: block;
    width: 100%;
    max-width: 200px;
    margin: 8px auto;
    padding: 14px 20px;
    font-size: 16px;
  }
  
  .tech-selector {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }
  
  .api-flow {
    flex-direction: column;
    gap: 15px;
  }
  
  .api-step {
    margin: 0 auto;
    width: 100%;
    max-width: 200px;
  }
  
  .api-step .step-icon {
    width: 50px;
    height: 50px;
    line-height: 50px;
    font-size: 18px;
  }
  
  .api-step .step-text {
    font-size: 16px;
    margin-top: 8px;
  }
  
  .zkvm-visual {
    flex-direction: column;
    text-align: center;
    gap: 20px;
  }
  
  .zkvm-box {
    margin: 20px 0;
    padding: 25px 15px;
  }
  
  .device-diagram {
    flex-direction: column;
    gap: 30px;
    padding: 15px;
    margin: 15px auto;
  }
  
  .main-processor, .tee-chip {
    padding: 20px 25px;
    font-size: 14px;
    min-width: 140px;
  }
  
  .data-flow {
    display: none;
  }
  
  .tee-mobile-indicator {
    display: block;
  }
  
  .tee-status-indicators {
    display: none;
  }
  
  .tee-status-indicators.active {
    display: flex;
  }
  
  .provider-select select {
    width: 100%;
    max-width: 280px;
    padding: 12px;
    font-size: 16px;
    margin-bottom: 15px;
  }
  
  .input-box input {
    width: 100%;
    max-width: 250px;
    padding: 12px;
    font-size: 16px;
  }
  
  .portal-simulator {
    margin: 20px 0;
  }
  
  .lab-result {
    flex-direction: column;
    gap: 5px;
    padding: 12px 0;
  }
  
  .test-name, .test-status, .test-date {
    font-size: 16px;
  }
}

/* Tablet responsive */
@media (max-width: 1024px) and (min-width: 769px) {
  .demo button {
    margin: 12px auto;
    padding: 12px 20px;
  }
  
  .tech-btn {
    margin: 6px;
    padding: 12px 18px;
  }
  
  .zkvm-visual {
    gap: 15px;
  }
}