/* Base styles */
:root {
  /* Light theme colors */
  --primary-color: #764ba2;
  --primary-hover: #653a8f;
  --secondary-color: #667eea;
  --text-color: #2d3748;
  --text-light: #6b7280;
  --bg-color: #f7fafc;
  --bg-light: #f9fafb;
  --border-color: #e2e8f0;
  --error-color: #e53e3e;
  --success-color: #38a169;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Dark theme colors */
.dark-theme {
  --primary-color: #8b5cf6;
  --primary-hover: #7c3aed;
  --secondary-color: #6366f1;
  --text-color: #f9fafb;
  --text-light: #d1d5db;
  --bg-color: #111827;
  --bg-light: #1f2937;
  --border-color: #374151;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}

body {
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  color: var(--text-color);
  line-height: 1.5;
}

.dark-theme body {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

.theme-toggle {
  position: fixed;
  top: 2rem;
  right: 2rem;
  z-index: 1000;
}

.theme-btn {
  background: var(--bg-color);
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--primary-color);
  box-shadow: var(--shadow-lg);
  transition: all 0.3s ease;
}

.theme-btn:hover {
  transform: scale(1.1);
}

.dark-theme .light-icon {
  display: none;
}

.dark-theme .dark-icon {
  display: block;
}

.light-icon {
  display: block;
}

.dark-icon {
  display: none;
}

.container {
  width: 100%;
  max-width: 800px;
  padding: 2rem;
}

.card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.header img {
  width: 32px;
  height: 32px;
}

.header h1 {
  color: #2d3748;
  font-size: 1.8rem;
  font-weight: 600;
}

.subtitle {
  color: var(--text-light);
  font-size: 1rem;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.url-input-wrapper, .result-wrapper {
  position: relative;
  width: 100%;
}

.url-input-wrapper i, .result-wrapper i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #764ba2;
  font-size: 1.2rem;
}

input[type="text"] {
  width: 100%;
  padding: 1rem 1rem 1rem 3rem;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 1rem;
  transition: all 0.3s ease;
}

input[type="text"]:focus {
  outline: none;
  border-color: #764ba2;
  box-shadow: 0 0 0 3px rgba(118, 75, 162, 0.1);
}

.options-group {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-light);
  border-radius: 12px;
}

.custom-toggle, .expiration-group {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem;
  background: #f7fafc;
  border-radius: 10px;
}

.custom-toggle span, .expiration-group i {
  color: #4a5568;
  font-size: 0.9rem;
}

.expiration-group i {
  color: #764ba2;
  font-size: 1.2rem;
}

input[type="datetime-local"], input[type="number"] {
  padding: 0.5rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.9rem;
}

.expiration-group label {
  color: #4a5568;
  font-size: 0.9rem;
}

/* Switch Toggle */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #e2e8f0;
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
}

input:checked + .slider {
  background-color: #764ba2;
}

input:checked + .slider:before {
  transform: translateX(26px);
}

.slider.round {
  border-radius: 24px;
}

.slider.round:before {
  border-radius: 50%;
}

.toggle-text {
  color: #4a5568;
  font-size: 0.9rem;
}

.custom-input {
  position: relative;
  width: 100%;
  margin-top: 0.5rem;
}

.custom-input i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #764ba2;
  font-size: 1.2rem;
}

.custom-input input {
  width: 100%;
  padding: 0.8rem 1rem 0.8rem 3rem;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.custom-input input:focus {
  outline: none;
  border-color: #764ba2;
  box-shadow: 0 0 0 3px rgba(118, 75, 162, 0.1);
}

.primary-btn, .secondary-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.primary-btn {
  background: #764ba2;
  color: white;
}

.primary-btn:hover {
  background: #653a8f;
  transform: translateY(-2px);
}

.secondary-btn {
  background: #f7fafc;
  color: #764ba2;
  border: 2px solid #764ba2;
}

.secondary-btn:hover {
  background: #764ba2;
  color: white;
}

.result {
  display: none;
  gap: 1rem;
  margin-top: 1.5rem;
  animation: fadeIn 0.5s ease;
}

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

.result input {
  background: #f7fafc;
  padding-right: 1rem;
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.feature-card {
  background: var(--bg-color);
  padding: 2rem;
  border-radius: 16px;
  text-align: center;
  box-shadow: var(--shadow-md);
}

.feature-card i {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.feature-card h3 {
  color: var(--text-color);
  margin-bottom: 0.5rem;
}

.feature-card p {
  color: var(--text-light);
  font-size: 0.9rem;
}

footer {
  text-align: center;
  margin-top: 2rem;
  color: white;
  font-size: 0.9rem;
}

footer i {
  color: #ff6b6b;
  margin: 0 0.2rem;
}

footer a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  position: relative;
  transition: all 0.3s ease;
}

footer a:hover {
  color: #f0f0f0;
}

footer a::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 1px;
  bottom: -2px;
  left: 0;
  background-color: white;
  transform: scaleX(0);
  transform-origin: bottom right;
  transition: transform 0.3s ease;
}

footer a:hover::after {
  transform: scaleX(1);
  transform-origin: bottom left;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 3rem;
  padding: 2rem;
  background: var(--bg-color);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
}

.footer-section h4 {
  color: var(--text-color);
  margin-bottom: 1rem;
}

.footer-section ul {
  list-style: none;
}

.footer-section ul li {
  margin-bottom: 0.5rem;
}

.social-links {
  display: flex;
  gap: 1rem;
}

.social-links a {
  color: var(--text-light);
  font-size: 1.25rem;
  transition: color 0.3s ease;
}

.social-links a:hover {
  color: var(--primary-color);
}

.footer-bottom {
  text-align: center;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.copyright {
  margin-top: 0.5rem;
  font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 640px) {
  .container {
    padding: 1rem;
  }
  
  .card {
    padding: 1.5rem;
  }
  
  .header h1 {
    font-size: 1.5rem;
  }
  
  .expiration-group {
    flex-direction: column;
    align-items: flex-start;
  }

  .expiration-group input[type="datetime-local"],
  .expiration-group input[type="number"] {
    width: 100%;
  }
  
  .result {
    flex-direction: column;
  }
  
  .primary-btn, .secondary-btn {
    width: 100%;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .theme-toggle {
    top: 1rem;
    right: 1rem;
  }

  .theme-btn {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
}

@media (max-width: 768px) {
  .flex-toggle-group {
    align-items: flex-start;
    flex-direction: column;
  }
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.qr-code-container {
    margin-top: 1rem;
    text-align: center;
    padding: 1rem;
    background: rgba(118, 75, 162, 0.05);
    border-radius: 10px;
}

.qr-code-wrapper {
    margin-bottom: 1rem;
}

.qr-code-wrapper canvas {
    border-radius: 10px;
    padding: 1rem;
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

#downloadQrBtn {
    width: 100%;
    max-width: 200px;
}

.qr-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.qr-popup.show {
    display: flex;
}

.qr-popup-content {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    position: relative;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #666;
    padding: 5px;
}

.close-btn:hover {
    color: #764ba2;
}

#qrcode {
    margin: 1rem 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

#qrcode img {
    display: block;
    margin: 0 auto;
}

#downloadQrBtn {
    margin-top: 1rem;
    min-width: 150px;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    justify-content: space-evenly;
    flex-wrap: wrap;
}

.action-buttons .secondary-btn {
    /* flex: 1; */
    min-width: 70px;
    max-width: 90px;
    margin: 0;
    font-size: 1rem;
    padding: 0.2rem 0.4rem;
    border: none;
}

.flex-toggle-group {
    display: flex;
    gap: 1rem;
    /* align-items: center; */
}