@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;600&display=swap');
/* ==== Base Reset ==== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', sans-serif;
  background-color: #f9f9f9;
  color: #222;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==== Header ==== */
.app-header {
  background-color: #fff;
  padding: 1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 10;
}

.app-header h1 {
  font-size: 1.5rem;
  font-weight: bold;
}

.controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.controls input[type="text"] {
  padding: 0.4rem 0.7rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.9rem;
  width: 160px;
}

.controls button {
  padding: 0.4rem 0.7rem;
  border: none;
  background: #4b7bec;
  color: white;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.3s;
}

.controls button:hover {
  background: #3867d6;
}

#timestamp {
  font-size: 0.9rem;
  margin-left: 8px;
}

.theme-toggle label {
  margin-right: 4px;
  font-size: 0.9rem;
}

.theme-toggle select {
  padding: 0.3rem;
  font-size: 0.9rem;
}

/* ==== Editor Area ==== */
.editor-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1rem;
  gap: 1rem;
}

/* Mobile Tabs */
.mobile-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.mobile-tabs .tab {
  flex: 1;
  padding: 0.5rem;
  background: #ddd;
  border: none;
  font-weight: bold;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.3s;
}

.mobile-tabs .tab.active {
  background: #4b7bec;
  color: white;
}

.code-editors {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.editor {
  display: none; /* Only shown via JS on mobile */
}

.editor h2 {
  margin-bottom: 0.3rem;
}

.editor textarea {
  width: 100%;
  height: 200px;
  padding: 0.7rem;
  font-family: monospace;
  font-size: 0.9rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  resize: vertical;
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.action-buttons button {
  padding: 0.6rem 1.2rem;
  background: #26de81;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.3s;
}

.action-buttons button:hover {
  background: #20bf6b;
}

/* Output Section */
.output-section {
  margin-top: 1rem;
}

.output-section h2 {
  margin-bottom: 0.5rem;
}

#outputFrame {
  width: 100%;
  height: 300px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: white;
}

/* ==== Responsive Layout ==== */
@media (min-width: 768px) {
  .code-editors {
    flex-direction: row;
    justify-content: space-between;
  }

  .editor {
    display: block !important;
    flex: 1;
  }

  .editor textarea {
    height: 400px;
  }

  .mobile-tabs {
    display: none;
  }
}

/* ==== Themes ==== */
body.light-theme {
  background-color: #f9f9f9;
  color: #222;
  --text-color: #222;
}

body.dark-theme {
  background-color: #1e1e1e;
  color: #eee;
  --text-color: #eee;
}

body.dark-theme .app-header,
body.dark-theme .editor textarea,
body.dark-theme #outputFrame {
  background-color: #2c2c2c;
  color: #eee;
  border-color: #444;
}

body.dark-theme .controls input,
body.dark-theme .theme-toggle select {
  background-color: #333;
  color: #eee;
  border: 1px solid #555;
}

body.hacker-theme {
  background-color: #000;
  color: #0f0;
  --text-color: #0f0;
}

body.hacker-theme .app-header,
body.hacker-theme .editor textarea,
body.hacker-theme #outputFrame {
  background-color: #000;
  color: #0f0;
  border-color: #0f0;
}

body.hacker-theme .controls input,
body.hacker-theme .theme-toggle select {
  background-color: #000;
  color: #0f0;
  border: 1px solid #0f0;
}

body.hacker-theme .tab,
body.hacker-theme .controls button,
body.hacker-theme .action-buttons button {
  background: #030;
  color: #0f0;
  border: 1px solid #0f0;
}
.error {
  background: #ffefef;
  color: #c00;
  font-family: monospace;
  font-weight: bold;
  padding: 1rem;
  border-radius: 8px;
  white-space: pre-wrap;
}
#errorBox {
  color: red;
  font-weight: bold;
  margin-top: 10px;
  background: #ffecec;
  border-left: 4px solid red;
  padding: 10px;
  border-radius: 4px;
  animation: shake 0.2s ease-in-out 2;
}

@keyframes shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  50% { transform: translateX(4px); }
  75% { transform: translateX(-4px); }
  100% { transform: translateX(0); }
}
.saved-page {
  padding: 2rem;
  max-width: 600px;
  margin: auto;
}
.project-card {
  border: 1px solid #ccc;
  border-radius: 1rem;
  padding: 1rem;
  margin: 1rem 0;
  background: var(--card-bg, #fff);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}
.project-card h2 {
  margin: 0 0 0.5rem 0;
}
.project-card button {
  margin-right: 10px;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
}
.view-btn {
  background: #00b09b;
  color: white;
}
.delete-btn {
  background: #ff5f6d;
  color: white;
}
.back-btn {
  position: absolute;
  top: 20px;
  left: 20px;
  background: linear-gradient(145deg, #3a3a3a, #1e1e1e); /* dark grey to black gradient */
  color: #fff;
  padding: 8px 14px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); /* stronger shadow for dark btn */
  transition: all 0.3s ease;
  font-size: 14px;
}

.back-btn:hover {
  background: #000; /* solid black on hover */
  color: #fff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5); /* deeper shadow */
}

@import url('https://fonts.googleapis.com/css2?family=Pacifico&family=Poppins:wght@400;600&display=swap');

header h1 {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 28px;
  letter-spacing: 0.5px;
  color: var(--text-color, #222);
  margin: 0;
  padding: 10px 20px;
}

/* Coding lines background */
.code-lines-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.03) 0px,
    rgba(255, 255, 255, 0.03) 1px,
    transparent 1px,
    transparent 20px
  );
  animation: scroll-lines 20s linear infinite;
  opacity: 0.4;
}

@keyframes scroll-lines {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 0 100%;
  }
}

/* Dark theme tweak */
body.dark-theme .code-lines-background {
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.05) 0px,
    rgba(255, 255, 255, 0.05) 1px,
    transparent 1px,
    transparent 20px
  );
}

/* Hacker theme tweak */
body.hacker-theme .code-lines-background {
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 255, 0, 0.1) 0px,
    rgba(0, 255, 0, 0.1) 1px,
    transparent 1px,
    transparent 20px
  );
}
.saved-page {
  background-color: rgba(255, 255, 255, 0.8); /* light mode */
  backdrop-filter: blur(4px); /* optional glassy effect */
  position: relative;
  z-index: 1;
  border-radius: 12px;
  padding: 1rem;
}
body.dark-theme .saved-page {
  background-color: rgba(20, 20, 20, 0.8);
}

body.hacker-theme .saved-page {
  background-color: rgba(0, 0, 0, 0.8);
}


/* 🧪 Floating Code Bubbles Animation */
.code-bubbles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: -1;
  pointer-events: none;
}

.code-bubble {
  position: absolute;
  color: #006400; /* hacker green */
  font-family: 'Courier New', monospace;
  white-space: nowrap;
  animation: floatCode 8s linear forwards;
  opacity: 0.7;
}
@keyframes floatCode {
  0% {
    transform: translateY(0) scale(1);
    opacity: 0.8;
  }
  100% {
    transform: translateY(-120vh) scale(1.2);
    opacity: 0;
  }
}




/* Dark theme transparency */
body.dark-theme .saved-page {
  background-color: rgba(20, 20, 20, 0.8);
}

/* Hacker theme transparency */
body.hacker-theme .saved-page {
  background-color: rgba(0, 0, 0, 0.8);
}
