/* home.css */
:root {
  --primary: #282a36;
  --secondary: #44475a;
  --success: #50fa7b;
  --danger: #ff5555;
  --warning: #f1fa8c;
  --info: #8be9fd;
  --light: #f8f8f2;
  --dark: #1e1f29;
}

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

body {
  background: linear-gradient(135deg, var(--primary) 0%, var(--dark) 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  padding: 20px;
}

#container {
  background: var(--secondary);
  border-radius: 16px;
  padding: 40px 30px;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

h1 {
  text-align: center;
  color: var(--info);
  margin-bottom: 30px;
  font-size: 2.5rem;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.emoji-section {
  text-align: center;
  margin-bottom: 30px;
}

.emoji-toggle-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: var(--success);
  border: none;
  padding: 12px 24px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 2rem;
  transition: all 0.3s ease;
  font-weight: 600;
  color: var(--dark);
  width: 100%;
}

.emoji-toggle-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(80, 250, 123, 0.3);
}

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

.emoji-toggle-btn .label {
  font-size: 0.8rem;
  letter-spacing: 0.5px;
}

.emoji-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.emoji-modal.hidden {
  display: none;
}

.emoji-modal-content {
  background: var(--secondary);
  border-radius: 16px;
  max-width: 500px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.emoji-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 2px solid var(--primary);
}

.emoji-modal-header h2 {
  color: var(--info);
  font-size: 1.3rem;
}

.close-btn {
  background: var(--danger);
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 8px rgba(255, 85, 85, 0.3);
}

/* Emoji Grid - 4 Emojis per row no matter the size */
.emoji-picker {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 20px;
}

.emoji-option {
  background: var(--primary);
  border: 2px solid transparent;
  border-radius: 8px;
  font-size: 2rem;
  padding: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60px;
}

.emoji-option:hover {
  border-color: var(--success);
  transform: scale(1.1);
}

.emoji-option:active {
  transform: scale(0.95);
}

/* Sections - Flex container to keep module + button together */
.section {
  margin-bottom: 25px;
  display: flex;
  flex-direction: column;
}

.btn {
  width: 100%;
  padding: 14px 20px;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-primary {
  background: var(--success);
  color: var(--dark);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(80, 250, 123, 0.3);
}

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

.room-module {
  margin: 0;
  animation: slideDown 0.3s ease;
}

.room-module.hidden {
  display: none;
}

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

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Code Display - Both Create & Join */
.code-display {
  background: var(--primary);
  border-left: 4px solid var(--success);
  border-radius: 8px 8px 0 0;
  padding: 16px;
  margin-bottom: 0;
  overflow: hidden;
}

.code-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.code-container .label {
  color: var(--info);
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
}

.room-code,
.room-code-input {
  background: var(--secondary);
  color: var(--success);
  font-size: 1.3rem;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 6px;
  letter-spacing: 2px;
  flex: 1;
  text-align: center;
  border: none;
  text-transform: uppercase;
  transition: all 0.3s ease;
  min-width: 0;
}

.room-code {
  display: block;
}

.room-code-input {
  font-family: inherit;
}

.room-code-input:focus {
  outline: none;
  box-shadow: 0 0 12px rgba(80, 250, 123, 0.3);
}

.room-code-input::placeholder {
  color: var(--primary);
  opacity: 0.5;
}

.copy-btn,
.paste-btn {
  background: var(--info);
  border: none;
  color: var(--dark);
  width: 40px;
  height: 40px;
  border-radius: 8px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 8px;
}

.copy-btn svg,
.paste-btn svg {
  width: 20px;
  height: 20px;
  pointer-events: none;
}

.copy-btn:hover,
.paste-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 8px rgba(139, 233, 253, 0.3);
}

.copy-btn:active,
.paste-btn:active {
  transform: scale(0.95);
}

/* Status Messages */
.status-text {
  color: var(--warning);
  font-size: 0.85rem;
  text-align: center;
  font-weight: 500;
  min-height: 1.2em;
  background: var(--primary);
  padding: 8px 16px;
  border-left: 4px solid var(--success);
  border-radius: 0 0 8px 8px;
  margin-bottom: 0;
  white-space: pre-line;
}

#env-nav {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(68, 71, 90, 0.3);
}

.env-btn {
  background: rgba(68, 71, 90, 0.4);
  color: rgba(248, 248, 242, 0.6);
  text-decoration: none;
  padding: 0.35rem 0.65rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 400;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  letter-spacing: 0.3px;
}

.env-btn:hover {
  background: rgba(68, 71, 90, 0.6);
  color: var(--light);
  transform: translateY(-1px);
}

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

.env-main:hover {
  border-color: rgba(80, 250, 123, 0.3);
}

.env-beta:hover {
  border-color: rgba(241, 250, 140, 0.3);
}

.env-alpha:hover {
  border-color: rgba(139, 233, 253, 0.3);
}

@media (max-width: 480px) {
  #container {
    padding: 25px 20px;
    max-width: 100%;
  }

  h1 {
    font-size: 2rem;
    margin-bottom: 20px;
  }

  .emoji-picker {
    gap: 8px;
    padding: 15px;
  }

  .emoji-option {
    min-height: 50px;
    font-size: 1.5rem;
  }

  .btn {
    padding: 12px 16px;
    font-size: 0.9rem;
  }

  .room-code,
  .room-code-input {
    font-size: 1.1rem;
  }

  #env-nav {
    gap: 0.4rem;
    margin-top: 1rem;
    padding-top: 0.75rem;
  }

  .env-btn {
    padding: 0.3rem 0.5rem;
    font-size: 0.65rem;
  }
}

/* Action Button Styles */
.action-btn {
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.action-btn.secondary {
  background: var(--info);
  color: var(--dark);
}

.action-btn.secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(139, 233, 253, 0.3);
}

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

/* ============================================ */
/* SHAREABLE LINK STYLES */
/* ============================================ */

.share-link-section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.invite-link-container {
  background: rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1rem;
  margin: 0.75rem 0;
  word-break: break-all;
}

.invite-link {
  font-family: "Courier New", monospace;
  font-size: 0.9rem;
  color: var(--info);
  text-align: center;
  line-height: 1.4;
}

.share-buttons {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.share-buttons .action-btn {
  flex: 1;
}

/* Mobile responsive adjustments */
@media (max-width: 480px) {
  .invite-link {
    font-size: 0.75rem;
  }

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

  .share-buttons .action-btn {
    width: 100%;
  }
}

/* Simpler glow - better iOS compatibility */
.btn-primary.glow {
  border: 2px solid var(--success);
  box-shadow: 0 0 20px rgba(80, 250, 123, 0.6);
  animation: simpleGlow 2s ease-in-out infinite;
  -webkit-animation: simpleGlow 2s ease-in-out infinite;
  /* Add this for iOS */
}

@keyframes simpleGlow {

  0%,
  100% {
    box-shadow: 0 0 20px rgba(80, 250, 123, 0.6);
    transform: scale(1);
  }

  50% {
    box-shadow: 0 0 30px rgba(80, 250, 123, 0.9);
    transform: scale(1.02);
  }
}

/* Add webkit prefix for better iOS support */
@-webkit-keyframes simpleGlow {

  0%,
  100% {
    box-shadow: 0 0 20px rgba(80, 250, 123, 0.6);
    -webkit-transform: scale(1);
  }

  50% {
    box-shadow: 0 0 30px rgba(80, 250, 123, 0.9);
    -webkit-transform: scale(1.02);
  }
}

/* OLD VERSION - Commented out for reference */
/* 
@keyframes pulseGlow {
  0%,
  100% {
    box-shadow: 0 0 20px rgba(80, 250, 123, 0.6),
      0 0 40px rgba(80, 250, 123, 0.4),
      0 0 60px rgba(80, 250, 123, 0.2);
  }

  50% {
    box-shadow: 0 0 30px rgba(80, 250, 123, 0.8),
      0 0 60px rgba(80, 250, 123, 0.6),
      0 0 90px rgba(80, 250, 123, 0.4);
  }
}
*/