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

body {
  font-family: 'Inter', sans-serif;
  background: #0a0c10;
  color: #eef2ff;
  overflow-x: hidden;
}

.app {
  display: flex;
  min-height: 100vh;
}

/* ========== DRAWER / SIDEBAR ========== */
.drawer {
  width: 280px;
  background: rgba(18, 22, 35, 0.96);
  backdrop-filter: blur(12px);
  border-right: 1px solid #2a2f42;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  z-index: 20;
  transition: transform 0.25s ease;
}

.drawer-header {
  padding: 28px 20px;
  border-bottom: 1px solid #2a2f42;
}

.drawer-header h2 {
  font-size: 1.6rem;
  font-weight: 700;
  background: linear-gradient(135deg, #94a3f8, #4f9eff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.3px;
}

.drawer-header p {
  font-size: 0.75rem;
  color: #7f8ea3;
  margin-top: 6px;
}

.drawer-nav {
  flex: 1;
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s;
  color: #b9c8ff;
  font-weight: 500;
}

.nav-item i {
  width: 24px;
  font-size: 1.2rem;
}

.nav-item:hover {
  background: #1e293b;
  color: white;
}

.nav-item.active {
  background: #1a2542;
  color: #4f9eff;
  border-left: 3px solid #4f9eff;
}

.drawer-footer {
  padding: 16px;
  font-size: 0.7rem;
  text-align: center;
  border-top: 1px solid #232838;
  color: #6b7c9e;
}

/* ========== MAIN CONTENT ========== */
.main {
  flex: 1;
  margin-left: 280px;
  padding: 28px 36px;
  min-height: 100vh;
}

.view {
  display: none;
  animation: fadeIn 0.3s ease;
}

.view.active {
  display: block;
}

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

.view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid #22273b;
  flex-wrap: wrap;
  gap: 12px;
}

.view-header h2 {
  font-size: 1.5rem;
  font-weight: 600;
}

.icon-btn {
  background: #1e293b;
  border: none;
  color: #b9c8ff;
  padding: 8px 16px;
  border-radius: 30px;
  cursor: pointer;
  transition: 0.2s;
  font-size: 0.85rem;
}

.icon-btn:hover {
  background: #2d3a4e;
  color: white;
}

/* Home view */
.home-content {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.hero-icon {
  font-size: 4rem;
  color: #4f9eff;
  margin-bottom: 20px;
}

.home-content h1 {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

.info-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  margin: 32px 0;
}

.info-cards .card {
  background: #111622;
  padding: 12px 20px;
  border-radius: 40px;
  border: 1px solid #2a2f42;
  display: flex;
  align-items: center;
  gap: 10px;
}

.about-text {
  text-align: left;
  background: #0e121d;
  padding: 24px;
  border-radius: 24px;
  margin-top: 20px;
}

.about-text h3 {
  margin-bottom: 12px;
  color: #4f9eff;
}

.about-text p {
  margin-bottom: 12px;
  line-height: 1.5;
  color: #b9c8ff;
}

/* Device list */
.device-list-container {
  background: #0e121d;
  border-radius: 24px;
  padding: 20px;
}

.device-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.device-card {
  background: #131725;
  border-radius: 20px;
  padding: 14px;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid #252b3d;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.device-card:hover {
  background: #1b2135;
  border-color: #4f9eff;
}

.device-card.active {
  background: #1a2542;
  border-left: 4px solid #4f9eff;
}

.device-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.device-name {
  font-weight: 600;
  font-size: 1rem;
}

.device-details {
  font-size: 0.7rem;
  color: #7c8aa8;
}

.device-badge {
  font-size: 0.7rem;
  background: #0a0f1a;
  padding: 4px 10px;
  border-radius: 30px;
}

/* Commands grid - optimized for many cards */
.commands-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  max-height: 70vh;
  overflow-y: auto;
  padding: 4px 2px 20px 2px;
}

.cmd-card {
  background: #111622;
  border-radius: 20px;
  padding: 14px 12px;
  transition: 0.2s;
  border: 1px solid #262d42;
  cursor: pointer;
  text-align: center;
}

.cmd-card:hover {
  background: #182032;
  border-color: #4f9eff;
  transform: translateY(-2px);
}

.cmd-icon {
  font-size: 1.6rem;
  margin-bottom: 10px;
  color: #73a9ff;
}

.cmd-title {
  font-weight: 600;
  margin-bottom: 4px;
  font-size: 0.85rem;
}

.cmd-desc {
  font-size: 0.65rem;
  color: #7b8bb0;
  line-height: 1.3;
}

.device-badge-large {
  background: #1e293b;
  padding: 6px 14px;
  border-radius: 40px;
  font-size: 0.8rem;
}

/* Output log */
.results-log {
  background: #080c14;
  border-radius: 20px;
  padding: 16px;
  max-height: 65vh;
  overflow-y: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
}

.log-entry {
  background: #0f141f;
  margin-bottom: 12px;
  padding: 12px 16px;
  border-radius: 18px;
  border-left: 3px solid #4f9eff;
  word-break: break-word;
}

.log-entry pre {
  margin-top: 8px;
  white-space: pre-wrap;
  background: #03060c;
  padding: 10px;
  border-radius: 14px;
  color: #bcd0ff;
  font-size: 0.75rem;
  max-height: 300px;
  overflow-y: auto;
}

.log-time {
  color: #6e7fb0;
  font-size: 0.7rem;
  margin-right: 12px;
}

.empty-logs {
  text-align: center;
  padding: 48px 20px;
  color: #5f6f97;
}

/* Mobile */
.menu-toggle {
  display: none;
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 30;
  background: #1a2035;
  padding: 8px 14px;
  border-radius: 32px;
  cursor: pointer;
  border: 1px solid #334155;
  color: #eef2ff;
}

@media (max-width: 768px) {
  .drawer {
    transform: translateX(-100%);
  }
  .drawer.open {
    transform: translateX(0);
  }
  .main {
    margin-left: 0;
    padding: 20px 16px;
  }
  .menu-toggle {
    display: block;
  }
  .commands-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}

::-webkit-scrollbar {
  width: 5px;
}
::-webkit-scrollbar-track {
  background: #0e121d;
}
::-webkit-scrollbar-thumb {
  background: #2f3a5c;
  border-radius: 10px;
}