/* ===== CSS Variables ===== */
:root {
  --bg: #ffffff;
  --text: #111827;
  --card: #f3f4f6;
  --border: #d1d5db;
  --primary: #2563eb;
  --error: #ef4444;
  --success: #10b981;
}

[data-theme="dark"] {
  --bg: #0f172a;
  --text: #e2e8f0;
  --card: #020617;
  --border: #334155;
}

/* ===== Base Styles ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding: 20px;
  transition: 0.3s;
}

.container {
  max-width: auto;
  margin: 0 auto;
  padding: 0 10px;
}

/* ===== Layout ===== */
.main-layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.input-section {
  flex: 1;
  min-width: 300px;
}

.output-wrapper {
  flex: 1;
  position: relative;
  min-height: 400px;
}

/* ===== Navbar Brand ===== */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  margin-bottom: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
  transition: transform 0.3s ease;
}

.nav-logo:hover {
  transform: rotate(10deg) scale(1.05);
}

.nav-title {
  font-size: 18px;
  font-weight: bold;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Dark mode logo adjustment */
[data-theme="dark"] .nav-logo {
  filter: brightness(0.9) drop-shadow(0 2px 4px rgba(255, 255, 255, 0.1));
}

/* Responsive */
@media (max-width: 480px) {
  .nav-title {
    font-size: 16px;
  }

  .nav-logo {
    width: 28px;
    height: 28px;
  }

  .nav-brand {
    gap: 8px;
  }
}

/* ===== Form Elements ===== */
textarea,
input,
select {
  width: 100%;
  padding: 10px 15px;
  margin-bottom: 15px;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-sizing: border-box;
  resize: none;
  overflow: hidden;
  font-family: inherit;
}

textarea:focus,
input:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
}

select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
  background-size: 16px;
  cursor: pointer;
}

/* ===== Buttons ===== */
button {
  padding: 10px 15px;
  margin-right: 10px;
  cursor: pointer;
  border: none;
  border-radius: 6px;
  background: var(--primary);
  color: white;
  transition: 0.2s;
}

button:hover {
  opacity: 0.9;
}

.theme-btn {
  background: transparent !important;
  border: none !important;
  padding: 5px;
  color: var(--text);
  transition: 0.2s;
}

.theme-btn:hover {
  background: rgba(128, 128, 128, 0.1) !important;
  border-radius: 50%;
}

.generate-btn {
  width: 100%;
  font-weight: bold;
}

/* ===== Copy Button ===== */
.copy-button {
  position: absolute;
  top: 15px;
  right: 15px;
  z-index: 10;
  display: none;
  background: transparent !important;
  border: none !important;
  padding: 5px;
  color: var(--text);
  transition: 0.2s;
}

.copy-button:hover {
  background: rgba(128, 128, 128, 0.1) !important;
  border-radius: 50%;
}

/* ===== Output Area ===== */
pre {
  background: var(--card);
  padding: 15px;
  border: 1px solid var(--border);
  overflow: auto;
  margin-top: 0;
  min-height: 240px;
  border-radius: 10px;
  font-family: "Courier New", monospace;
  font-size: 14px;
}

pre#output {
  position: relative;
  padding-top: 45px;
  font-size: medium;
}

/* ===== Options Container ===== */
.options-container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 15px;
}

.checkbox-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkbox-container label {
  cursor: pointer;
  font-size: 14px;
  user-select: none;
}

input[type="checkbox"] {
  width: auto !important;
  margin: 0;
  cursor: pointer;
}

/* ===== Error Message ===== */
.error-message {
  color: var(--error);
  font-size: 14px;
  margin-bottom: 10px;
  display: none;
}

/* ===== Material Icons ===== */
.material-icons {
  font-size: 20px;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .main-layout {
    flex-direction: column;
  }

  .input-section {
    width: 100%;
  }

  .output-wrapper {
    width: 100%;
  }
}

/* ===== Footer ===== */
.footer {
  background: var(--footer-bg);
  border-top: 1px solid var(--footer-border);
  padding: 20px 0;
  margin-top: 40px;
  color: var(--footer-text);
  transition: 0.3s;
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

.developer-credit {
  display: flex;
  align-items: center;
  gap: 8px;
}

.developer-credit .material-icons {
  color: #ef4444;
  font-size: 16px;
}

.developer-credit strong {
  color: var(--primary);
}

.footer-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--footer-text);
}

.dot {
  font-weight: bold;
  opacity: 0.5;
}

.footer-bottom a {
  color: var(--primary);
  text-decoration: none;
  transition: all 0.2s ease;
  position: relative;
}

.footer-bottom a:hover {
  text-decoration: underline;
  opacity: 0.9;
}

.footer-bottom a[target="_blank"]::after {
  content: "↗";
  font-size: 12px;
  margin-left: 4px;
  opacity: 0.7;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .footer-bottom {
    gap: 12px;
    text-align: center;
  }
}

/* File Name Container */
#fileNameContainer {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* File name input special styling */
.file-input-wrapper {
  position: relative;
  margin-bottom: 15px;
}

#fileName {
  border-style: dashed;
  opacity: 0.9;
  margin-bottom: 0;
}

#fileName:focus {
  border-style: solid;
  opacity: 1;
}

#fileName::placeholder {
  font-style: italic;
  opacity: 0.7;
  font-size: 13px;
}

.optional-badge {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  color: var(--footer-text);
  background: var(--card);
  padding: 2px 8px;
  border-radius: 12px;
  pointer-events: none;
  border: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}
