:root {
  --bg-main: #0c0a09;
  --primary: #d97706;
  --primary-hover: #b45309;
  --primary-glow: rgba(217, 119, 6, 0.25);
  --accent: #ca8a04;
  --accent-glow: rgba(202, 138, 4, 0.15);
  --card-bg: rgba(28, 25, 23, 0.85);
  --card-border: rgba(255, 255, 255, 0.05);
  --input-bg: rgba(20, 18, 16, 0.6);
  --input-border: rgba(255, 255, 255, 0.1);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-error: #f87171;
  --text-success: #34d399;
  --text-warning: #fbbf24;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body.light-theme {
  --bg-main: #f5f5f4;
  --primary-glow: rgba(217, 119, 6, 0.15);
  --accent-glow: rgba(202, 138, 4, 0.1);
  --card-bg: rgba(255, 255, 255, 0.85);
  --card-border: rgba(0, 0, 0, 0.08);
  --input-bg: rgba(255, 255, 255, 0.95);
  --input-border: rgba(0, 0, 0, 0.15);
  --text-main: #1c1917;
  --text-muted: #57534e;
  --text-error: #dc2626;
  --text-success: #16a34a;
  --text-warning: #d97706;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-x: hidden;
  position: relative;
}

/* Background glows */
.background-glows {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.25;
  mix-blend-mode: screen;
}

.glow-1 {
  background: var(--primary);
  width: 400px;
  height: 400px;
  top: -100px;
  right: -100px;
  animation: pulse-glow-1 12s infinite alternate;
}

.glow-2 {
  background: var(--accent);
  width: 350px;
  height: 350px;
  bottom: -50px;
  left: -50px;
  animation: pulse-glow-2 15s infinite alternate;
}

@keyframes pulse-glow-1 {
  0% { transform: translate(0, 0) scale(1); opacity: 0.2; }
  100% { transform: translate(-50px, 50px) scale(1.2); opacity: 0.3; }
}

@keyframes pulse-glow-2 {
  0% { transform: translate(0, 0) scale(1.1); opacity: 0.2; }
  100% { transform: translate(60px, -40px) scale(0.9); opacity: 0.3; }
}

/* Layout */
.app-container {
  flex: 1;
  width: 100%;
  max-width: 650px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.app-header {
  margin-bottom: 2.5rem;
}

.logo-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.theme-toggle-btn {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  color: var(--text-main);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  font-size: 1.15rem;
}

.theme-toggle-btn:hover {
  background: var(--primary-glow);
  border-color: var(--primary);
  transform: scale(1.05);
}

.logo-icon {
  font-size: 2rem;
  filter: drop-shadow(0 0 10px var(--primary-glow));
}

.app-header h1 {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  background: linear-gradient(135deg, #ffffff 30%, var(--primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  font-weight: 400;
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.5;
}

/* Cards (Glassmorphism) */
.card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3),
              inset 0 1px 1px rgba(255, 255, 255, 0.05);
  transition: var(--transition);
  animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.card-title {
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

.card-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

/* Forms & Inputs */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 500px) {
  .input-row {
    grid-template-columns: 1fr 1fr;
  }
}

label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-main);
}

textarea, input[type="text"], input[type="password"], input[type="datetime-local"] {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
}

textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.5;
}

textarea:focus, input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  background: rgba(10, 15, 30, 0.8);
}

.textarea-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.25rem;
}

#char-counter {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Password wrapper with visibility toggle */
.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrapper input {
  padding-right: 2.75rem;
}

.toggle-password {
  position: absolute;
  right: 0.75rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--text-muted);
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.toggle-password:hover {
  color: var(--text-main);
  transform: scale(1.1);
}

.input-help {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  gap: 0.5rem;
  width: 100%;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  color: white;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Options Accordion */
.options-accordion {
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  margin: 1.5rem 0;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
}

.accordion-trigger {
  width: 100%;
  background: none;
  border: none;
  padding: 0.85rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.accordion-trigger:hover {
  background: rgba(255, 255, 255, 0.04);
}

.accordion-trigger .arrow {
  font-size: 0.75rem;
  transition: transform 0.3s;
}

.accordion-trigger.active .arrow {
  transform: rotate(180deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  padding: 0 1.25rem;
}

.accordion-content.open {
  max-height: 500px;
  padding: 0.5rem 1.25rem 1.25rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Custom Checkbox */
.checkbox-group {
  margin-top: 1rem;
}

.checkbox-container {
  display: flex;
  position: relative;
  padding-left: 2.25rem;
  cursor: pointer;
  user-select: none;
  align-items: flex-start;
}

.checkbox-container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkmark {
  position: absolute;
  top: 2px;
  left: 0;
  height: 20px;
  width: 20px;
  background-color: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 5px;
  transition: var(--transition);
}

.checkbox-container:hover input ~ .checkmark {
  border-color: var(--primary);
}

.checkbox-container input:checked ~ .checkmark {
  background-color: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 8px var(--primary-glow);
}

.checkmark:after {
  content: "";
  position: absolute;
  display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
  display: block;
}

.checkbox-container .checkmark:after {
  left: 6px;
  top: 2px;
  width: 6px;
  height: 11px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox-label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.9rem;
}

.checkbox-help {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* Hidden Utility */
.hidden {
  display: none !important;
}

/* Spinner */
.spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Success Screen Details */
.success-icon {
  font-size: 3rem;
  text-align: center;
  margin-bottom: 1rem;
  filter: drop-shadow(0 0 15px rgba(253, 224, 71, 0.4));
  animation: pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes pop {
  0% { transform: scale(0.5); }
  70% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.link-display-box {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  padding: 0.35rem;
  border-radius: 10px;
}

.link-display-box input {
  background: none;
  border: none;
  padding: 0.5rem;
  outline: none;
  flex: 1;
  color: var(--text-main);
  font-weight: 500;
  font-size: 0.9rem;
}

.link-display-box .btn {
  width: auto;
  white-space: nowrap;
}

.security-notices {
  background: rgba(255, 255, 255, 0.03);
  border-left: 3px solid var(--primary);
  padding: 1rem;
  border-radius: 0 10px 10px 0;
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.security-notices p {
  font-size: 0.85rem;
  line-height: 1.4;
}

/* Decrypt Screen & Output styling */
.meta-info {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  line-height: 1.4;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.decrypted-result {
  margin-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 1.5rem;
  animation: fadeIn 0.4s;
}

.decrypted-box {
  position: relative;
  background: #060913;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 1.25rem;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.4);
}

.markdown-body {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-main);
}

.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4 {
  color: var(--text-main);
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.markdown-body h1 { font-size: 1.5rem; }
.markdown-body h2 { font-size: 1.3rem; }
.markdown-body h3 { font-size: 1.1rem; }

.markdown-body p {
  margin-bottom: 0.75rem;
}

.markdown-body ul, .markdown-body ol {
  margin-bottom: 0.75rem;
  padding-left: 1.5rem;
}

.markdown-body li {
  margin-bottom: 0.25rem;
}

.markdown-body code {
  font-family: monospace;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.15rem 0.3rem;
  border-radius: 4px;
  font-size: 0.88em;
}

.markdown-body pre {
  background: rgba(0, 0, 0, 0.3);
  padding: 0.75rem 1rem;
  border-radius: 6px;
  overflow-x: auto;
  margin-bottom: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.markdown-body pre code {
  background: none;
  padding: 0;
  font-size: 0.9em;
}

.markdown-body a {
  color: var(--primary);
  text-decoration: none;
}

.markdown-body a:hover {
  text-decoration: underline;
}

.markdown-body blockquote {
  border-left: 3px solid var(--primary);
  padding-left: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.btn-icon-copy {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  padding: 0.4rem;
  color: white;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon-copy:hover {
  background: rgba(255,255,255,0.15);
  transform: scale(1.05);
}

.warning-alert {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #fca5a5;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  line-height: 1.4;
}

/* Error Screen */
.error-icon {
  font-size: 3rem;
  text-align: center;
  margin-bottom: 1rem;
  filter: drop-shadow(0 0 10px rgba(239, 68, 68, 0.3));
}

#error-message {
  color: var(--text-error);
}

.countdown-wrapper {
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: 10px;
  padding: 1.25rem;
  text-align: center;
  margin-bottom: 2rem;
}

.countdown-wrapper p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

#countdown-timer {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-warning);
  font-variant-numeric: tabular-nums;
}

/* Footer */
.app-footer {
  text-align: center;
  padding: 2rem 1.25rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  border-top: 1px solid rgba(255, 255, 255, 0.03);
}

/* Light theme specific overrides */
body.light-theme {
  text-shadow: none;
}

body.light-theme .glow {
  opacity: 0.06;
}

body.light-theme .app-header h1 {
  background: linear-gradient(135deg, #1c1917 30%, var(--primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

body.light-theme .decrypted-box {
  background: #eae8e6;
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

body.light-theme .btn-secondary {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.08);
  color: var(--text-main);
}

body.light-theme .btn-secondary:hover {
  background: rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.12);
}

body.light-theme .security-notices {
  background: rgba(0, 0, 0, 0.02);
  border-color: var(--primary);
}

body.light-theme .btn-icon-copy {
  background: rgba(0, 0, 0, 0.03);
  color: var(--text-main);
  border-color: rgba(0, 0, 0, 0.08);
}

body.light-theme .btn-icon-copy:hover {
  background: rgba(0, 0, 0, 0.07);
}

body.light-theme .accordion-content {
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

body.light-theme .options-accordion {
  border-color: rgba(0, 0, 0, 0.05);
  background: rgba(0, 0, 0, 0.01);
}

body.light-theme .card {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05),
              inset 0 1px 1px rgba(255, 255, 255, 0.8);
}

body.light-theme .app-footer {
  border-top-color: rgba(0, 0, 0, 0.05);
}
