/* Mobile-first modern CSS */
:root {
  --primary-blue: #0066ff;
  --success-green: #00c851;
  --error-red: #ff3547;
  --warning-orange: #ff8800;
  --text-dark: #1a1a1a;
  --text-light: #666;
  --bg-overlay: rgba(255, 255, 255, 0.9);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.2);
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 32px;
  --spacing-xs: 8px;
  --spacing-sm: 16px;
  --spacing-md: 24px;
  --spacing-lg: 32px;
  --spacing-xl: 48px;
}

* {
  box-sizing: border-box;
}

body, html {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
}

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

.hidden {
  display: none !important;
}

.skip-link {
  position: absolute;
  top: -40px;  /* Hidden above viewport */
  left: 6px;
  background: var(--primary-blue);
  color: white;
  padding: 8px;
  text-decoration: none;
  border-radius: 4px;
  z-index: 10001;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 6px;  /* Becomes visible when focused */
}


/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: more) {
  :root {
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  }
}

/* Hero Background */
.hero-picture {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Header */
.site-header {
  position: fixed;
  top: var(--spacing-sm);
  left: var(--spacing-sm);
  right: var(--spacing-sm);
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

/* Logo */
.logo {
  width: 60px;
  height: auto;
  background: var(--bg-overlay);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-md);
  padding: var(--spacing-xs);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease;
}

.logo:hover {
  transform: scale(1.05);
}

/* Help Button */
.help-btn {
  background: var(--primary-blue);
  backdrop-filter: blur(20px);
  border: 2px solid transparent;
  color: white;
  cursor: pointer;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  min-width: 56px;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  transition: all 0.2s ease;
}

.help-btn:hover, .help-btn:focus {
  background: #0052cc;
  color: white;
  border-color: white;
  transform: scale(1.1);
  outline: 2px solid white;
  outline-offset: 2px;
  box-shadow: var(--shadow-lg);
}

.help-btn svg {
  width: 24px;
  height: 24px;
}

/* Main Content Container */
.hero-content {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 1;
  padding: var(--spacing-sm);
}

/* Tool Section */
.tool-section {
  width: 100%;
  max-width: 350px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-sm);
}

/* Input Container */
.center-input {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: var(--spacing-sm);
}

.action-buttons {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.action-buttons.hidden {
  display: none
}

.button-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-dark);
  margin-left: var(--spacing-xs);
  margin-right: var(--spacing-md);
  user-select: none;
}

.link-form {
  width: 100%;
}

.input-group {
  width: 100%;
}

.input-wrapper {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  width: 100%;
  position: relative;
}

/* Input Field */
.sleek-input {
  flex: 1;
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-lg);
  border: 2px solid transparent;
  font-size: 1rem;
  font-weight: 500;
  outline: none;
  background: var(--bg-overlay);
  backdrop-filter: blur(20px);
  color: var(--text-dark);
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  min-height: 56px;
  overflow-x: auto;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.sleek-input::placeholder {
  color: var(--text-light);
  font-weight: 400;
}

.sleek-input:focus {
  border-color: var(--primary-blue);
  box-shadow: var(--shadow-lg), 0 0 0 4px rgba(0, 102, 255, 0.1);
  transform: translateY(-1px);
}

.sleek-input:invalid {
  border-color: var(--error-red);
}

/* Buttons */
.delete-btn {
  background: var(--bg-overlay);
  backdrop-filter: blur(20px);
  border: 2px solid transparent;
  color: var(--text-light);
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.delete-btn:hover, .delete-btn:focus {
  background: rgba(255, 255, 255, 0.95);
  color: var(--error-red);
  border-color: var(--error-red);
  transform: scale(1.1);
  outline: 2px solid var(--error-red);
  outline-offset: 2px;
}

.copy-btn, .open-btn {
  background: var(--primary-blue);
  border: none;
  color: white;
  cursor: pointer;
  border-radius: var(--radius-md);
  width: auto;
  min-width: 56px;
  height: 56px;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-xs);
  padding: 0 var(--spacing-md);
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
}

.copy-btn:hover, .copy-btn:focus,
.open-btn:hover, .open-btn:focus {
  background: #0052cc;
  transform: translateY(-2px) scale(1.05);
  box-shadow: var(--shadow-lg);
  outline: 2px solid var(--primary-blue);
  outline-offset: 2px;
}

.copy-btn svg, .open-btn svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.copy-btn svg.hide {
  display: none;
}

.button-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: white;
  user-select: none;
  line-height: 1;
  display: flex;
  align-items: center;
}

/* Popups */
.warning-popup, .copy-popup {
  position: fixed;
  top: var(--spacing-lg);
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  box-shadow: var(--shadow-lg);
  opacity: 1;
  transition: all 0.4s ease;
  pointer-events: none;
  backdrop-filter: blur(20px);
  max-width: calc(100vw - 2 * var(--spacing-sm));
}

.warning-popup {
  background: linear-gradient(135deg, #fff3cd, #ffeaa7);
  color: var(--warning-orange);
  border: 1px solid #f39c12;
}

.copy-popup {
  background: var(--success-green);
  color: white;
}

.copy-popup.success {
  background: linear-gradient(135deg, var(--success-green), #00a085);
}

.copy-popup.error {
  background: linear-gradient(135deg, var(--error-red), #c0392b);
}

.warning-popup.fade, .copy-popup.fade {
  opacity: 0;
  transform: translateX(-50%) translateY(-20px);
}

/* Footer */
.footer {
  width: 100%;
  text-align: center;
  padding: var(--spacing-xs);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-light);
  background: var(--bg-overlay);
  backdrop-filter: blur(20px);
  position: fixed;
  left: 0;
  bottom: 0;
  z-index: 10;
  box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.05);
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-xs);
  max-width: 1200px;
  margin: 0 auto;
}

.footer-credits {
  margin: 0;
}

.footer-credits a {
  color: var(--primary-blue);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.footer-credits a:hover {
  opacity: 0.7;
}

/* Language Selector */
.language-selector {
  position: relative;
}

.language-label {
  display: block;
  font-size: 0.75rem;
  margin-bottom: 4px;
  color: var(--text-light);
  font-weight: 600;
}

.language-dropdown {
  position: relative;
}

.language-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-dark);
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 140px;
  text-align: left;
  backdrop-filter: blur(10px);
}

.language-button:hover {
  background: rgba(255, 255, 255, 0.95);
  border-color: var(--primary-blue);
  transform: translateY(-1px);
}

.language-button:focus {
  outline: 2px solid var(--primary-blue);
  outline-offset: 2px;
}

.language-flag {
  font-size: 1rem;
  line-height: 1;
}

.language-name {
  flex: 1;
}

.language-arrow {
  transition: transform 0.2s ease;
  color: var(--text-light);
}

.language-button[aria-expanded="true"] .language-arrow {
  transform: rotate(180deg);
}

.language-options {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  margin-bottom: 4px;
  padding: 4px 0;
  list-style: none;
  z-index: 1000;
  backdrop-filter: blur(20px);
  overflow: hidden;
}

.language-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-dark);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.language-option:hover {
  background: rgba(0, 102, 255, 0.1);
}

.language-option[aria-selected="true"] {
  background: rgba(0, 102, 255, 0.15);
  color: var(--primary-blue);
  font-weight: 600;
}

.language-option .language-flag {
  font-size: 1rem;
  line-height: 1;
}

.language-option .language-name {
  flex: 1;
}

/* Link Preview */
.link-preview {
  width: 100%;
  max-width: 350px;
  margin-top: var(--spacing-sm);
  animation: slideUp 0.3s ease-out;
}

.link-preview.hidden {
  display: none;
}

.preview-container {
  background: var(--bg-overlay);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  border: 2px solid rgba(0, 102, 255, 0.1);
}

.preview-content {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm);
}

.preview-image-container {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: opacity 0.3s ease;
}

.preview-image.hidden {
  opacity: 0;
}

.preview-loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
}

.preview-loader.hidden {
  display: none;
}

.loader-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid #e5e7eb;
  border-top: 2px solid var(--primary-blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.preview-error {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-xs);
  color: var(--text-light);
  font-size: 0.875rem;
  text-align: center;
  z-index: 2;
}

.preview-error.hidden {
  display: none;
}

.preview-error svg {
  width: 32px;
  height: 32px;
  opacity: 0.5;
}

.preview-info {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.preview-creator {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary-blue);
  background: rgba(0, 102, 255, 0.1);
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--radius-sm);
  text-align: center;
  border: 1px solid rgba(0, 102, 255, 0.2);
}

.preview-creator.hidden {
  display: none;
}

/* Animation for preview appearance */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}


/* Icon visibility states */
.hide {
  display: none !important;
}

/* Loading Indicator */

/* Loader */
.loader-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(8px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.loader-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transform: rotate(-90deg);
}

.loader-dots {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.loader-dot {
  animation: bounce 1.2s ease-in-out infinite;
}

.loader-dot:nth-child(1) { animation-delay: 0s; }
.loader-dot:nth-child(2) { animation-delay: 0.2s; }
.loader-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
  0%, 80%, 100% {
    transform: scale(0.8);
    opacity: 0.6;
  }
  40% {
    transform: scale(1.2);
    opacity: 1;
  }
}

/* Tablet Styles */
@media (min-width: 768px) {
  .logo {
    width: 80px;
    top: var(--spacing-md);
    left: var(--spacing-md);
  }

  .tool-section {
    max-width: 500px;
  }

  .center-input {
    max-width: 500px;
  }

  .sleek-input {
    font-size: 1.1rem;
    padding: var(--spacing-md) var(--spacing-lg);
  }

  .copy-popup, .warning-popup {
    font-size: 1rem;
    padding: var(--spacing-md) var(--spacing-lg);
  }

  .footer {
    font-size: 0.95rem;
    padding: var(--spacing-md);
  }

  .footer-content {
    flex-direction: row;
    justify-content: space-between;
  }

  .language-selector {
    margin-left: auto;
  }

  .help-modal-header h2 {
    font-size: 1.3rem;
  }
}

/* Desktop Styles */
@media (min-width: 1024px) {
  .logo {
    width: 90px;
    top: var(--spacing-lg);
    left: var(--spacing-lg);
  }

  .tool-section {
    max-width: 650px;
  }

  .center-input {
    max-width: 600px;
  }

  .sleek-input {
    font-size: 1.25rem;
    padding: var(--spacing-md) var(--spacing-xl);
    min-height: 64px;
  }

  .copy-btn, .open-btn {
    height: 64px;
    min-height: 64px;
  }

  .copy-btn svg, .open-btn svg {
    width: 24px;
    height: 24px;
  }

  .delete-btn {
    width: 48px;
    height: 48px;
  }

  .copy-popup, .warning-popup {
    font-size: 1.15rem;
    top: var(--spacing-xl);
  }

  .footer {
    font-size: 1rem;
  }
}

/* Large Desktop */
@media (min-width: 1440px) {
  .tool-section {
    max-width: 800px;
  }

  .center-input {
    max-width: 700px;
  }

  .sleek-input {
    font-size: 1.4rem;
    min-height: 72px;
  }
}

/* Help Modal */
.help-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-sm);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.help-modal.show {
  opacity: 1;
  visibility: visible;
}

.help-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
}

.help-modal-content {
  position: relative;
  background: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s ease;
}

.help-modal.show .help-modal-content {
  transform: scale(1) translateY(0);
}

.help-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-md);
  border-bottom: 1px solid #eee;
}

.help-modal-header h2 {
  margin: 0;
  font-size: 1.10rem;
  font-weight: 600;
  color: var(--text-dark);
}

.help-close-btn {
  background: transparent;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.help-close-btn:hover, .help-close-btn:focus {
  background: #f5f5f5;
  color: var(--text-dark);
  outline: 2px solid var(--primary-blue);
  outline-offset: 2px;
}

.help-modal-body {
  padding: var(--spacing-md);
}

.help-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.help-step {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-sm);
}

.help-step-icon {
  background: var(--primary-blue);
  color: white;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
  margin-top: 2px;
}

.help-step-content h3 {
  margin: 0 0 var(--spacing-xs) 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-dark);
}

.help-step-content p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.5;
}
