:root {
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --border-radius: 16px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

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

html, body {
  height: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-family);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

#root {
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* App Layout */
.app {
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  transition: background-color var(--transition-normal);
}

/* Light Theme */
.app.light {
  background-color: #ffffff;
  color: #000000;
}

/* Dark Theme */
.app.dark {
  background-color: #000000;
  color: #ffffff;
}

/* Ocean Theme - Calming Blues */
.app.ocean {
  background: linear-gradient(135deg, #f8fafc 0%, #e0f2fe 100%);
  color: #0c4a6e;
}

/* Forest Theme - Natural Greens */
.app.forest {
  background: linear-gradient(135deg, #fefefe 0%, #f0fdf4 100%);
  color: #14532d;
}

/* Sunset Theme - Warm Oranges */
.app.sunset {
  background: linear-gradient(135deg, #fff7ed 0%, #fed7aa 100%);
  color: #9a3412;
}

/* Lavender Theme - Gentle Purples */
.app.lavender {
  background: linear-gradient(135deg, #faf5ff 0%, #e9d5ff 100%);
  color: #581c87;
}

/* Earth Theme - Warm Browns */
.app.earth {
  background: linear-gradient(135deg, #fefdfb 0%, #fde68a 100%);
  color: #92400e;
}

/* Pistachio Theme - Soft Green */
.app.pistachio {
  background: linear-gradient(135deg, #f7f8f7 0%, #d9f2d9 100%);
  color: #2d5016;
}

/* Blush Theme - Soft Pink */
.app.blush {
  background: linear-gradient(135deg, #fef7f7 0%, #fce7e7 100%);
  color: #be185d;
}

/* Mint Theme - Fresh Mint Green */
.app.mint {
  background: linear-gradient(135deg, #f0fdfa 0%, #ccfbf1 100%);
  color: #134e4a;
}

/* Peach Theme - Warm Peach */
.app.peach {
  background: linear-gradient(135deg, #fff8f5 0%, #fed7c3 100%);
  color: #c2410c;
}

/* Sky Theme - Light Blue */
.app.sky {
  background: linear-gradient(135deg, #f0f9ff 0%, #bae6fd 100%);
  color: #0c4a6e;
}

.app-container {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.view-container {
  flex: 1;
  overflow: hidden;
}

.view-container.transitioning {
  opacity: 0.5;
  transition: opacity var(--transition-fast);
}

/* Card Browser */
.card-browser {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.browser-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid;
  flex-shrink: 0;
}

.light .browser-header {
  border-bottom-color: rgba(0, 0, 0, 0.1);
}

.dark .browser-header {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.ocean .browser-header {
  border-bottom-color: rgba(12, 74, 110, 0.2);
}

.forest .browser-header {
  border-bottom-color: rgba(20, 83, 45, 0.2);
}

.sunset .browser-header {
  border-bottom-color: rgba(154, 52, 18, 0.2);
}

.lavender .browser-header {
  border-bottom-color: rgba(88, 28, 135, 0.2);
}

.earth .browser-header {
  border-bottom-color: rgba(146, 64, 14, 0.2);
}

.pistachio .browser-header {
  border-bottom-color: rgba(45, 80, 22, 0.2);
}

.blush .browser-header {
  border-bottom-color: rgba(190, 24, 93, 0.2);
}

.mint .browser-header {
  border-bottom-color: rgba(19, 78, 74, 0.2);
}

.peach .browser-header {
  border-bottom-color: rgba(194, 65, 12, 0.2);
}

.sky .browser-header {
  border-bottom-color: rgba(12, 74, 110, 0.2);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-left .theme-toggle {
  position: static;
  width: 40px;
  height: 40px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.language-selector-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.show-as-label {
  font-size: 14px;
  font-weight: 600;
  opacity: 0.8;
  white-space: nowrap;
}

.browser-header h1 {
  font-size: 24px;
  font-weight: 700;
}

.theme-toggle {
  position: absolute;
  top: 20px;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  z-index: 10;
}

.light .theme-toggle {
  background: rgba(0, 0, 0, 0.1);
  color: #000000;
}

.dark .theme-toggle {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.ocean .theme-toggle {
  background: rgba(12, 74, 110, 0.1);
  color: #0c4a6e;
}

.forest .theme-toggle {
  background: rgba(20, 83, 45, 0.1);
  color: #14532d;
}

.sunset .theme-toggle {
  background: rgba(154, 52, 18, 0.1);
  color: #9a3412;
}

.lavender .theme-toggle {
  background: rgba(88, 28, 135, 0.1);
  color: #581c87;
}

.earth .theme-toggle {
  background: rgba(146, 64, 14, 0.1);
  color: #92400e;
}

.pistachio .theme-toggle {
  background: rgba(45, 80, 22, 0.1);
  color: #2d5016;
}

.blush .theme-toggle {
  background: rgba(190, 24, 93, 0.1);
  color: #be185d;
}

.mint .theme-toggle {
  background: rgba(19, 78, 74, 0.1);
  color: #134e4a;
}

.peach .theme-toggle {
  background: rgba(194, 65, 12, 0.1);
  color: #c2410c;
}

.sky .theme-toggle {
  background: rgba(12, 74, 110, 0.1);
  color: #0c4a6e;
}

.theme-toggle:not(.left) {
  right: 20px;
}

.theme-toggle.left {
  left: 20px;
}

.theme-toggle:hover {
  transform: scale(1.05);
}

.light .theme-toggle:hover {
  background: rgba(0, 0, 0, 0.2);
}

.dark .theme-toggle:hover {
  background: rgba(255, 255, 255, 0.2);
}

.ocean .theme-toggle:hover {
  background: rgba(12, 74, 110, 0.2);
}

.forest .theme-toggle:hover {
  background: rgba(20, 83, 45, 0.2);
}

.sunset .theme-toggle:hover {
  background: rgba(154, 52, 18, 0.2);
}

.lavender .theme-toggle:hover {
  background: rgba(88, 28, 135, 0.2);
}

.earth .theme-toggle:hover {
  background: rgba(146, 64, 14, 0.2);
}

.pistachio .theme-toggle:hover {
  background: rgba(45, 80, 22, 0.2);
}

.blush .theme-toggle:hover {
  background: rgba(190, 24, 93, 0.2);
}

.mint .theme-toggle:hover {
  background: rgba(19, 78, 74, 0.2);
}

.peach .theme-toggle:hover {
  background: rgba(194, 65, 12, 0.2);
}

.sky .theme-toggle:hover {
  background: rgba(12, 74, 110, 0.2);
}

.add-button {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: #007AFF;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.add-button:hover:not(:disabled) {
  background: #0056CC;
  transform: scale(1.05);
}

.add-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Masonry Grid */
.cards-grid {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.light .cards-grid {
  scrollbar-color: rgba(0, 0, 0, 0.3) transparent;
}

.dark .cards-grid {
  scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.ocean .cards-grid {
  scrollbar-color: rgba(12, 74, 110, 0.3) transparent;
}

.forest .cards-grid {
  scrollbar-color: rgba(20, 83, 45, 0.3) transparent;
}

.sunset .cards-grid {
  scrollbar-color: rgba(154, 52, 18, 0.3) transparent;
}

.lavender .cards-grid {
  scrollbar-color: rgba(88, 28, 135, 0.3) transparent;
}

.earth .cards-grid {
  scrollbar-color: rgba(146, 64, 14, 0.3) transparent;
}

.pistachio .cards-grid {
  scrollbar-color: rgba(45, 80, 22, 0.3) transparent;
}

.blush .cards-grid {
  scrollbar-color: rgba(190, 24, 93, 0.3) transparent;
}

.mint .cards-grid {
  scrollbar-color: rgba(19, 78, 74, 0.3) transparent;
}

.peach .cards-grid {
  scrollbar-color: rgba(194, 65, 12, 0.3) transparent;
}

.sky .cards-grid {
  scrollbar-color: rgba(12, 74, 110, 0.3) transparent;
}

.cards-grid::-webkit-scrollbar {
  width: 6px;
}

.cards-grid::-webkit-scrollbar-track {
  background: transparent;
}

.light .cards-grid::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 3px;
}

.dark .cards-grid::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

.ocean .cards-grid::-webkit-scrollbar-thumb {
  background: rgba(12, 74, 110, 0.3);
  border-radius: 3px;
}

.forest .cards-grid::-webkit-scrollbar-thumb {
  background: rgba(20, 83, 45, 0.3);
  border-radius: 3px;
}

.sunset .cards-grid::-webkit-scrollbar-thumb {
  background: rgba(154, 52, 18, 0.3);
  border-radius: 3px;
}

.lavender .cards-grid::-webkit-scrollbar-thumb {
  background: rgba(88, 28, 135, 0.3);
  border-radius: 3px;
}

.earth .cards-grid::-webkit-scrollbar-thumb {
  background: rgba(146, 64, 14, 0.3);
  border-radius: 3px;
}

.pistachio .cards-grid::-webkit-scrollbar-thumb {
  background: rgba(45, 80, 22, 0.3);
  border-radius: 3px;
}

.blush .cards-grid::-webkit-scrollbar-thumb {
  background: rgba(190, 24, 93, 0.3);
  border-radius: 3px;
}

.mint .cards-grid::-webkit-scrollbar-thumb {
  background: rgba(19, 78, 74, 0.3);
  border-radius: 3px;
}

.peach .cards-grid::-webkit-scrollbar-thumb {
  background: rgba(194, 65, 12, 0.3);
  border-radius: 3px;
}

.sky .cards-grid::-webkit-scrollbar-thumb {
  background: rgba(12, 74, 110, 0.3);
  border-radius: 3px;
}

.light .cards-grid::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.5);
}

.dark .cards-grid::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

.ocean .cards-grid::-webkit-scrollbar-thumb:hover {
  background: rgba(12, 74, 110, 0.5);
}

.forest .cards-grid::-webkit-scrollbar-thumb:hover {
  background: rgba(20, 83, 45, 0.5);
}

.sunset .cards-grid::-webkit-scrollbar-thumb:hover {
  background: rgba(154, 52, 18, 0.5);
}

.lavender .cards-grid::-webkit-scrollbar-thumb:hover {
  background: rgba(88, 28, 135, 0.5);
}

.earth .cards-grid::-webkit-scrollbar-thumb:hover {
  background: rgba(146, 64, 14, 0.5);
}

.pistachio .cards-grid::-webkit-scrollbar-thumb:hover {
  background: rgba(45, 80, 22, 0.5);
}

.blush .cards-grid::-webkit-scrollbar-thumb:hover {
  background: rgba(190, 24, 93, 0.5);
}

.mint .cards-grid::-webkit-scrollbar-thumb:hover {
  background: rgba(19, 78, 74, 0.5);
}

.peach .cards-grid::-webkit-scrollbar-thumb:hover {
  background: rgba(194, 65, 12, 0.5);
}

.sky .cards-grid::-webkit-scrollbar-thumb:hover {
  background: rgba(12, 74, 110, 0.5);
}

/* Masonry Layout */
.masonry-container {
  column-gap: 16px;
  column-fill: balance;
}

/* Mobile: Single column */
@media (max-width: 768px) {
  .masonry-container {
    column-count: 1;
  }
}

/* Desktop/Tablet: 4 columns */
@media (min-width: 769px) {
  .masonry-container {
    column-count: 4;
  }
}

/* Card Lozenges */
.card-lozenge {
  display: inline-block;
  width: 100%;
  margin-bottom: 16px;
  break-inside: avoid;
  border-radius: var(--border-radius);
  padding: 16px 20px;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  border: 2px solid;
  user-select: none;
}

.light .card-lozenge {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.2);
  color: #000000;
}

.dark .card-lozenge {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.ocean .card-lozenge {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(12, 74, 110, 0.3);
  color: #0c4a6e;
}

.forest .card-lozenge {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(20, 83, 45, 0.3);
  color: #14532d;
}

.sunset .card-lozenge {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(154, 52, 18, 0.3);
  color: #9a3412;
}

.lavender .card-lozenge {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(88, 28, 135, 0.3);
  color: #581c87;
}

.earth .card-lozenge {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(146, 64, 14, 0.3);
  color: #92400e;
}

.pistachio .card-lozenge {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(45, 80, 22, 0.3);
  color: #2d5016;
}

.blush .card-lozenge {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(190, 24, 93, 0.3);
  color: #be185d;
}

.mint .card-lozenge {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(19, 78, 74, 0.3);
  color: #134e4a;
}

.peach .card-lozenge {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(194, 65, 12, 0.3);
  color: #c2410c;
}

.sky .card-lozenge {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(12, 74, 110, 0.3);
  color: #0c4a6e;
}

.card-lozenge:hover {
  transform: translateY(-2px);
  border-color: #007AFF;
  box-shadow: 0 8px 25px rgba(0, 122, 255, 0.2);
}

.card-lozenge.selected {
  border-color: #007AFF;
  background: rgba(0, 122, 255, 0.1);
  box-shadow: 0 4px 15px rgba(0, 122, 255, 0.3);
}

.card-lozenge.dragging {
  opacity: 0.5;
  transform: scale(1.02);
  z-index: 1000;
}

.card-lozenge.drag-over {
  border-color: #007AFF;
  transform: translateY(-2px);
}

.drag-handle {
  position: absolute;
  top: 8px;
  left: 8px;
  cursor: grab;
  padding: 4px;
  opacity: 0.3;
}

.drag-handle:active {
  cursor: grabbing;
}

.card-lozenge-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-lozenge-text {
  flex: 1;
  font-weight: 600;
  font-size: 16px;
  line-height: 1.4;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: none;
  white-space: pre-wrap;
}

.card-lozenge-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.lozenge-action-button {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.light .lozenge-action-button {
  background: rgba(0, 0, 0, 0.1);
  color: #000000;
}

.dark .lozenge-action-button {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.ocean .lozenge-action-button {
  background: rgba(12, 74, 110, 0.1);
  color: #0c4a6e;
}

.forest .lozenge-action-button {
  background: rgba(20, 83, 45, 0.1);
  color: #14532d;
}

.sunset .lozenge-action-button {
  background: rgba(154, 52, 18, 0.1);
  color: #9a3412;
}

.lavender .lozenge-action-button {
  background: rgba(88, 28, 135, 0.1);
  color: #581c87;
}

.earth .lozenge-action-button {
  background: rgba(146, 64, 14, 0.1);
  color: #92400e;
}

.pistachio .lozenge-action-button {
  background: rgba(45, 80, 22, 0.1);
  color: #2d5016;
}

.blush .lozenge-action-button {
  background: rgba(190, 24, 93, 0.1);
  color: #be185d;
}

.mint .lozenge-action-button {
  background: rgba(19, 78, 74, 0.1);
  color: #134e4a;
}

.peach .lozenge-action-button {
  background: rgba(194, 65, 12, 0.1);
  color: #c2410c;
}

.sky .lozenge-action-button {
  background: rgba(12, 74, 110, 0.1);
  color: #0c4a6e;
}

.lozenge-action-button:hover:not(:disabled) {
  transform: scale(1.1);
}

.light .lozenge-action-button:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.2);
}

.dark .lozenge-action-button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.2);
}

.ocean .lozenge-action-button:hover:not(:disabled) {
  background: rgba(12, 74, 110, 0.2);
}

.forest .lozenge-action-button:hover:not(:disabled) {
  background: rgba(20, 83, 45, 0.2);
}

.sunset .lozenge-action-button:hover:not(:disabled) {
  background: rgba(154, 52, 18, 0.2);
}

.lavender .lozenge-action-button:hover:not(:disabled) {
  background: rgba(88, 28, 135, 0.2);
}

.earth .lozenge-action-button:hover:not(:disabled) {
  background: rgba(146, 64, 14, 0.2);
}

.pistachio .lozenge-action-button:hover:not(:disabled) {
  background: rgba(45, 80, 22, 0.2);
}

.blush .lozenge-action-button:hover:not(:disabled) {
  background: rgba(190, 24, 93, 0.2);
}

.mint .lozenge-action-button:hover:not(:disabled) {
  background: rgba(19, 78, 74, 0.2);
}

.peach .lozenge-action-button:hover:not(:disabled) {
  background: rgba(194, 65, 12, 0.2);
}

.sky .lozenge-action-button:hover:not(:disabled) {
  background: rgba(12, 74, 110, 0.2);
}

.lozenge-action-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.delete-button {
  background: rgba(255, 68, 68, 0.2) !important;
}

.delete-button:hover:not(:disabled) {
  background: rgba(255, 68, 68, 0.3) !important;
}

/* Empty State */
.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
}

.empty-state h2 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 16px;
  opacity: 0.9;
}

.empty-state p {
  font-size: 18px;
  opacity: 0.7;
  margin-bottom: 8px;
  line-height: 1.5;
}

.empty-state .add-instruction {
  font-size: 16px;
  opacity: 0.6;
  font-style: italic;
}

/* Translation Status */
.translation-status {
  font-size: 14px;
  color: #007AFF;
  margin-top: 8px;
  font-style: italic;
}

.translation-indicator {
  position: fixed;
  bottom: 20px;
  left: 20px;
  background: rgba(0, 122, 255, 0.9);
  color: white;
  padding: 8px 16px;
  border-radius: var(--border-radius);
  font-size: 14px;
  font-weight: 600;
  backdrop-filter: blur(10px);
  z-index: 50;
}

/* Spinning animation for loading */
.spinning {
  animation: spin 1s linear infinite;
}

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

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

.language-button-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all var(--transition-fast);
  backdrop-filter: blur(10px);
  border: 2px solid;
  min-width: 50px;
  justify-content: center;
}

.light .language-button-inline {
  background: rgba(0, 0, 0, 0.1);
  border-color: rgba(0, 0, 0, 0.2);
  color: #000000;
}

.dark .language-button-inline {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.ocean .language-button-inline {
  background: rgba(12, 74, 110, 0.1);
  border-color: rgba(12, 74, 110, 0.2);
  color: #0c4a6e;
}

.forest .language-button-inline {
  background: rgba(20, 83, 45, 0.1);
  border-color: rgba(20, 83, 45, 0.2);
  color: #14532d;
}

.sunset .language-button-inline {
  background: rgba(154, 52, 18, 0.1);
  border-color: rgba(154, 52, 18, 0.2);
  color: #9a3412;
}

.lavender .language-button-inline {
  background: rgba(88, 28, 135, 0.1);
  border-color: rgba(88, 28, 135, 0.2);
  color: #581c87;
}

.earth .language-button-inline {
  background: rgba(146, 64, 14, 0.1);
  border-color: rgba(146, 64, 14, 0.2);
  color: #92400e;
}

.pistachio .language-button-inline {
  background: rgba(45, 80, 22, 0.1);
  border-color: rgba(45, 80, 22, 0.2);
  color: #2d5016;
}

.blush .language-button-inline {
  background: rgba(190, 24, 93, 0.1);
  border-color: rgba(190, 24, 93, 0.2);
  color: #be185d;
}

.mint .language-button-inline {
  background: rgba(19, 78, 74, 0.1);
  border-color: rgba(19, 78, 74, 0.2);
  color: #134e4a;
}

.peach .language-button-inline {
  background: rgba(194, 65, 12, 0.1);
  border-color: rgba(194, 65, 12, 0.2);
  color: #c2410c;
}

.sky .language-button-inline {
  background: rgba(12, 74, 110, 0.1);
  border-color: rgba(12, 74, 110, 0.2);
  color: #0c4a6e;
}

.language-button-inline:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: #007AFF;
  box-shadow: 0 4px 12px rgba(0, 122, 255, 0.2);
}

.light .language-button-inline:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.2);
}

.dark .language-button-inline:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.2);
}

.ocean .language-button-inline:hover:not(:disabled) {
  background: rgba(12, 74, 110, 0.2);
}

.forest .language-button-inline:hover:not(:disabled) {
  background: rgba(20, 83, 45, 0.2);
}

.sunset .language-button-inline:hover:not(:disabled) {
  background: rgba(154, 52, 18, 0.2);
}

.lavender .language-button-inline:hover:not(:disabled) {
  background: rgba(88, 28, 135, 0.2);
}

.earth .language-button-inline:hover:not(:disabled) {
  background: rgba(146, 64, 14, 0.2);
}

.pistachio .language-button-inline:hover:not(:disabled) {
  background: rgba(45, 80, 22, 0.2);
}

.blush .language-button-inline:hover:not(:disabled) {
  background: rgba(190, 24, 93, 0.2);
}

.mint .language-button-inline:hover:not(:disabled) {
  background: rgba(19, 78, 74, 0.2);
}

.peach .language-button-inline:hover:not(:disabled) {
  background: rgba(194, 65, 12, 0.2);
}

.sky .language-button-inline:hover:not(:disabled) {
  background: rgba(12, 74, 110, 0.2);
}

.language-button-inline:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.language-button-inline.changing {
  background: rgba(0, 122, 255, 0.2);
  border-color: #007AFF;
}

.language-loading {
  display: flex;
  align-items: center;
  justify-content: center;
}

.language-flag {
  font-size: 16px;
}

.chevron {
  transition: transform var(--transition-fast);
  opacity: 0.7;
}

.chevron.open {
  transform: rotate(180deg);
}

.language-dropdown-inline {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  border: 2px solid;
  border-radius: var(--border-radius);
  backdrop-filter: blur(20px);
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  animation: slideDown 0.2s ease-out;
  z-index: 1000;
}

.light .language-dropdown-inline {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(0, 0, 0, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.dark .language-dropdown-inline {
  background: rgba(0, 0, 0, 0.95);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.ocean .language-dropdown-inline {
  background: rgba(248, 250, 252, 0.95);
  border-color: rgba(12, 74, 110, 0.2);
  box-shadow: 0 8px 32px rgba(12, 74, 110, 0.1);
}

.forest .language-dropdown-inline {
  background: rgba(254, 254, 254, 0.95);
  border-color: rgba(20, 83, 45, 0.2);
  box-shadow: 0 8px 32px rgba(20, 83, 45, 0.1);
}

.sunset .language-dropdown-inline {
  background: rgba(255, 247, 237, 0.95);
  border-color: rgba(154, 52, 18, 0.2);
  box-shadow: 0 8px 32px rgba(154, 52, 18, 0.1);
}

.lavender .language-dropdown-inline {
  background: rgba(250, 245, 255, 0.95);
  border-color: rgba(88, 28, 135, 0.2);
  box-shadow: 0 8px 32px rgba(88, 28, 135, 0.1);
}

.earth .language-dropdown-inline {
  background: rgba(254, 253, 251, 0.95);
  border-color: rgba(146, 64, 14, 0.2);
  box-shadow: 0 8px 32px rgba(146, 64, 14, 0.1);
}

.pistachio .language-dropdown-inline {
  background: rgba(247, 248, 247, 0.95);
  border-color: rgba(45, 80, 22, 0.2);
  box-shadow: 0 8px 32px rgba(45, 80, 22, 0.1);
}

.blush .language-dropdown-inline {
  background: rgba(254, 247, 247, 0.95);
  border-color: rgba(190, 24, 93, 0.2);
  box-shadow: 0 8px 32px rgba(190, 24, 93, 0.1);
}

.mint .language-dropdown-inline {
  background: rgba(240, 253, 250, 0.95);
  border-color: rgba(19, 78, 74, 0.2);
  box-shadow: 0 8px 32px rgba(19, 78, 74, 0.1);
}

.peach .language-dropdown-inline {
  background: rgba(255, 248, 245, 0.95);
  border-color: rgba(194, 65, 12, 0.2);
  box-shadow: 0 8px 32px rgba(194, 65, 12, 0.1);
}

.sky .language-dropdown-inline {
  background: rgba(240, 249, 255, 0.95);
  border-color: rgba(12, 74, 110, 0.2);
  box-shadow: 0 8px 32px rgba(12, 74, 110, 0.1);
}

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

.language-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  border: none;
  background: transparent;
  color: currentColor;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background-color var(--transition-fast);
  text-align: left;
}

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

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

.ocean .language-option:hover {
  background: rgba(12, 74, 110, 0.1);
}

.forest .language-option:hover {
  background: rgba(20, 83, 45, 0.1);
}

.sunset .language-option:hover {
  background: rgba(154, 52, 18, 0.1);
}

.lavender .language-option:hover {
  background: rgba(88, 28, 135, 0.1);
}

.earth .language-option:hover {
  background: rgba(146, 64, 14, 0.1);
}

.pistachio .language-option:hover {
  background: rgba(45, 80, 22, 0.1);
}

.blush .language-option:hover {
  background: rgba(190, 24, 93, 0.1);
}

.mint .language-option:hover {
  background: rgba(19, 78, 74, 0.1);
}

.peach .language-option:hover {
  background: rgba(194, 65, 12, 0.1);
}

.sky .language-option:hover {
  background: rgba(12, 74, 110, 0.1);
}

.language-option.active {
  background: rgba(0, 122, 255, 0.2);
  font-weight: 600;
}

.language-option.active:hover {
  background: rgba(0, 122, 255, 0.3);
}

.language-name {
  flex: 1;
  text-align: left;
}

/* Display View */
.display-view {
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  touch-action: pan-y;
  overflow: hidden;
  cursor: pointer;
}

.card-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 80px 20px 20px 20px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.card-text-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.card-text {
  font-weight: 700;
  text-align: center;
  line-height: 1.1;
  letter-spacing: 1px;
  transition: opacity 0.3s ease;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
  hyphens: none;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 0;
  left: 0;
  white-space: pre-wrap;
  padding: 10px;
  box-sizing: border-box;
}

.card-text.maximized {
  font-size: clamp(1rem, min(8vw, 12vh), 12rem);
}

.card-text.hide {
  opacity: 0;
}

.card-text.show {
  opacity: 1;
}

/* Slide transition effects */
.card-text.slide-left-out {
  transform: translateX(-100%);
  opacity: 0;
}

.card-text.slide-right-out {
  transform: translateX(100%);
  opacity: 0;
}

.card-text.slide-center {
  transform: translateX(0);
  opacity: 1;
}

/* Enhanced responsive text sizing for display view - Mobile Portrait Focus */
@media (max-width: 480px) and (orientation: portrait) {
  .card-text.maximized {
    font-size: clamp(0.6rem, min(10vw, 6vh), 4rem);
    line-height: 1.0;
    letter-spacing: 0.5px;
    word-break: break-word;
    overflow-wrap: anywhere;
  }
  
  .card-container {
    padding: 60px 10px 15px 10px;
  }
}

/* iPhone 16 and similar narrow screens */
@media (max-width: 430px) and (orientation: portrait) {
  .card-text.maximized {
    font-size: clamp(0.5rem, min(9vw, 5vh), 3.5rem);
    line-height: 0.95;
    letter-spacing: 0px;
  }
  
  .card-container {
    padding: 50px 8px 10px 8px;
  }
}

/* Very narrow screens (iPhone SE, etc.) */
@media (max-width: 375px) and (orientation: portrait) {
  .card-text.maximized {
    font-size: clamp(0.4rem, min(8vw, 4vh), 3rem);
    line-height: 0.9;
  }
  
  .card-container {
    padding: 50px 6px 10px 6px;
  }
}

/* Standard mobile landscape */
@media (max-width: 768px) and (orientation: landscape) {
  .card-text.maximized {
    font-size: clamp(0.7rem, min(6vw, 12vh), 5rem);
    line-height: 1.0;
  }
  
  .card-container {
    padding: 40px 15px 15px 15px;
  }
}

/* Tablet portrait */
@media (min-width: 481px) and (max-width: 768px) and (orientation: portrait) {
  .card-text.maximized {
    font-size: clamp(1rem, min(8vw, 8vh), 6rem);
    line-height: 1.05;
  }
  
  .card-container {
    padding: 70px 20px 20px 20px;
  }
}

/* Tablet landscape */
@media (min-width: 769px) and (max-width: 1024px) {
  .card-text.maximized {
    font-size: clamp(1.2rem, min(6vw, 10vh), 8rem);
  }
}

/* Desktop */
@media (min-width: 1025px) {
  .card-text.maximized {
    font-size: clamp(1.5rem, min(5vw, 8vh), 10rem);
  }
}

/* Very tall screens */
@media (min-height: 800px) and (orientation: portrait) {
  .card-text.maximized {
    font-size: clamp(1.2rem, min(7vw, 6vh), 12rem);
  }
}

/* Short landscape screens */
@media (orientation: landscape) and (max-height: 500px) {
  .card-text.maximized {
    font-size: clamp(0.6rem, min(4vw, 15vh), 4rem);
    line-height: 0.9;
  }
  
  .card-container {
    padding: 30px 10px 10px 10px;
  }
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}

.modal-content {
  border-radius: var(--border-radius);
  padding: 24px;
  width: 100%;
  max-width: 400px;
  max-height: 80vh;
  overflow-y: auto;
}

.light .modal-content {
  background: #ffffff;
  color: #000000;
}

.dark .modal-content {
  background: #1a1a1a;
  color: #ffffff;
}

.ocean .modal-content {
  background: #f8fafc;
  color: #0c4a6e;
}

.forest .modal-content {
  background: #fefefe;
  color: #14532d;
}

.sunset .modal-content {
  background: #fff7ed;
  color: #9a3412;
}

.lavender .modal-content {
  background: #faf5ff;
  color: #581c87;
}

.earth .modal-content {
  background: #fefdfb;
  color: #92400e;
}

.pistachio .modal-content {
  background: #f7f8f7;
  color: #2d5016;
}

.blush .modal-content {
  background: #fef7f7;
  color: #be185d;
}

.mint .modal-content {
  background: #f0fdfa;
  color: #134e4a;
}

.peach .modal-content {
  background: #fff8f5;
  color: #c2410c;
}

.sky .modal-content {
  background: #f0f9ff;
  color: #0c4a6e;
}

.modal-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 20px;
}

.modal-body {
  margin-bottom: 20px;
}

.modal-body textarea {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 8px;
  color: currentColor;
  font-family: inherit;
  font-size: 16px;
  resize: vertical;
  min-height: 80px;
}

.light .modal-body textarea {
  background: rgba(0, 0, 0, 0.1);
}

.dark .modal-body textarea {
  background: rgba(255, 255, 255, 0.1);
}

.ocean .modal-body textarea {
  background: rgba(12, 74, 110, 0.1);
}

.forest .modal-body textarea {
  background: rgba(20, 83, 45, 0.1);
}

.sunset .modal-body textarea {
  background: rgba(154, 52, 18, 0.1);
}

.lavender .modal-body textarea {
  background: rgba(88, 28, 135, 0.1);
}

.earth .modal-body textarea {
  background: rgba(146, 64, 14, 0.1);
}

.pistachio .modal-body textarea {
  background: rgba(45, 80, 22, 0.1);
}

.blush .modal-body textarea {
  background: rgba(190, 24, 93, 0.1);
}

.mint .modal-body textarea {
  background: rgba(19, 78, 74, 0.1);
}

.peach .modal-body textarea {
  background: rgba(194, 65, 12, 0.1);
}

.sky .modal-body textarea {
  background: rgba(12, 74, 110, 0.1);
}

.modal-body textarea:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.modal-body textarea:focus {
  outline: 2px solid #007AFF;
  outline-offset: 2px;
}

.light .modal-body textarea::placeholder {
  color: rgba(0, 0, 0, 0.5);
}

.dark .modal-body textarea::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.ocean .modal-body textarea::placeholder {
  color: rgba(12, 74, 110, 0.5);
}

.forest .modal-body textarea::placeholder {
  color: rgba(20, 83, 45, 0.5);
}

.sunset .modal-body textarea::placeholder {
  color: rgba(154, 52, 18, 0.5);
}

.lavender .modal-body textarea::placeholder {
  color: rgba(88, 28, 135, 0.5);
}

.earth .modal-body textarea::placeholder {
  color: rgba(146, 64, 14, 0.5);
}

.pistachio .modal-body textarea::placeholder {
  color: rgba(45, 80, 22, 0.5);
}

.blush .modal-body textarea::placeholder {
  color: rgba(190, 24, 93, 0.5);
}

.mint .modal-body textarea::placeholder {
  color: rgba(19, 78, 74, 0.5);
}

.peach .modal-body textarea::placeholder {
  color: rgba(194, 65, 12, 0.5);
}

.sky .modal-body textarea::placeholder {
  color: rgba(12, 74, 110, 0.5);
}

.modal-actions {
  display: flex;
  gap: 12px;
}

.modal-button {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.cancel-button {
  background: #666666;
  color: white;
}

.cancel-button:hover {
  background: #555555;
}

.save-button {
  background: #007AFF;
  color: white;
}

.save-button:hover {
  background: #0056CC;
}

.modal-reset-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid;
}

.light .modal-reset-section {
  border-top-color: rgba(0, 0, 0, 0.1);
}

.dark .modal-reset-section {
  border-top-color: rgba(255, 255, 255, 0.1);
}

.ocean .modal-reset-section {
  border-top-color: rgba(12, 74, 110, 0.1);
}

.forest .modal-reset-section {
  border-top-color: rgba(20, 83, 45, 0.1);
}

.sunset .modal-reset-section {
  border-top-color: rgba(154, 52, 18, 0.1);
}

.lavender .modal-reset-section {
  border-top-color: rgba(88, 28, 135, 0.1);
}

.earth .modal-reset-section {
  border-top-color: rgba(146, 64, 14, 0.1);
}

.pistachio .modal-reset-section {
  border-top-color: rgba(45, 80, 22, 0.1);
}

.blush .modal-reset-section {
  border-top-color: rgba(190, 24, 93, 0.1);
}

.mint .modal-reset-section {
  border-top-color: rgba(19, 78, 74, 0.1);
}

.peach .modal-reset-section {
  border-top-color: rgba(194, 65, 12, 0.1);
}

.sky .modal-reset-section {
  border-top-color: rgba(12, 74, 110, 0.1);
}

.reset-button {
  background: #ff4444;
  color: white;
  width: 100%;
}

.reset-button:hover {
  background: #cc3333;
}

/* Mobile responsive adjustments */
@media (max-width: 640px) {
  .cards-grid {
    padding: 16px;
  }
  
  .card-lozenge {
    margin-bottom: 12px;
    padding: 14px 18px;
  }
  
  .card-lozenge-text {
    font-size: 15px;
  }
  
  .empty-state {
    padding: 40px 16px;
  }
  
  .browser-header {
    padding: 16px;
  }
  
  .header-right {
    gap: 12px;
  }
  
  .show-as-label {
    font-size: 12px;
  }
  
  .language-button-inline {
    padding: 6px 10px;
    font-size: 11px;
    min-width: 45px;
  }
}

@media (max-width: 480px) {
  .browser-header {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }
  
  .header-left {
    justify-content: center;
  }
  
  .header-right {
    justify-content: center;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .card-text.show {
    animation: none;
  }
  
  .card-text {
    transition: opacity 0.01ms !important;
  }
}

button:focus-visible,
textarea:focus-visible {
  outline: 2px solid #007AFF;
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .theme-toggle,
  .card-lozenge {
    border: 2px solid currentColor;
  }
}

/* PWA specific styles */
@media (display-mode: standalone) {
  body {
    -webkit-user-select: none;
    user-select: none;
  }
  
  .modal-body textarea {
    -webkit-user-select: text;
    user-select: text;
  }
}
