@import url('https://fonts.googleapis.com/css2?family=Roboto&display=swap');

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  width: 100%;
  font-family: 'Roboto', sans-serif;
  background-color: white;
  color: black;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 10px 10px 0 10px;
}

/* Main container */
.main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  max-width: 768px;
  width: 100%;
  margin: 0 auto;
  border: 2px solid black;
  padding: 10px 10px 0 10px;
  overflow: hidden;
}

.sub-main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  border: 1px solid black;
  margin-bottom: 10px;
  position: relative; /* Add this line */
}

.sub-main.no-scroll {
  overflow: hidden !important;
}


/* Containers with borders */
.welcome {
  border: 1px solid black;
  padding: 10px;
  margin-bottom: 10px;
}

.content {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  padding: 10px;
}

/* Title */
.welcome-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  overflow-x: auto;
}

.welcome-title p {
  font-size: clamp(2rem, 4vw, 6rem);
  font-weight: bold;
}

.welcome-text {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  width: 100%;
  margin: 0;
  font-size: calc(0.9rem + 0.4vw);
}

.welcome-text .version {
  margin-left: auto;
}

/* Start Section */
.start {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 360px;
  background: 
    linear-gradient(to bottom, rgba(0, 0, 0, 0) 10%, rgba(0, 0, 0, 1) 100%),
    url('image-bg.jpg') center/cover no-repeat;
  color: white;
  border: 1px solid black;
  margin-bottom: 10px;
  padding: 20px;
}

.start::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 50%, black 100%);
  z-index: 1;
}

.start p,
.start-controls {
  position: relative;
  z-index: 2;
}

.start-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.start .network-selector,
.start button {
  padding: 8px;
  font-size: 0.9rem;
  background-color: white;
  color: black;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.start button:hover {
  background-color: #ddd;
}

@media (max-width: 600px) {
  .start {
    height: 450px;
  }

  .start-controls {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Button */
button {
  background-color: black;
  color: white;
  padding: 12px 24px;
  margin-top: 15px;
  border: none;
  cursor: pointer;
  font-size: calc(1rem + 0.2vw);
  transition: background-color 0.3s ease;
}

button:hover {
  background-color: #333;
}

/* Procedure Cards */
.procedure {
  border: 1px solid black;
  padding: 10px;
  margin-bottom: 10px;
}

.card-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 10px;
}

@media (max-width: 768px) {
  .card-container {
    grid-template-columns: 1fr;
  }
}

.card {
  background-color: #f9f9f9;
  border: 1px solid black;
  padding: 20px;
  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
  text-align: center;
  transition: transform 0.2s ease, background-color 0.3s;
}

.card:hover {
  transform: translateY(-2px);
  background-color: #f0f0f0;
}

.card-icon {
  width: 50px;
  height: 50px;
  margin-bottom: 15px;
  object-fit: contain;
}

.card h4 {
  font-size: clamp(1rem, 1.5vw, 1.5rem);
}

.card p {
  font-size: clamp(0.85rem, 1.2vw, 1.1rem);
}

/* Comment Section */
.comment-section {
  border: 1px solid black;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.comment-input {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.comment-input textarea {
  padding: 10px;
  font-size: 1rem;
  border: 1px solid #ccc;
  resize: none;
  background-color: #f7f7f7;
  color: #333;
}

.comment-input button {
  padding: 10px;
  font-size: 1rem;
  background-color: #000;
  color: #fff;
  border: none;
  cursor: not-allowed;
  opacity: 0.6;
  margin: 0 0 15px 0;
}

.comment-input button:hover {
  background-color: #818181;
}

.comments {
  margin-top: 0;
}

.comment {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  border: 1px solid #ccc;
  padding: 10px 5px;
}

.comment-avatar img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.comment-body {
  display: flex;
  flex-direction: column;
}

.comment-text {
  font-size: 1rem;
  color: #000;
}

.comment-meta {
  font-size: 0.9rem;
  color: #777;
  margin: 5px 0 0 0;
}

/* Terminal Page */
#terminalPage {
  opacity: 0;
  transition: opacity 1s ease;
  flex-grow: 1;
  width: 100%;
  background-color: white;
  color: black;
  display: flex;
  flex-direction: column;
  font-family: monospace;
  overflow: hidden;
  position: relative;
  height: 100%;
}

#terminalPage.fade-in {
  opacity: 1;
}

.terminal-in-out {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #000;
  min-height: 0;
  height: 100%;
}

.terminal-output {
  flex: 1 1 auto;
  min-height: 0;
  padding: 5px;
  background-color: white;
  overflow-y: auto;
  font-size: 1rem;
  height: 100%;
}

.terminal-output div{
  margin: 4px 0;
  font-weight: bold;
}

.terminal-input-wrapper {
  display: flex;
  align-items: center;
  padding: 5px;
  background-color: white;
  position: sticky;
  bottom: 0;
  z-index: 1;
  border-top: 1px solid #000;
}

.prompt {
  font-weight: bold;
  margin-right: 10px;
}

.terminal-input {
  flex: 1;
  font-family: 'Courier New', Courier, monospace;
  font-size: 1rem;
  font-weight: bold;
  padding: 8px;
  border: none;
  background-color: white;
  color: black;
  outline: none;
}

/* Loading Overlay */
.loading-container {
  position: absolute;
  inset: 0;
  background-color: #000;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
  opacity: 0;
  transition: opacity 1s ease;
  pointer-events: none;
}

.loading-container.visible {
  opacity: 1;
  pointer-events: auto;
}

.loading-text {
  color: #fff;
  font-size: 1.8rem;
  opacity: 0;
  transition: opacity 1s ease;
}

.fade-in {
  opacity: 1 !important;
}

.fade-out {
  opacity: 0 !important;
}

.fade-section-out {
  animation: fadeOut 1s forwards;
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* Modal */
#verificationModal {
  display: none; /* Hidden by default */
  opacity: 0;
  transition: opacity 2s ease;
}

#verificationModal.fade-in {
  display: flex;
  opacity: 1;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(5, 5, 5, 0.85);
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.modal-content {
  background: white;
  padding: 10px;
  width: 60%;
  height: 75%;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.4);
  text-align: center;
  position: relative;
  z-index: 10000;
}

.modal-content iframe {
  width: 100%;
  height: 100%;
}

.notice {
  padding: 5px 0;
  font-size: 12px; 
  color: #ffffff; 
  text-align: center; 
  margin: 0 auto; 
  max-width: 768px;
  background: #575757;
  width: 100%;
}

@media (max-width: 600px) {
  html, body{
    padding: 5px 5px 0 5px;
  }

  .notice {
    padding: 5px 0;
    margin: 0 0 5px 0;
  }

  .main {
    padding: 10px 10px 0 10px;
  }

  .sub-main, .welcome {
    margin-bottom: 10px;
  }

  .comment-section{
    margin: 0;
  }
  .modal-content{
    width: 100%;
    height: 70%;
  }

  .sub-main::-webkit-scrollbar, 
.terminal-output::-webkit-scrollbar {
  width: 2px;
}

}

.modal-content h2 {
  font-size: 1.8rem;
  margin-bottom: 20px;
}

.modal-content p {
  font-size: 1rem;
  margin-bottom: 20px;
  color: #333;
}

.modal-content button {
  padding: 10px 20px;
  font-size: 1rem;
  background-color: black;
  color: white;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.modal-content button:hover {
  background-color: #333;
}


.sub-main::-webkit-scrollbar, 
.terminal-output::-webkit-scrollbar,
#verificationIframe::-webkit-scrollbar {
  width:4px ;
}

.sub-main::-webkit-scrollbar-thumb,
.terminal-output::-webkit-scrollbar-thumb,
#verificationIframe::-webkit-scrollbar-thumb {
  background: #000000;
  width: 2px;
}

.sub-main::-webkit-scrollbar-track, 
.terminal-output::-webkit-scrollbar-track,
#verificationIframe::-webkit-scrollbar-track {
  background: #ddd;
}


.iframe-loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgb(0, 0, 0);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  pointer-events: none;
}

.iframe-loading-content {
  text-align: center;
  color: rgb(255, 255, 255);
  font-family: monospace;
}

/* Spinner styles */
.spinner {
  border: 4px solid rgba(126, 126, 126, 0.2);
  border-top: 4px solid rgb(255, 255, 255);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto 10px auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}


.modal-close {
  position: absolute;
  top: 5px;
  right: 10px;
  font-size: 28px;
  font-weight: bold;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  z-index: 10001;
  transition: color 0.3s;
}

.modal-close:hover {
  color: #f00;
}
