:root {
  --color-primary: #84cc16;
  --color-primary-dark: #65a30d;
  --color-primary-light: #bef264;
  --color-bg-dark: #0f172a;
  --color-bg-darker: #020617;
  --color-text-light: #f1f5f9;
  --color-text-muted: #cbd5e1;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

* {
  font-family: 'Space Mono', monospace;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: 'Space Mono', monospace;
  font-weight: 700;
}

.font-mono {
  font-family: 'Space Mono', monospace;
}

#logo {
  font-family: 'Space Mono', monospace;
}

body {
  background: linear-gradient(135deg, var(--color-bg-dark) 0%, #1a293e 100%);
  color: var(--color-text-light);
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

/* Instructions Banner */
.instructions-banner {
  background: linear-gradient(135deg, rgba(132, 204, 22, 0.12) 0%, rgba(101, 163, 13, 0.08) 100%);
  border-bottom: 1px solid rgba(132, 204, 22, 0.25);
  backdrop-filter: blur(10px);
  animation: slideDown 0.5s ease-out;
}

.instructions-compact {
  display: flex;
  align-items: center;
  justify-content: center;
}

.instructions-text-compact {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  line-height: 1.6;
  text-align: center;
}

.instruction-label {
  color: var(--color-primary);
  font-weight: 700;
  margin-right: 0.5rem;
}

.instruction-content {
  color: var(--color-text-light);
}

.url-highlight {
  color: var(--color-primary);
  font-weight: 700;
  padding: 0.125rem 0.375rem;
  background: rgba(132, 204, 22, 0.15);
  border-radius: 4px;
  white-space: nowrap;
}

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

@media (max-width: 768px) {
  .instructions-text-compact {
    font-size: 0.75rem;
  }
  
  .instruction-label {
    display: block;
    margin-bottom: 0.25rem;
  }
}

/* Custom Scrollbar */
#sent-files::-webkit-scrollbar,
#received-files::-webkit-scrollbar {
  width: 8px;
}

#sent-files::-webkit-scrollbar-track,
#received-files::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.5);
  border-radius: 10px;
}

#sent-files::-webkit-scrollbar-thumb,
#received-files::-webkit-scrollbar-thumb {
  background: rgba(132, 204, 22, 0.3);
  border-radius: 10px;
}

#sent-files::-webkit-scrollbar-thumb:hover,
#received-files::-webkit-scrollbar-thumb:hover {
  background: rgba(132, 204, 22, 0.5);
}

/* Smooth Page Load Animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

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

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }

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

@keyframes pulse-subtle {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(132, 204, 22, 0.4);
  }

  50% {
    box-shadow: 0 0 0 10px rgba(132, 204, 22, 0);
  }
}

@keyframes spin-slow {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }

  100% {
    background-position: 1000px 0;
  }
}

main {
  animation: fadeInUp 0.6s ease-out;
}

section {
  animation: fadeInUp 0.6s ease-out forwards;
  animation-fill-mode: both;
}

section:nth-child(1) {
  animation-delay: 0.1s;
}

section:nth-child(2) {
  animation-delay: 0.2s;
}

section:nth-child(3) {
  animation-delay: 0.3s;
}

section:nth-child(4) {
  animation-delay: 0.4s;
}

/* Card Styles */
.card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.8) 100%);
  border: 1px solid rgba(132, 204, 22, 0.1);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  transition: var(--transition-smooth);
  padding: 1.5rem;
}

.card:hover {
  border-color: rgba(132, 204, 22, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(132, 204, 22, 0.08);
}

/* Button Styles */
.btn {
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  border: none;
  font-size: 1rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: #0f172a;
  box-shadow: 0 4px 12px rgba(132, 204, 22, 0.2);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(132, 204, 22, 0.3);
}

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

.btn-secondary {
  background: rgba(132, 204, 22, 0.1);
  border: 1px solid rgba(132, 204, 22, 0.3);
  color: var(--color-primary);
}

.btn-secondary:hover {
  background: rgba(132, 204, 22, 0.15);
  border-color: var(--color-primary);
}

/* Connection Badge */
.connection-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(132, 204, 22, 0.2);
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
}

.connection-badge.active {
  background: rgba(132, 204, 22, 0.2);
  border-color: var(--color-primary);
}

.id-label-mobile {
  display: inline;
}

.id-label-desktop {
  display: none;
}

@media (min-width: 640px) {
  .id-label-mobile {
    display: none;
  }

  .id-label-desktop {
    display: inline;
  }
}

.connection-dot {
  width: 8px;
  height: 8px;
  background: var(--color-primary);
  border-radius: 50%;
  animation: pulse-subtle 2s infinite;
}

/* Peer Card */
.peer-card {
  padding: 1rem;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.6) 0%, rgba(15, 23, 42, 0.6) 100%);
  border: 2px solid rgba(132, 204, 22, 0.1);
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  font-weight: 600;
}

.peer-card:hover {
  border-color: var(--color-primary);
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.9) 100%);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(132, 204, 22, 0.2);
}

.peer-card.connected {
  background: linear-gradient(135deg, rgba(132, 204, 22, 0.1) 0%, rgba(101, 163, 13, 0.05) 100%);
  border-color: var(--color-primary);
  box-shadow: 0 0 20px rgba(132, 204, 22, 0.15);
}

/* Progress Bar */
.progress-container {
  position: relative;
  width: 100%;
  height: 6px;
  background: rgba(100, 116, 139, 0.2);
  border-radius: 10px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  border-radius: 10px;
  transition: width 0.3s ease-out;
  box-shadow: 0 0 10px rgba(132, 204, 22, 0.4);
}

/* File List Item */
.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(132, 204, 22, 0.1);
  border-radius: 8px;
  margin-bottom: 0.75rem;
  transition: var(--transition-smooth);
}

.file-item:hover {
  background: rgba(15, 23, 42, 0.8);
  border-color: rgba(132, 204, 22, 0.3);
  transform: translateX(4px);
}

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

.file-icon {
  font-size: 1.5rem;
}

.file-details {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.file-name {
  font-weight: 600;
  color: var(--color-primary);
  word-break: break-all;
}

.file-size {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* Input Styles */
input {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(132, 204, 22, 0.2);
  color: var(--color-text-light);
  transition: var(--transition-smooth);
}

input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(132, 204, 22, 0.1);
  background: rgba(15, 23, 42, 0.8);
}

/* Header */
header {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.8) 0%, rgba(10, 14, 30, 0.8) 100%);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(132, 204, 22, 0.1);
  animation: slideInLeft 0.5s ease-out;
}

/* Heading Hierarchy */
h1 {
  font-size: 2.5rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

h2 {
  font-size: 1.75rem;
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin-bottom: 1.5rem;
}

h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
  h1 {
    font-size: 1.75rem;
  }

  h2 {
    font-size: 1.35rem;
  }

  .card {
    padding: 1rem;
  }

  .btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
  }
}

/* Drop Zone */
#drop-zone {
  transition: var(--transition-smooth);
}

#drop-zone:hover {
  background: rgba(132, 204, 22, 0.05);
  border-color: rgba(132, 204, 22, 0.4);
}

#drop-zone.drag-over {
  background: rgba(132, 204, 22, 0.1);
  border-color: var(--color-primary);
  transform: scale(1.02);
}

/* Tab Styles */
.tab-container {
  display: flex;
  gap: 0;
  border-bottom: 1px solid rgba(132, 204, 22, 0.1);
}

.tab-button {
  flex: 1;
  padding: 1rem 1.5rem;
  background: rgba(15, 23, 42, 0.4);
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: var(--transition-smooth);
  font-weight: 600;
  font-size: 0.95rem;
  border-bottom: 2px solid transparent;
}

.tab-button:hover {
  background: rgba(15, 23, 42, 0.6);
  color: var(--color-text-light);
}

.tab-button.active {
  background: rgba(132, 204, 22, 0.1);
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.tab-content-section {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease-out, opacity 0.3s ease-out;
  opacity: 0;
}

.tab-content-section.active {
  max-height: 2000px;
  opacity: 1;
}

/* Toast Notification */
.toast-container {
  position: fixed;
  top: 5rem;
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 400px;
}

.toast {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 1px solid rgba(239, 68, 68, 0.5);
  border-left: 4px solid #ef4444;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  animation: slideInRight 0.3s ease-out;
  display: flex;
  align-items: start;
  gap: 0.75rem;
}

.toast.success {
  border-color: rgba(132, 204, 22, 0.5);
  border-left-color: var(--color-primary);
}

.toast-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
  color: var(--color-text-light);
}

.toast-message {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  line-height: 1.4;
}

.toast-close {
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.toast-close:hover {
  opacity: 1;
}

@keyframes slideInRight {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(400px);
    opacity: 0;
  }
}

.toast.hiding {
  animation: slideOutRight 0.3s ease-out forwards;
}

@media (max-width: 640px) {
  .toast-container {
    left: 1rem;
    right: 1rem;
    max-width: none;
  }
}