/* ===== Global Reset ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #333;
  line-height: 1.6;
  background-color: #f9f9f9;
}

/* ===== Container & Layout ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== Header & Navigation ===== */
.header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.logo h1 {
  font-size: 1.8rem;
  font-weight: 700;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-links a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.3s ease;
}

.nav-links a:hover {
  opacity: 0.8;
}

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
  background: #f0f0f0;
  color: #333;
  border: 2px solid #ddd;
}

.btn-secondary:hover {
  background: #e0e0e0;
  border-color: #999;
}

/* ===== Hero Section ===== */
.hero {
  padding: 80px 0;
  background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
}

.hero .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.hero-content h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: #1a1a1a;
}

.hero-content p {
  font-size: 1.1rem;
  color: #666;
  margin-bottom: 2rem;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.phone-mockup {
  background: white;
  border: 15px solid #333;
  border-radius: 40px;
  width: 280px;
  height: 560px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
  margin: 0 auto;
}

.phone-content {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 30px;
  text-align: center;
  padding: 20px;
}

/* ===== Features Section ===== */
.features {
  padding: 80px 0;
  background: white;
}

.features h3 {
  text-align: center;
  font-size: 2.2rem;
  margin-bottom: 3rem;
  color: #1a1a1a;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.feature-card {
  background: #f9f9f9;
  border: 2px solid #eee;
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  transition: all 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-5px);
  border-color: #667eea;
  box-shadow: 0 10px 25px rgba(102, 126, 234, 0.15);
}

.feature-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.feature-card h4 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  color: #1a1a1a;
}

.feature-card p {
  color: #666;
  font-size: 0.95rem;
}

/* ===== Download Section ===== */
.download {
  padding: 80px 0;
  background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
}

.download h3 {
  text-align: center;
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
  color: #1a1a1a;
}

.download > .container > p {
  text-align: center;
  color: #666;
  margin-bottom: 3rem;
  font-size: 1.1rem;
}

.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.download-card {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

.download-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.download-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
}

.download-card h4 {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
  color: #1a1a1a;
}

.download-card p {
  color: #666;
  margin-bottom: 1rem;
}

.download-info {
  background: #f5f5f5;
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem 0;
}

.download-info p {
  margin: 0.5rem 0;
  font-size: 0.85rem;
}

.download-card .btn {
  margin-top: 1rem;
  width: 100%;
}

/* ===== Connect Section ===== */
.connect {
  padding: 80px 0;
  background: white;
}

.connect h3 {
  text-align: center;
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
  color: #1a1a1a;
}

.connect > .container > p {
  text-align: center;
  color: #666;
  margin-bottom: 3rem;
  font-size: 1rem;
}

.connect-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.server-discovery,
.manual-connect {
  background: #f9f9f9;
  border: 2px solid #eee;
  border-radius: 12px;
  padding: 2rem;
}

.server-discovery h4,
.manual-connect h4 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  color: #1a1a1a;
}

.info-text {
  color: #666;
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.server-list {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  margin: 1.5rem 0;
  min-height: 150px;
  border: 1px solid #ddd;
}

.server-item {
  background: linear-gradient(135deg, #667eea10 0%, #764ba210 100%);
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.server-item:hover {
  background: linear-gradient(135deg, #667eea20 0%, #764ba220 100%);
  border-color: #667eea;
}

.server-name {
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 0.3rem;
}

.server-ip {
  font-size: 0.9rem;
  color: #666;
  font-family: monospace;
}

.server-status {
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.status-online {
  color: #27ae60;
  font-weight: 600;
}

.status-offline {
  color: #e74c3c;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #333;
}

.form-group input {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #ddd;
  border-radius: 6px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.form-group input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.manual-connect .btn {
  width: 100%;
}

.qrcode-info {
  background: linear-gradient(135deg, #667eea10 0%, #764ba210 100%);
  border: 2px dashed #667eea;
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
}

.qrcode-info h4 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  color: #1a1a1a;
}

.qrcode-info p {
  color: #666;
}

/* ===== Loading Spinner ===== */
.loading {
  text-align: center;
  padding: 2rem;
}

.spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #667eea;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.loading p {
  color: #666;
  margin-top: 1rem;
}

/* ===== Footer ===== */
.footer {
  background: #1a1a1a;
  color: white;
  padding: 3rem 0;
  text-align: center;
}

.footer a {
  color: #667eea;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer a:hover {
  color: #764ba2;
}

.footer p {
  margin: 0.5rem 0;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
  .nav-links {
    flex-direction: column;
    gap: 1rem;
  }

  .hero .container {
    grid-template-columns: 1fr;
  }

  .hero-content h2 {
    font-size: 2rem;
  }

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

  .hero-buttons .btn {
    width: 100%;
  }

  .connect-container {
    grid-template-columns: 1fr;
  }

  .features h3,
  .download h3,
  .connect h3 {
    font-size: 1.8rem;
  }

  .hero-content p {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .logo h1 {
    font-size: 1.4rem;
  }

  .nav-links {
    gap: 0.5rem;
    font-size: 0.85rem;
  }

  .hero-content h2 {
    font-size: 1.5rem;
  }

  .features-grid,
  .download-grid {
    grid-template-columns: 1fr;
  }

  .phone-mockup {
    width: 200px;
    height: 400px;
    border-width: 10px;
  }
}
