/* CSS Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Dark Mode Color Palette */
  --bg-primary: #0a0a0b;
  --bg-secondary: #1a1a1d;
  --bg-tertiary: #2a2a2f;
  --accent-primary: #6366f1;
  --accent-secondary: #8b5cf6;
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  --border-color: #334155;
  --success: #10b981;
  --gradient-primary: linear-gradient(135deg, #6366f1, #8b5cf6);
  --gradient-dark: linear-gradient(135deg, #1e293b, #334155);
  --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
  --shadow-xl: 0 35px 60px -12px rgba(0, 0, 0, 0.9);
  --blur-backdrop: blur(16px);
  --alertcolor: #37c25c;
  --alertbg: #123222;
  --scrollbar: #2b2538;
}

/* Light Mode Color Palette */
[data-theme="light"] {
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --accent-primary: #6366f1;
  --accent-secondary: #8b5cf6;
  --text-secondary: #475569;
  --text-primary: #1e293b;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --success: #10b981;
  --gradient-primary: linear-gradient(135deg, #6366f1, #8b5cf6);
  --gradient-dark: linear-gradient(135deg, #e2e8f0, #cbd5e1);
  --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
  --shadow-xl: 0 35px 60px -12px rgba(0, 0, 0, 0.2);
  --blur-backdrop: blur(16px);
  --alertcolor: #37c25c;
  --alertbg: #e1fae8;
  --scrollbar:#c3c7c9;
}

/* Apply to entire page */
body {
  scrollbar-width: thin; /* Firefox */
  scrollbar-color: var(--scrollbar) transparent;

}

/* WebKit Browsers */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background-color: var(--scrollbar);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--scrollbar);
}

/* Apply to entire page */
body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  background-image: radial-gradient(
      circle at 20% 20%,
      rgba(120, 119, 198, 0.1) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 80%,
      rgba(139, 92, 246, 0.1) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 40% 60%,
      rgba(99, 102, 241, 0.05) 0%,
      transparent 50%
    );
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Header Styles */
.header {
  text-align: center;
  padding: 3rem 1rem 2rem;
  opacity: 0;
  transform: translateY(-30px);
  animation: slideInDown 1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  position: relative;
}

.logo {
  font-family: "Urbanist", sans-serif;
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.subtitle {
  font-family: "Instrument Serif", serif;
  font-size: 1.2rem;
  color: var(--text-secondary);
  font-style: italic;
  opacity: 0.8;
}
.bookmark {
  display: flex;
  justify-content: center;
  align-items: center;
}
.alertbook {
  border-radius: 8px;
  padding: 0 14px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--alertcolor);
  background-color: var(--alertbg);
}
/* Theme Toggle */
.theme-toggle {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 50px;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: var(--blur-backdrop);
}

.theme-toggle:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-lg);
}

.theme-toggle i {
  font-size: 1.2rem;
  color: var(--accent-primary);
  transition: all 0.3s ease;
}

/* Main Container */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1rem;
  opacity: 0;
  transform: translateY(30px);
  animation: slideInUp 1s cubic-bezier(0.4, 0, 0.2, 1) 0.3s forwards;
}

/* Input Section */
.input-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 2rem;
  margin-bottom: 2rem;
  backdrop-filter: var(--blur-backdrop);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.input-section:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

.input-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--gradient-primary);
  opacity: 0.5;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group:last-child {
  margin-bottom: 0;
}

label {
  display: block;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

textarea,
input[type="text"] {
  width: 100%;
  background: var(--bg-tertiary);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem;
  color: var(--text-primary);
  font-family: "Inter", sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  resize: vertical;
  transition: border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

textarea {
  min-height: 200px;
}

textarea:focus,
input[type="text"]:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
  transform: scale(1.01);
}

/* Checkbox Styles */
.checkbox-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
  opacity: 0;
  transform: translateY(10px);
  animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.8s forwards;
}

.checkbox-container {
  position: relative;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.checkbox-container input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  width: 0;
  height: 0;
}

.checkmark {
  width: 20px;
  height: 20px;
  background: var(--bg-tertiary);
  border: 2px solid var(--border-color);
  border-radius: 6px;
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.checkbox-container:hover .checkmark {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.1);
  transform: scale(1.1);
}

.checkbox-container input:checked ~ .checkmark {
  background: var(--gradient-primary);
  border-color: var(--accent-primary);
  animation: checkboxBounce 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.checkbox-container input:checked ~ .checkmark::after {
  content: "\f00c";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  color: white;
  font-size: 12px;
  animation: checkmarkAppear 0.2s ease 0.1s forwards;
  opacity: 0;
}

.checkbox-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 400;
  cursor: pointer;
  user-select: none;
  transition: color 0.3s ease;
}

.checkbox-container:hover ~ .checkbox-label {
  color: var(--text-primary);
}

/* Buttons */
.btn-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  border: none;
  border-radius: 12px;
  font-family: "Inter", sans-serif;
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  text-decoration: none;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0) scale(0.98);
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--border-color);
}

/* Output Section */
.output-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 2rem;
  backdrop-filter: var(--blur-backdrop);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.output-section:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

.output-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--gradient-primary);
  opacity: 0.5;
}

#outputText {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  min-height: 150px;
  color: var(--text-primary);
  font-family: "Inter", sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Toast Notification */
.toast {
  position: fixed;
  top: 2rem;
  right: 2rem;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  padding: 1rem 1.5rem;
  border-radius: 12px;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--success);
  backdrop-filter: var(--blur-backdrop);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  transform: translateX(400px);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast.error {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

/* Footer */
.footer {
  text-align: center;
  padding: 3rem 1rem;
  border-top: 1px solid var(--border-color);
  margin-top: 4rem;
  opacity: 0;
  animation: fadeIn 0.8s ease 1.5s forwards;
}

.made-by {
  font-family: "Instrument Serif", serif;
  font-size: 1.1rem;
  color: var(--text-muted);
  font-style: italic;
}

.made-by .fire {
  color: #ff6b6b;
  font-style: normal;
  animation: flicker 2s infinite alternate;
}
.made-by > a {
  color: var(--alertcolor);
}

/* Animations */
@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes checkboxBounce {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes checkmarkAppear {
  from {
    opacity: 0;
    transform: scale(0);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes flicker {
  0%,
  50% {
    opacity: 1;
  }
  51%,
  100% {
    opacity: 0.8;
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

.pulse-animation {
  animation: pulse 0.3s ease-in-out;
}

.success-flash {
  background: var(--success) !important;
  color: white !important;
  transition: all 0.2s ease;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }

  .input-section,
  .output-section {
    padding: 1.5rem;
  }

  .btn-group {
    flex-direction: column;
  }

  .btn {
    justify-content: center;
  }

  .toast {
    right: 1rem;
    left: 1rem;
    top: 1rem;
  }

  .theme-toggle {
    top: 0.5rem;
    right: 0.5rem;
    width: 40px;
    height: 40px;
  }

  .theme-toggle i {
    font-size: 1rem;
  }
}
