:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #1a1a2e;
  --bg-card: rgba(26, 26, 46, 0.3);
  --bg-card-hover: rgba(26, 26, 46, 0.4);
  --accent: #f1c463;
  --accent-hover: #e5d546;
  --text-primary: #ffffff;
  --text-secondary: #a1a1aa;
  --border: rgba(255, 255, 255, 0.15);
  --border-hover: rgba(255, 255, 255, 0.25);
  --shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
  --glow: 0 0 20px rgba(99, 102, 241, 0.3);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  height: 100%;
  height: 100vh;
  height: 100dvh;
  overflow-x: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-primary);
  background-image: url("/static/bg.svg"), linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow-x: hidden;
  position: relative;
}

.main-container {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  padding: max(2rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  box-sizing: border-box;
}

.logo-space {
  height: 80px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 1rem;
  position: relative;
  padding: 0 1rem;
}

.back-to-home-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.back-to-home-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.back-to-home-btn i {
  font-size: 1rem;
  transition: transform 0.3s ease;
}

.back-to-home-btn:hover i {
  transform: translateX(-2px);
}

/* Navigation Styles */
.nav-container {
  width: 100%;
  max-width: 600px;
  margin-bottom: 1rem;
  display: flex;
  justify-content: center;
}

.nav-tabs {
  display: flex;
  background: var(--bg-card);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: 8px;
  gap: 4px;
}

.nav-tab {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 12px 24px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 120px;
  justify-content: center;
  position: relative;
  text-decoration: none;
}

.nav-tab:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.nav-tab.active {
  background: var(--accent);
  color: #000;
  box-shadow: 0 4px 15px rgba(241, 196, 99, 0.3);
  transform: translateY(-2px);
}

.nav-tab.active:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
}

.nav-tab i {
  font-size: 1rem;
}

/* Tab Content Styles */
.tab-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tab-pane {
  display: none;
  width: 100%;
  align-items: center;
  flex-direction: column;
}

.tab-pane.active {
  display: flex;
}

/* Welcome Container Styles */
.welcome-container {
  width: 100%;
  max-width: 500px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 300px;
  padding: 2rem;
}

.welcome-content {
  text-align: center;
  background: var(--bg-card);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3rem 2rem;
  box-shadow: var(--shadow);
  width: 100%;
}

.welcome-icon {
  font-size: 4rem;
  color: var(--accent);
  margin-bottom: 1.5rem;
}

.welcome-content h2 {
  font-size: 2rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.welcome-content p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  line-height: 1.6;
}

.quick-access {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.quick-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: white;
  text-decoration: none;
  padding: 1rem 2rem;
  border-radius: 15px;
  font-weight: 500;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
  min-width: 280px;
  text-align: center;
}

.quick-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
  background: linear-gradient(135deg, var(--accent-hover), #9333ea);
}

.quick-link i {
  font-size: 1.2rem;
}

.container {
  width: 100%;
  max-width: 400px;
  background: var(--bg-card);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 2rem;
  box-shadow: var(--shadow), 0 0 40px rgba(26, 26, 46, 0.1);
  animation: slideUp 0.6s ease-out;
  margin-top: 1rem;
  margin-bottom: 1rem;
  transition: all 0.3s ease;
}

.container:hover {
  background: var(--bg-card-hover);
  border: 1px solid var(--border-hover);
  box-shadow: var(--shadow), 0 0 60px rgba(26, 26, 46, 0.15);
  transform: translateY(-2px);
}

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

.logo {
  text-align: center;
  margin-bottom: 1.5rem;
}

.logo-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin-bottom: 1rem;
  box-shadow: var(--glow);
}

.logo-icon i {
  color: white;
}

.platform-support {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  text-align: center;
  display: flex;
  justify-content: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.platform-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.8rem;
}

.platform-item i {
  font-size: 1rem;
}

h1 {
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.form-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.input-group {
  position: relative;
  display: flex;
  gap: 0.5rem;
}

input[type="url"] {
  flex: 1;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 16px;
  color: var(--text-primary);
  font-size: 1rem;
  transition: all 0.3s ease;
  outline: none;
}

input[type="url"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

input[type="url"]::placeholder {
  color: var(--text-secondary);
}

.paste-btn {
  padding: 1rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border);
  border-radius: 16px;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  outline: none;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.paste-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(241, 196, 99, 0.1), rgba(139, 92, 246, 0.1));
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.paste-btn:hover::before {
  opacity: 1;
}

.paste-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--border-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.paste-btn:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(241, 196, 99, 0.3);
}

.paste-btn:active {
  transform: translateY(0px) scale(0.95);
  transition: all 0.1s ease;
}

/* Enhanced states for paste button */
.paste-btn.loading {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.4);
  cursor: wait;
  animation: pulseLoading 1.5s ease-in-out infinite;
}

.paste-btn.success {
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(34, 197, 94, 0.4);
  color: #22c55e;
  animation: successPulse 0.6s ease-out;
}

.paste-btn.error {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
  color: #ef4444;
  animation: errorShake 0.5s ease-out;
}

/* Enhanced animations */
@keyframes pulseLoading {
  0%, 100% {
    opacity: 1;
    transform: translateY(-50%) scale(1);
  }
  50% {
    opacity: 0.8;
    transform: translateY(-50%) scale(1.02);
  }
}

@keyframes successPulse {
  0% {
    transform: translateY(-50%) scale(0.95);
    opacity: 0.8;
  }
  50% {
    transform: translateY(-50%) scale(1.05);
    opacity: 1;
  }
  100% {
    transform: translateY(-50%) scale(1);
    opacity: 1;
  }
}

@keyframes errorShake {
  0%, 100% {
    transform: translateY(-50%) translateX(0);
  }
  25% {
    transform: translateY(-50%) translateX(-4px);
  }
  75% {
    transform: translateY(-50%) translateX(4px);
  }
}

/* Mobile-specific enhancements */
@media (max-width: 768px) {
  /* Back to home button responsive styles */
  .back-to-home-btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 10px;
  }
  
  .back-to-home-btn span {
    display: none;
  }
  
  .back-to-home-btn i {
    font-size: 1rem;
    margin: 0;
  }
  
  /* Navigation responsive styles */
  .nav-container {
    max-width: 100%;
    padding: 0 1rem;
  }
  
  .nav-tabs {
    width: 100%;
    justify-content: center;
  }
  
  .nav-tab {
    font-size: 0.9rem;
    padding: 10px 20px;
    min-width: 100px;
  }
  
  .nav-tab i {
    font-size: 0.9rem;
  }

  .paste-btn {
    min-width: 48px;
    padding: 0.875rem;
    border-radius: 14px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
  
  .paste-btn:active {
    transform: translateY(-50%) scale(0.92);
    background: rgba(255, 255, 255, 0.2);
  }
  
  /* Enhanced touch feedback */
  .paste-btn:hover {
    transform: none; /* Disable hover on mobile */
  }
  
  @media (hover: none) and (pointer: coarse) {
    .paste-btn:hover {
      background: rgba(255, 255, 255, 0.1);
      transform: none;
      box-shadow: none;
    }
  }
}

.download-btn {
  width: 100%;
  padding: 1.25rem;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  border: none;
  border-radius: 16px;
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: var(--glow);
}

.download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(99, 102, 241, 0.4);
}

.download-btn:active {
  transform: translateY(0);
}

.download-btn.youtube-mode {
  background: linear-gradient(135deg, #ff0000, #cc0000);
  box-shadow: 0 0 20px rgba(255, 0, 0, 0.3);
}

.download-btn.youtube-mode:hover {
  box-shadow: 0 0 30px rgba(255, 0, 0, 0.4);
}

.download-btn.tiktok-mode {
  background: linear-gradient(135deg, #000000, #ff0050);
  box-shadow: 0 0 20px rgba(255, 0, 80, 0.3);
}

.download-btn.tiktok-mode:hover {
  box-shadow: 0 0 30px rgba(255, 0, 80, 0.4);
}

.download-btn.instagram-mode {
  background: linear-gradient(135deg, #e4405f, #833ab4, #fccc63);
  box-shadow: 0 0 20px rgba(228, 64, 95, 0.3);
}

.download-btn.instagram-mode:hover {
  box-shadow: 0 0 30px rgba(228, 64, 95, 0.4);
}

.download-btn.x-mode {
  background: linear-gradient(135deg, #000000, #1da1f2);
  box-shadow: 0 0 20px rgba(29, 161, 242, 0.3);
}

.download-btn.x-mode:hover {
  box-shadow: 0 0 30px rgba(29, 161, 242, 0.4);
}

.features {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.feature-list {
  display: grid;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.feature-icon {
  width: 32px;
  height: 32px;
  background: rgba(99, 102, 241, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.feature-item:hover .feature-icon {
  background: rgba(99, 102, 241, 0.25);
  border: 1px solid rgba(99, 102, 241, 0.3);
  transform: scale(1.05);
}

/* iOS and PWA specific styles */
@supports (-webkit-touch-callout: none) {
  html, body {
    height: 100%;
    height: -webkit-fill-available;
    overflow-x: hidden;
  }
  
  .main-container {
    min-height: -webkit-fill-available;
    height: -webkit-fill-available;
  }
}

/* PWA standalone mode */
@media (display-mode: standalone) {
  html, body {
    height: 100vh;
    height: 100dvh;
    overflow-x: hidden;
    background-color: var(--bg-primary);
    background-image: url("https://natan.la/bg.svg"), linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    background-attachment: fixed;
  }
  
  .main-container {
    min-height: 100vh;
    min-height: 100dvh;
    height: 100vh;
    height: 100dvh;
  }
  
  .logo-space {
    height: 100px;
    margin-bottom: 1.5rem;
  }
}

/* Fullscreen mode */
@media (display-mode: fullscreen) {
  html, body {
    height: 100vh;
    height: 100dvh;
    overflow-x: hidden;
  }
  
  .main-container {
    min-height: 100vh;
    min-height: 100dvh;
    height: 100vh;
    height: 100dvh;
  }
}

/* Bitcoin Price Container Styles */
.bitcoin-price-container {
  width: 100%;
  max-width: 400px;
  margin-top: 2rem;
  padding: 1rem 1.5rem;
  background: rgba(26, 26, 46, 0.3);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 16px;
  animation: slideUp 0.6s ease-out 0.1s both;
  flex-shrink: 0;
  transition: all 0.3s ease;
  box-sizing: border-box;
  position: relative;
  cursor: pointer;
}

.bitcoin-price-container:hover {
  background: rgba(26, 26, 46, 0.4);
  border: 1px solid var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.bitcoin-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-align: center;
  width: 100%;
}

.bitcoin-main-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: nowrap;
}

.bitcoin-icon {
  flex-shrink: 0;
}

.bitcoin-icon i {
  color: #f7931a;
  font-size: 1.5rem;
  filter: drop-shadow(0 0 8px rgba(247, 147, 26, 0.3));
}

.bitcoin-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.bitcoin-header i {
  color: #f7931a;
  font-size: 1.25rem;
  filter: drop-shadow(0 0 8px rgba(247, 147, 26, 0.3));
}

.bitcoin-header h3 {
  color: var(--text-primary);
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
}

.bitcoin-price {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
  text-shadow: 0 0 10px rgba(241, 196, 99, 0.3);
  letter-spacing: -0.5px;
  word-break: break-word;
  line-height: 1.2;
  flex: 1;
  text-align: center;
}

.price-loading {
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 400;
}

.bitcoin-change {
  font-size: 0.85rem;
  font-weight: 600;
  word-break: break-word;
  line-height: 1.3;
  text-align: right;
  flex-shrink: 0;
  min-width: 80px;
}

.change-positive {
  color: #10b981;
}

.change-negative {
  color: #ef4444;
}

.change-24h {
  color: var(--text-secondary);
}

.bitcoin-updated {
  color: var(--text-secondary);
  font-size: 0.75rem;
  opacity: 0.8;
}

.click-hint {
  color: var(--text-secondary);
  font-size: 0.7rem;
  opacity: 0.7;
  margin-top: 0.25rem;
  transition: opacity 0.3s ease;
}

.bitcoin-price-container:hover .click-hint {
  opacity: 1;
}

/* Bitcoin Modal Styles - Now using legal-modal structure */

/* Legal Footer Styles */
.legal-footer {
  width: 100%;
  max-width: 400px;
  margin-top: 3rem;
  padding: 1.5rem;
  background: rgba(26, 26, 46, 0.25);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 16px;
  animation: slideUp 0.6s ease-out 0.2s both;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.legal-footer:hover {
  background: rgba(26, 26, 46, 0.35);
  border: 1px solid var(--border-hover);
  transform: translateY(-1px);
}

.legal-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

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

.legal-header i {
  color: var(--accent);
  font-size: 1.1rem;
}

.legal-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.disclaimer {
  background: rgba(255, 193, 7, 0.1);
  border: 1px solid rgba(255, 193, 7, 0.3);
  border-radius: 8px;
  padding: 0.75rem;
}

.disclaimer-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.disclaimer-item i {
  color: #ffc107;
  margin-top: 0.1rem;
  flex-shrink: 0;
}

.legal-links {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.legal-link {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.8rem;
  transition: all 0.3s ease;
  cursor: pointer;
}

.legal-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  transform: translateY(-1px);
  border: 1px solid var(--border-hover);
}

.legal-link i {
  font-size: 0.9rem;
}

.legal-text {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Legal Modal Styles */
.legal-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.legal-modal-content {
  background-color: var(--bg-card);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  margin: 5% auto;
  padding: 2rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  animation: slideUp 0.3s ease-out;
  box-shadow: var(--shadow), 0 0 50px rgba(26, 26, 46, 0.2);
}

.legal-modal-close {
  color: var(--text-secondary);
  float: right;
  font-size: 2rem;
  font-weight: bold;
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  cursor: pointer;
  transition: color 0.3s ease;
}

.legal-modal-close:hover {
  color: var(--text-primary);
}

.legal-modal h2 {
  color: var(--accent);
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.legal-modal h3 {
  color: var(--text-primary);
  margin: 1.5rem 0 0.5rem 0;
  font-size: 1.1rem;
}

.legal-modal p, .legal-modal li {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}

.legal-modal ul {
  padding-left: 1.5rem;
}

.legal-modal a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.3s ease;
}

.legal-modal a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* Bitcoin Modal Specific Styles */
.bitcoin-stats-list {
  margin-bottom: 1.5rem;
}

.bitcoin-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 0.5rem;
}

.bitcoin-stat-row:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.bitcoin-stat-row strong {
  color: var(--text-primary);
  font-weight: 600;
  min-width: 140px;
}

.bitcoin-stat-row span {
  color: var(--accent);
  font-weight: 500;
  text-align: right;
}

.change-positive {
  color: #10b981 !important;
}

.change-negative {
  color: #ef4444 !important;
}

#bitcoinModalBody .fab.fa-bitcoin {
  color: #f7931a;
  margin-right: 0.5rem;
}

/* AI Footer Styles */
.ai-footer {
  width: 100%;
  max-width: 400px;
  margin-top: 1rem;
  margin-bottom: 1rem;
  padding: 1rem;
  background: rgba(26, 26, 46, 0.2);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 12px;
  animation: slideUp 0.6s ease-out 0.4s both;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.ai-footer:hover {
  background: rgba(26, 26, 46, 0.3);
  border: 1px solid var(--border-hover);
  transform: translateY(-1px);
}

.ai-container {
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-align: center;
  font-weight: 500;
  letter-spacing: 0.5px;
}

/* CMP (Consent Management Platform) Styles */
.cmp-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(26, 26, 46, 0.3);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-top: 1px solid var(--border);
  padding: 1.5rem;
  z-index: 9999;
  transform: translateY(100%);
  transition: transform 0.3s ease-out;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.3);
}

.cmp-banner.show {
  transform: translateY(0);
}

.cmp-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cmp-text {
  color: var(--text-primary);
  font-size: 0.9rem;
  line-height: 1.5;
}

.cmp-text a {
  color: var(--accent);
  text-decoration: none;
}

.cmp-text a:hover {
  text-decoration: underline;
}

.cmp-buttons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

.cmp-btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.cmp-btn-accept {
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: white;
}

.cmp-btn-accept:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(241, 196, 99, 0.3);
}

.cmp-btn-reject {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.cmp-btn-reject:hover {
  background: rgba(255, 255, 255, 0.1);
}

.cmp-btn-settings {
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.cmp-btn-settings:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.cmp-preferences-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.cmp-preferences-content {
  background: var(--bg-card);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border-radius: 16px;
  border: 1px solid var(--border);
  max-width: 600px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 2rem;
  box-shadow: var(--shadow), 0 0 50px rgba(26, 26, 46, 0.2);
}

.cmp-preferences-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.cmp-preferences-title {
  color: var(--accent);
  font-size: 1.3rem;
  font-weight: 600;
}

.cmp-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.cmp-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.cmp-category {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 8px;
  border: 1px solid var(--border);
  transition: all 0.3s ease;
}

.cmp-category:hover {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-hover);
}

.cmp-category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.cmp-category-title {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 1rem;
}

.cmp-category-desc {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.4;
}

.cmp-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.cmp-toggle.active {
  background: var(--accent);
}

.cmp-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s ease;
}

.cmp-toggle.active::after {
  transform: translateX(20px);
}

.cmp-toggle.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Custom Animations */
@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Tablet and Medium Mobile Responsive Styles */
@media (max-width: 768px) {
  .bitcoin-price-container {
    margin: 0.75rem;
    margin-top: 2rem;
    padding: 1rem 1.25rem;
    border-radius: 14px;
    width: calc(100% - 1.5rem);
    max-width: none;
  }

  .bitcoin-main-row {
    gap: 0.5rem;
  }

  .bitcoin-price {
    font-size: 1.3rem;
  }

  .bitcoin-icon i {
    font-size: 1.4rem;
  }

  .bitcoin-change {
    font-size: 0.8rem;
    min-width: 75px;
  }
}

/* Mobile Responsive Styles */
@media (max-width: 480px) {
  /* Navigation responsive styles for small screens */
  .nav-container {
    padding: 0 0.5rem;
    margin-bottom: 0.75rem;
  }
  
  .nav-tabs {
    padding: 6px;
  }
  
  .nav-tab {
    font-size: 0.85rem;
    padding: 8px 16px;
    min-width: 80px;
    gap: 6px;
  }
  
  .nav-tab i {
    font-size: 0.85rem;
  }

  /* Welcome container responsive styles */
  .welcome-container {
    padding: 1rem 0.5rem;
    min-height: 250px;
  }
  
  .welcome-content {
    padding: 2rem 1.5rem;
  }
  
  .welcome-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
  }
  
  .welcome-content h2 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
  }
  
  .welcome-content p {
    font-size: 1rem;
    margin-bottom: 1.5rem;
  }
  
  .quick-link {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    min-width: 260px;
  }

  .main-container {
    padding: max(1.5rem, env(safe-area-inset-top)) max(0.5rem, env(safe-area-inset-right)) max(0.5rem, env(safe-area-inset-bottom)) max(0.5rem, env(safe-area-inset-left));
  }
  
  .logo-space {
    height: 60px;
    margin-bottom: 0.75rem;
  }
  
  .container {
    margin: 0 0.5rem;
    margin-top: 1rem;
    padding: 1.5rem;
    border-radius: 20px;
    width: calc(100% - 1rem);
    max-width: none;
  }

  h1 {
    font-size: 1.25rem;
  }

  input[type="url"], .paste-btn, .download-btn {
    padding: 0.875rem;
  }

  .bitcoin-price-container {
    margin: 0.5rem;
    margin-top: 1.5rem;
    padding: 0.875rem 1rem;
    border-radius: 12px;
    width: calc(100% - 1rem);
    max-width: none;
  }

  .bitcoin-content {
    gap: 0.375rem;
  }

  .bitcoin-main-row {
    gap: 0.5rem;
  }

  .bitcoin-icon i {
    font-size: 1.3rem;
  }

  .bitcoin-price {
    font-size: 1.2rem;
    letter-spacing: -0.25px;
  }

  .bitcoin-change {
    font-size: 0.75rem;
    min-width: 70px;
  }

  .bitcoin-updated {
    font-size: 0.7rem;
  }

  .click-hint {
    font-size: 0.65rem;
  }

  .legal-footer {
    margin: 0.5rem;
    margin-top: 2rem;
    padding: 1rem;
    border-radius: 12px;
    width: calc(100% - 1rem);
    max-width: none;
  }

  .ai-footer {
    margin: 0.5rem;
    padding: 0.75rem;
    border-radius: 10px;
    width: calc(100% - 1rem);
    max-width: none;
  }

  .legal-links {
    flex-direction: column;
    gap: 0.5rem;
  }

  .legal-link {
    justify-content: center;
  }

  .legal-modal-content {
    margin: 5vh auto;
    padding: 1rem;
    padding-top: 3rem;
    width: calc(100% - 2rem);
    max-height: 85vh;
    border-radius: 12px;
  }

  .legal-modal-close {
    top: 0.75rem;
    right: 0.75rem;
    font-size: 1.75rem;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    z-index: 1001;
  }

  .cmp-banner {
    padding: 1rem;
  }

  .cmp-content {
    text-align: center;
  }

  .cmp-buttons {
    flex-direction: column;
  }

  .cmp-btn {
    width: 100%;
    justify-content: center;
  }

  .cmp-preferences-modal {
    padding: 1rem;
  }

  .cmp-preferences-content {
    padding: 1.5rem;
  }
}

/* Ensure consistent background on all devices */
@media (orientation: landscape) {
  html, body {
    height: 100vh;
    height: 100dvh;
  }
  
  .main-container {
    min-height: 100vh;
    min-height: 100dvh;
  }
}

/* Very small screens */
@media (max-width: 320px) {
  .main-container {
    padding: max(0.25rem, env(safe-area-inset-top)) max(0.25rem, env(safe-area-inset-right)) max(0.25rem, env(safe-area-inset-bottom)) max(0.25rem, env(safe-area-inset-left));
  }
  
  .container {
    margin: 0 0.25rem;
    padding: 1rem;
    width: calc(100% - 0.5rem);
  }
  
  .bitcoin-price-container {
    margin: 0.25rem;
    margin-top: 1rem;
    width: calc(100% - 0.5rem);
    padding: 0.75rem;
  }

  .bitcoin-content {
    gap: 0.3rem;
  }

  .bitcoin-main-row {
    gap: 0.375rem;
  }

  .bitcoin-icon i {
    font-size: 1.1rem;
  }

  .bitcoin-price {
    font-size: 1.1rem;
    letter-spacing: 0;
  }

  .bitcoin-change {
    font-size: 0.7rem;
    min-width: 60px;
  }

  .bitcoin-updated {
    font-size: 0.65rem;
  }

  .click-hint {
    font-size: 0.6rem;
  }

  .legal-footer {
    margin: 0.25rem;
    margin-top: 1.5rem;
    width: calc(100% - 0.5rem);
  }

  .ai-footer {
    margin: 0.25rem;
    width: calc(100% - 0.5rem);
    padding: 0.75rem;
  }

  .legal-modal-content {
    margin: 5vh auto;
    padding: 0.75rem;
    padding-top: 3.5rem;
    width: calc(100% - 1rem);
    max-height: 85vh;
  }

  .legal-modal-close {
    top: 0.5rem;
    right: 0.5rem;
    font-size: 1.5rem;
    width: 2.25rem;
    height: 2.25rem;
  }

  /* Bitcoin Stats Mobile Styles */
  .bitcoin-stat-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    padding: 0.5rem 0;
  }

  .bitcoin-stat-row strong {
    min-width: unset;
    font-size: 0.85rem;
  }

  .bitcoin-stat-row span {
    font-size: 0.9rem;
    text-align: left;
  }
}

/* PDF Optimizer Styles */
.pdf-tools-container {
  width: 100%;
  max-width: 800px;
  margin: 2rem auto;
}

.tool-selector {
  margin-bottom: 2rem;
}

.tool-options {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 2rem;
}

.tool-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
  min-width: 140px;
  justify-content: center;
}

.tool-option:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.tool-option.active {
  background: var(--accent);
  color: var(--bg-primary);
  border-color: var(--accent);
}

.tool-option.active:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.tool-option i {
  font-size: 1.2rem;
}

.tool-content {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.tool-content.active {
  display: block;
}

.tool-header {
  text-align: center;
  margin-bottom: 2rem;
}

.tool-header h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.tool-header p {
  color: var(--text-secondary);
  font-size: 1rem;
}

.file-upload-area {
  margin-bottom: 1.5rem;
}

.file-upload-area input[type="file"] {
  display: none;
}

.file-upload-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  border: 2px dashed var(--border);
  border-radius: 12px;
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  min-height: 150px;
  position: relative;
  z-index: 1;
  pointer-events: auto;
}

.file-upload-label:hover,
.file-upload-label.drag-over {
  border-color: var(--accent);
  background: var(--bg-card-hover);
}

.file-upload-label i {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--accent);
}

.file-upload-label span {
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.file-upload-label small {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.compression-options,
.split-options,
.convert-options {
  margin-bottom: 1.5rem;
}

.option-group {
  margin-bottom: 1rem;
}

.option-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-primary);
}

.option-group select,
.option-group input[type="text"] {
  width: 100%;
  padding: 0.75rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 1rem;
}

.option-group select:focus,
.option-group input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(241, 196, 99, 0.2);
}

.option-group small {
  display: block;
  margin-top: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.file-list {
  margin-bottom: 1.5rem;
}

.file-list h4 {
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.file-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
}

.file-info i {
  color: var(--accent);
  font-size: 1.2rem;
}

.file-name {
  font-weight: 500;
  color: var(--text-primary);
}

.file-size {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.file-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-small {
  padding: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-small:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
}

.notification {
  position: fixed;
  top: 2rem;
  right: 2rem;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 1rem;
  z-index: 1000;
  min-width: 300px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.notification.success {
  background: rgba(34, 197, 94, 0.9);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: white;
}

.notification.error {
  background: rgba(239, 68, 68, 0.9);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: white;
}

.close-notification {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0;
  margin-left: auto;
}

.close-notification:hover {
  opacity: 0.7;
}

/* Responsive Design for PDF Tools */
@media (max-width: 768px) {
  .tool-options {
    flex-direction: column;
    align-items: center;
  }
  
  .tool-option {
    width: 100%;
    max-width: 280px;
  }
  
  .tool-content {
    padding: 1.5rem;
  }
  
  .file-upload-label {
    padding: 2rem 1rem;
    min-height: 120px;
  }
  
  .file-upload-label i {
    font-size: 2rem;
  }
  
  .file-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .file-actions {
    align-self: flex-end;
  }
  
  .notification {
    right: 1rem;
    left: 1rem;
    min-width: auto;
  }
}
