:root {
  --font-family: 'Poppins', sans-serif;
  --primary-color: "#3878e2";
  --secondary-color: "#FF5757";
  --background-color: #121212;
  --card-bg: #1e1e1e;
  --success-color: #4caf50;
  --error-color: #f44336;
  --text-color: #e0e0e0;
  --btn-bg: #262626;
  --btn-hover-bg: #333333;
}

* {
  box-sizing: border-box;
}

body {
  background-color: var(--background-color);
  font-family: var(--font-family);
  color: var(--text-color);
  margin: 0;
  padding: 1rem 2rem;
}

main {
  max-width: 960px;
  margin: 0 auto;
}

h1 {
  text-align: center;
  margin-bottom: 2rem;
  font-weight: 700;
  font-size: 2.5rem;
  color: var(--primary-color);
}

/* Container for all cards */
.connections-container {
  display: flex;
  justify-content: space-around;
  gap: 0.5rem;
  margin-bottom: 3rem;
  flex-wrap: nowrap; /* no wrapping on wide screens */
  overflow-x: hidden; /* prevent scroll */
  padding-bottom: 0;
}

.connection-card {
  background-color: var(--card-bg);
  border-radius: 12px;
  padding: 1rem 0.5rem;
  margin-block: 20px;
  width: 300px;
  text-align: center;
  box-shadow: 0 0 15px rgba(15, 98, 254, 0.2);
  transition: box-shadow 0.3s ease;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.connection-card:hover {
  box-shadow: 0 0 25px rgba(245, 59, 26, 0.5);
}

/* Image on left */
.image-container {
  width: 120px;
  height: 120px;
  border-radius: 12px;
  background-color: #222;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  flex-shrink: 0;
}

.image-container img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Right side: button stacked vertically with status text */
.connection-details {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  justify-content: center;
  gap: 0.75rem;
  text-align: left;
}

button {
  background-color: var(--btn-bg);
  border: none;
  color: var(--text-color);
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.25s ease;
  font-size: 12px;
  width: 100%;
  max-width: 240px;
}

button:hover {
  background-color: var(--btn-hover-bg);
}

.status-text {
  font-weight: 600;
  font-size: 1rem;
  margin-top: 0;
  text-align:center;
}

.status-connected {
  color: var(--success-color);
}

.status-disconnected {
  color: var(--error-color);
}

section {
  background-color: var(--card-bg);
  border-radius: 12px;
  padding: 1rem 1.5rem;
  box-shadow: 0 0 15px rgba(15, 98, 254, 0.2);
  max-height: 300px;
  overflow-y: auto;
}

#console-log {
  white-space: pre-wrap;
  font-family: monospace;
  font-size: 0.9rem;
  line-height: 1.4;
}

/* Responsive: stack cards vertically, no scroll */
@media (max-width: 768px) {
  .connections-container {
    flex-direction: column;
    gap: 1.5rem;
    overflow-x: visible;
  }

  .connection-card {
    width: 100%;
    max-width: 480px;
    padding: 0.75rem 1rem;
    height: auto;
  }

  .image-container {
    width: 80px;
    height: 80px;
  }

  button {
    max-width: 180px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }

  .status-text {
    font-size: 0.95rem;
  }

  .connection-card{
    margin-block: 0px;
  }

  h1 {
    font-size: 1.5rem;
  }
}

/* Extra small phones: smaller cards and content */
@media (max-width: 480px) {
  .connection-card {
    max-width: 100%;
    padding: 0.5rem 0.75rem;
  }

  .image-container {
    width: 50px;
    height: 50px;
  }

  button {
    max-width: 300px;
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
  }

  .status-text {
    font-size: 1rem;
  }

    h1 {
    font-size: 1.25rem;
    }
}
