@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;&display=swap');

:root {
  /* Premium Dark Mode Palette inspired by Telegram and modern iOS */
  --bg-main: #0F0F13;
  --bg-secondary: #1C1C24;
  --bg-glass: rgba(28, 28, 36, 0.75);
  --primary-color: #3390EC; /* Telegram Blue */
  --primary-glow: rgba(51, 144, 236, 0.4);
  --text-main: #FFFFFF;
  --text-muted: #8E8E93;
  --border-color: rgba(255, 255, 255, 0.1);
  --success: #34C759;
  --danger: #FF3B30;
  --font-family: 'Outfit', sans-serif;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Utilities */
.container {
  width: 100%;
  max-width: 480px; /* Mobile first / Web app layout */
  margin: 0 auto;
  padding: 0 20px;
}

.text-center { text-align: center; }
.mt-2 { margin-top: 1rem; }
.mt-4 { margin-top: 2rem; }
.mb-2 { margin-bottom: 1rem; }
.text-muted { color: var(--text-muted); }

/* Glassmorphism Cards */
.glass-card {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

/* Typography */
h1, h2, h3 { font-weight: 600; }
.title {
  font-size: 2.5rem;
  background: linear-gradient(135deg, #fff 0%, #a5a5a5 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 10px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 14px 24px;
  border-radius: 14px;
  font-family: var(--font-family);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  border: none;
  outline: none;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--primary-color);
  color: #fff;
  box-shadow: 0 4px 20px var(--primary-glow);
}

.btn-primary:active {
  transform: scale(0.96);
  box-shadow: 0 2px 10px var(--primary-glow);
}

.btn-outline {
  background: transparent;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
}

.btn-secondary {
  background-color: var(--bg-secondary);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

/* Forms */
.form-group {
  margin-bottom: 16px;
  text-align: left;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 6px;
  color: var(--text-muted);
}

.form-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 14px 16px;
  border-radius: 12px;
  font-family: var(--font-family);
  font-size: 1rem;
  transition: border-color 0.3s ease, background 0.3s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-color);
  background: rgba(255, 255, 255, 0.1);
}

/* Status Badges */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
}
.badge-active { background: rgba(52, 199, 89, 0.2); color: var(--success); }
.badge-inactive { background: rgba(255, 59, 48, 0.2); color: var(--danger); }

/* Animations */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in-up {
  animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Device Grid (Dashboard) */
.device-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 20px;
}

.device-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.device-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--primary-color);
}

.device-icon {
  font-size: 2rem;
}

/* Header Navbar */
header {
  padding: 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-main);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo img {
  width: 40px !important;
  height: 40px !important;
  border-radius: 8px !important;
}

.back-link {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-main);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 0.2s;
}
.back-link:hover { color: var(--primary-color); }
