* {
  user-select: none;
}

body {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  background: #f7f9fc;
  height: 100vh;
  display: flex;
  flex-direction: column;
  cursor: default;
}

.adsense-placeholder {
  width: 100%;
  height: 90px;
  background: #fff;
  display: flex;
  align-items: center;
  font-size: 18px;
  padding: 0 10px;
  box-sizing: border-box;
}

.adsense-placeholder .logo {
  margin-right: 15px;
  display: flex;
  align-items: center;
}

.adsense-placeholder .ad-content {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(45deg, #6a0dad, #ff1493, #4b0082);
  padding: 4px 8px;
  /* More spacious padding */
  position: relative;
  z-index: 10;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  /* Subtle shadow */
  font-family: 'Poppins', sans-serif;
  /* Clean modern font */
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  /* Smooth transition on hover */
}

.nav-buttons a {
  color: #fff;
  padding: 10px 15px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-decoration: none;
}

.nav-buttons a:hover {
  background-color: rgba(0, 0, 0, 0.3);
  /* Dark background on hover */
  color: #fff;
}

.nav-bar:hover {
  background-color: #01587a;
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.3);
  /* Darker shadow effect on hover */
}

.nav-buttons {
  display: flex;
  gap: 15px;
}

.logo img {
  height: 40px;
  cursor: pointer;
  transition: 0.3s ease;
}

.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 4px;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background-color: white;
  border-radius: 3px;
}

/* Mobile Styles */
@media (max-width: 768px) {
  .nav-buttons {
  display: none;
  position: absolute;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #222;
  padding: 15px 20px;
  flex-direction: column;
  align-items: stretch;
  gap: 15px;
  z-index: 5;
  border-radius: 12px;
  border: 1px solid #444;
  width: 85%;
  max-width: 300px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.4);
}

.hamburger {
  display: flex;
  cursor: pointer;
}

.nav-buttons.active {
  display: flex;
  animation: slideIn 0.3s ease-out;
}

.nav-buttons a {
  color: #fff;
  text-decoration: none;
  padding: 12px;
  border-radius: 8px;
  text-align: center;
  background: #333;
  transition: background 0.3s ease;
}

.nav-buttons a:hover {
  background: #444;
}

@keyframes slideIn {
  from {
  opacity: 0;
  transform: translateX(-50%) translateY(-10px);
}

to {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

}

}

.btn {
  background: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: 0.3s ease;
  display: flex;
  align-items: center;
}

.btn i {
  margin-right: 5px;
}

.btn:hover {
  background: #000000;
  color: #ffffff;
}

.save-btn {
  background: #ffc107;
}

.run-btn {
  background: #198754;
  color: #fff;
}

.copy-btn {
  background: #0dcaf0;
}

.copy-btn .copied {
  display: none;
  font-weight: bold;
  color: green;
}

.copy-btn.copied .copied {
  display: inline-block;
}

.copy-btn.copied .fas.fa-copy {
  display: none;
}

.toggle-btn {
  background: #6f42c1;
  color: #fff;
}

.editor-container {
  flex: 1;
  display: flex;
  height: calc(100vh - 90px - 56px);
  overflow: hidden;
}

.editor-container.vertical {
  flex-direction: column;
}

.editor-container.horizontal {
  flex-direction: row;
}

textarea#codeEditor,
iframe#outputFrame {
  flex: 1;
  padding: 14px;
  font-family: 'Courier New', monospace;
  font-size: 15px;
  resize: none;
  height: 100%;
  outline: none;
  border: 3px solid #ccc;
  background: #fff;
  box-sizing: border-box;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.resizer {
  background: #ccc;
  user-select: none;
}

.editor-container.horizontal .resizer {
  width: 6px;
  cursor: col-resize;
}

.editor-container.vertical .resizer {
  height: 6px;
  width: 100%;
  cursor: row-resize;
}

@media (max-width: 768px) {
  .editor-container {
  height: calc(100vh - 70px);
  /* Adjust for mobile view */
}

textarea#codeEditor {
  height: 70vh;
  font-size: 14px;
  padding: 12px;
}

@media (max-width: 768px) {
  .editor-container.horizontal .resizer {
  width: 6px;
}

.editor-container.vertical .resizer {
  height: 6px;
  width: 100%;
}

}

/* Prevent any issues with zooming in */
@media (max-width: 1500px) {
  .editor-container.horizontal .resizer {
  width: 6px !important;
  /* Ensure no change */
}

.editor-container.vertical .resizer {
  height: 6px !important;
  width: 100% !important;
}

}

iframe#outputFrame {
  height: 70vh;
}

}

@media (max-width: 480px) {
  textarea#codeEditor {
  height: 75vh;
  font-size: 14px;
  padding: 10px;
}

iframe#outputFrame {
  height: 75vh;
  width: 202vh;
}

}

@media (max-width: 320px) {
  textarea#codeEditor {
  height: 80vh;
  font-size: 13px;
  padding: 8px;
}

iframe#outputFrame {
  height: 20vh;
}

}

@media (max-width: 260px) {
  textarea#codeEditor {
  height: 85vh;
  font-size: 12.5px;
  padding: 6px;
}

iframe#outputFrame {
  display: none;
}

}

.logo {
  width: 150px;
  height: 60px;
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
}

.logo img {
  width: 180px;
  height: auto;
  display: block;
}

#findReplaceContainer {
  position: fixed;
  top: 130px;
  right: 650px;
  z-index: 9999;
  background: #fff;
  padding: 15px 15px 10px;
  border: 2px solid transparent;
  border-radius: 8px;
  background-image: linear-gradient(to bottom, #e6e6e6, #ccc);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
  width: 260px;
  font-family: Arial, sans-serif;
  box-sizing: border-box;
  display: none;
}

#findReplaceContainer input {
  width: 100%;
  padding: 8px;
  margin: 6px 0;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  box-sizing: border-box;
}

#findReplaceContainer button.action-btn {
  width: 100%;
  padding: 10px;
  margin-top: 6px;
  background-color: linear-gradient(135deg, #00c6ff, #0072ff);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.3s;
}

#findReplaceContainer button.action-btn:hover {
  background-color: #45a049;
}

/* Close button in top-right, no background */
    #closeFindReplace {
  position: absolute;
  top: 5px;
  right: 8px;
  background: none;
  border: none;
  font-size: 20px;
  color: #e74c3c;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  margin: 0;
  transition: color 0.3s;
}

#closeFindReplace:hover {
  color: #000;
}

@media (max-width: 480px) {
  #findReplaceContainer {
  width: 90%;
  right: 5%;
  top: 60px;
  padding: 15px 15px 10px;
}

}

.action-btn {
  display: inline-block;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #4CAF50, #43A047);
  border: 2px solid #388E3C;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 8px rgba(76, 175, 80, 0.3);
}

.action-btn:hover {
  background: linear-gradient(135deg, #43A047, #388E3C);
  box-shadow: 0 6px 14px rgba(56, 142, 60, 0.4);
  transform: translateY(-1px);
}

.action-btn:active {
  background: #2E7D32;
  box-shadow: 0 3px 6px rgba(0,0,0,0.2);
  transform: translateY(0);
}