/* Reset & base */
* {
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
}
body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background: #111827;
  color: #eee;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 1rem 2rem;
}

/* ID styles */
#id h2 {
    text-align: center;
}

.my-id-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #35363b;
    color: #ccc;
    padding: 0.7rem 1rem;
    font-size: 2rem;
    letter-spacing: 7px;
    text-align: center;
    border-radius: 14px;
    font-family: monospace;
    margin-bottom: 1rem;
    width: 100%;
    user-select: text;
}
.peer-id {
    border: none;
    outline: none;
    flex-grow: 1;
}
.copy-btn {
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 0.5em;
}
.copy-btn:hover {
  color: #ccc;
}

/* QR code container */
.qrcode {
  margin: 1rem auto 3rem auto;
  width: 180px;
  height: 180px;
  user-select: none;
}

/* Main container with send and receive side-by-side */
.app-container {
  display: flex;
  max-width: 960px;
  width: 100%;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  padding: 50px 1rem;
}

/* Cards */
.card-wrapper {
  position: relative;
  height: auto;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  transition: all  0.25s ease;
}
.card {
  background: #575b66;
  border-radius: 12px;
  padding: 2rem 2.5rem;
  width: 100%;
  max-width: 500px;
  max-height: 700px;
  flex: 1 1 400px;
  display: flex;
  flex-direction: column;
  transition: all  0.25s ease;
}

/* Headings */
h2 {
  margin-bottom: 2rem;
  font-weight: 700;
  color: #fff;
  font-size: 1.5rem;
  user-select: none;
}

h2 i {
  padding-right: 10px;
}

/* Drop zone */
.drop-zone {
  flex-grow: 0;
  border: 3px dashed #6fb7d0;
  border-radius: 20px;
  padding: 3rem 2rem;
  color:  #6fb7d0;
  font-weight: 600;
  font-size: 1.25rem;
  text-align: center;
  cursor: pointer;
  transition:
    background 0.3s ease,
    border-color 0.3s ease,
    color 0.3s ease;
  user-select: none;
  margin-bottom: 1.5rem;
}
.drop-zone:hover,
.drop-zone.dragover {
  background: rgba(111, 183, 208, 0.2);
  border-color: #6fb7d0;
  color: #ccc;
}

/* File input hidden but clickable */
#fileInput {
  display: none;
}

/* Queue list */
.queue-list {
  max-height: 220px;
  min-height: 100px;
  border-top: 1px solid #333;
  padding-top: 0.5rem;
  margin-bottom: 1rem;
  overflow: hidden auto;
  user-select: none;
}
.queue-item {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 6px;
  padding: 0.8rem 1rem;
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s ease;
}
.queue-item:hover {
  background: rgba(0, 0, 0, 0.5);
}
.queue-item div {
  overflow-wrap: anywhere;
  padding-right: 10px;
  flex-grow: 1;
  user-select: text;
  display: block;
}
.queue-item small {
  font-family: monospace;
  display: block;
}
.queue-item button {
  background: transparent;
  border: none;
  font-size: 1rem;
  color: #fff;
  cursor: pointer;
  padding: 0 0.5rem;
  user-select: none;
  transition: color 0.2s ease;
}
.queue-item button:hover {
  color: #F87171;
}

/* Sent Items list */
#sent-queue {
  display: none;
}
#sentFiles {
  overflow: hidden auto;
  transition: all 0.2s ease;
}
.sent-item {
  padding: 0.8rem 1rem;
  /* background: #1f2b2d; */
  background: rgba(0, 0, 0, 0.3);
  margin-bottom: 0.5rem;
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}
.sent-item span {
  overflow-wrap: anywhere;
  padding-right: 10px;
}
.sent-status {
  display: flex;
  align-items: center;
  font-size: 0.85rem;
  color: #34D399;
}
.sent-status i {
  padding-right: 5px;
}
#sentStatus {
  margin-bottom: 1rem;
  min-height: 28px;
}

/* Text inputs */
#peerIdInput {
    border: none;
    outline: none;
    background: #35363b;
    color: #ccc;
    padding: 0.7rem 1rem;
    font-size: 2rem;
    letter-spacing: 7px;
    text-align: center;
    border-radius: 14px;
    font-family: monospace;
    margin-bottom: 1rem;
    width: 100%;
    user-select: text;
    transition: background 0.25s ease;
}

/* Buttons */
.button-primary {
  background:  #6fb7d0;
  border: none;
  border-radius: 18px;
  color: #121212;
  font-weight: 700;
  padding: 1rem 2rem;
  font-size: 1.15rem;
  cursor: pointer;
  align-self: center;
  user-select: none;
  transition: background 0.3s ease, transform 0.2s ease;
}
.button-primary:hover {
  transform: scale(1.05);
}

/* Status text */
.status-small {
  font-size: 0.9rem;
  color: #ccc;
  margin-top: 1rem;
  font-style: italic;
  user-select: none;
}

#fileCountStatus {
    display: inline-block;
}

/* Receive section */
.receive-section {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.receive-status {
  font-weight: 600;
  margin-bottom: 1rem;
  min-height: 28px;
  user-select: none;
}

.receive-progress {
  overflow: hidden auto;
  max-height: 400px;
  border-top: 1px solid #333;
  padding-top: 0.5rem;
}

.preview-container {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 6px;
  padding: 1rem 1.2rem;
  margin-bottom: 1rem;
    margin-right: 1rem;
  user-select: none;
  transition: background 0.25s ease;
}
.preview-container:hover {
  background: rgba(0, 0, 0, 0.5);
}
.preview-container .file-size {
  font-size: 0.85rem;
  color: #bbb;
  margin-top: 0.3rem;
  font-style: italic;
}
.preview-container .progress-text {
  display: block;
  font-size: 0.75rem;
  color: #b4b4b4;
  margin-top: 0.2rem;
  font-family: monospace;
  user-select: none;
}
.preview-container p {
  font-weight: normal;
  margin: 0;
  word-break: break-word;
    /* color: #b4b4b4; */
    font-size: 1em;
}
.preview-container button {
    display: inline-flex;
  align-self: flex-start;
  justify-content: center;
  margin-top: 0.7em;
  padding: 0.5rem;
  font-size: 1em;
  color:  #b4b4b4;
  background: transparent;
  border: none;
  cursor: pointer;
  user-select: none;
  transition: background 0.3s ease;
}
.preview-container button:hover {
  color: #fff;
}
.preview-container .remove-btn:hover {
 color: #F87171;
}
.preview-container button:disabled, .preview-container button:disabled:hover {
    cursor: default;
    transform: scale(1);
    color: #b4b4b4;
}
#downloadAllBtn {
  min-height: 28px;
  background: transparent;
  border: none;
  user-select: none;
  cursor: pointer;
  text-decoration: underline;
  color: #ccc;
}

/* Tabs */
#tabs {
    position: fixed;
    bottom: 2em;
    border-radius: 18px;
    background-color: #575b66;
    display: flex;
    cursor: pointer;
    user-select: none;
    box-shadow: inset 0 0 20px -8px #000;
    border: 1px solid #212121;
}

#tabs .tab {
    padding: 1rem 1.5rem;
    border-radius: 18px;
}

#tabs .tab:hover {
    background-color: rgba(244, 244, 245, 0.2);
}

#tabs .tab.active {
    background-color: #35363b;
}

.tab-layer {
    display: none;
}

.tab-layer.active {
    display: flex;
    animation: bubbleIn 0.3s ease forwards;
}

.split-2 {
  overflow-x: auto;
  scroll-snap-type: x mandatory;
}
.split-2 .card {
  width: calc(100vw - 4rem);
  height: 90%;
  max-width: 400px;
  margin-right: 2rem;
  scroll-snap-align: center;
}
.split-2 .card:last-of-type {
    margin-top: 3rem;
}

/* Snackbar */
#snackbar {
  visibility: hidden;
  min-width: 240px;
  max-width: 90%;
  padding: 1rem 1.4rem;
  border-radius: 14px;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  bottom: 70px;
  opacity: 0;
  transition: opacity 0.3s ease, bottom 0.3s ease;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

#snackbar i {
  padding-right: 10px;
}

/* Visibility class */
#snackbar.show {
  visibility: visible;
  opacity: 1;
  bottom: 100px;
}

/* Success style */
#snackbar.success {
  background-color: 	#34D399;
  color: #111;
}

/* Error style */
#snackbar.error {
  background-color: 	#F87171;
  color: #fff;
}

/* Scrollbar */
* {
    scrollbar-color: rgba(0, 0, 0, 0.5) rgba(0, 0, 0, 0.3);
    scrollbar-width: thin;
}


/* Animations */

/* Animation: bubble-in (scale & fade) */
@keyframes bubbleIn {
  0% {
    opacity: 0;
    transform: scale(0.85);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Animation: slide-out to right & fade */
@keyframes slideOutRight {
  0% {
    opacity: 1;
    transform: translateX(0);
  }
  100% {
    opacity: 0;
    transform: translateX(30px);
  }
}

/* Classes to trigger animations */
.enter {
  animation: bubbleIn 0.3s ease forwards;
}

.exit {
  animation: slideOutRight 0.3s ease forwards;
}

/* Responsive */
@media (max-width: 720px) {
  .app-container {
    padding: 1rem;
  }
  .card-wrapper {
    height: 80vh;
    justify-content: flex-start;
  }
  .card {
    padding: 2rem 1.5rem;
  }
  .drop-zone {
    padding: 2rem 1rem;
    font-size: 1.1rem;
  }
  .button-primary:not(.preview-container button) {
    width: 100%;
    padding: 1rem 0;
  }
}