:root {
  --black: #0d1117;
  --blue: #00a6ff;
}

body {
  background-color: var(--black);
  margin: 0;
  padding: 0;
  font-family: 'Fira Code', monospace;
}

.terminal-window {
  color: #27c93f;
  background-color: var(--black);
  border: 1px solid #444;
  border-radius: 8px;
  max-width: 800px;
  margin: 40px auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  font-family: 'Fira Code', monospace;
  position: relative; 
  overflow: hidden; 
}

.scanlines {
    position: absolute; 
    top: 0;
    left: 0;
    width: 100%; 
    height: 100%; 
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0),
        rgba(255, 255, 255, 0) 50%,
        rgba(0, 0, 0, 0.2) 50%,
        rgba(0, 0, 0, 0.2)
    );
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 10;
    opacity: 0.4; 
    border-radius: 8px; 
}

/* --- TERMINAL HEADER --- */
.terminal-header {
  background-color: #333;
  padding: 10px;
  border-top-left-radius: 7px;
  border-top-right-radius: 7px;
  display: flex;
  align-items: center;
  color: #ccc;
  position: relative;
  z-index: 11; 
}

.dots .dot {
  height: 12px;
  width: 12px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}
.dot.red { background-color: #ff5f56; }
.dot.yellow { background-color: #ffbd2e; }
.dot.green { background-color: #27c93f; }
.terminal-header span { margin-left: 20px; }

.terminal-body {
  padding: 20px;
  position: relative;
  z-index: 5;
}

.prompt-arrow {
  color: var(--blue);
  margin-right: 10px;
}

/* --- CERTIFICATE GRID & CARDS --- */
.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
  margin-left: 25px;
  margin-top: 10px;
}

.cert-card-mini {
  background-color: #222;
  border: 1px solid #444;
  padding: 15px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.2s ease;
  /* FIX: Ensure content doesn't spill */
  overflow: hidden; 
}

.cert-card-mini:hover {
  background-color: var(--black);
  border-color: var(--blue);
  color: var(--blue);
}

.cert-card-mini .file-icon {
  margin-right: 10px;
  font-weight: bold;
}

.nameOfCert {
  display: inline-block;
  max-width: 100%;
  white-space: nowrap; 
  overflow: hidden;  
  text-overflow: ellipsis; 
  vertical-align: middle;
}

/* --- UTILS --- */
.blinking-cursor {
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  from, to { opacity: 1; }
  50% { opacity: 0; }
}

#script-container {
  font-family: 'Fira Code', monospace;
  white-space: pre-wrap;
  line-height: 1.6;
}

.hidden {
  display: none !important;
}

/* --- MODAL --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  position: relative;
  background-color: var(--black);
  padding: 20px;
  border-radius: 8px;
  max-width: 80vw;
  max-height: 90vh;
  padding-top: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
}

#modal-image {
  max-width: 100%;
  max-height: 100%;
  display: block;
}

.close-button {
  position: absolute;
  top: 10px;
  right: 20px;
  color: #fff;
  font-size: 30px;
  font-weight: bold;
  cursor: pointer;
  z-index: 1001;
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  width: 35px;
  height: 35px;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.close-button:hover {
  background-color: var(--blue);
  color: var(--black);
}

/* --- GLITCH ANIMATION --- */
@keyframes glitch-anim {
    0% { transform: translate(0); clip-path: inset(0 0 0 0); }
    20% { transform: translate(-2px, 2px); clip-path: inset(10% 0 80% 0); }
    40% { transform: translate(2px, -2px); clip-path: inset(80% 0 10% 0); }
    60% { transform: translate(-2px, 2px); clip-path: inset(40% 0 40% 0); }
    80% { transform: translate(2px, -2px); clip-path: inset(20% 0 60% 0); }
    100% { transform: translate(0); clip-path: inset(0 0 0 0); }
}

.modal-content.glitch-active {
    animation: glitch-anim 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both infinite;
    border: 1px solid var(--blue);
    box-shadow: 0 0 20px var(--blue);
}

/* --- BACK BUTTON --- */
.back-button-container {
  text-align: center;
  margin-top: 20px;
  padding-bottom: 40px;
}

.back-button {
  display: inline-block;
  padding: 12px 24px;
  border: 2px solid var(--blue);
  color: var(--blue);
  background-color: transparent;
  text-decoration: none;
  font-family: 'Fira Code', monospace;
  font-size: 1em;
  font-weight: bold;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.back-button:hover {
  background-color: var(--blue);
  color: var(--black);
}

/* --- TERMINAL COLORS --- */
.log-info { color: #00a6ff; }
.log-warn { color: #ffbd2e; }
.log-error { color: #ff5f56; }
.log-success { color: #27c93f; }
.log-hex { color: #555; }