/* ============================================
   Lab Dashboard - Global Styles
   Mobile-first responsive design
   ============================================ */

:root {
  --primary-color: #2563eb;
  --primary-dark: #1e40af;
  --bg-dark: #0f172a;
  --bg-secondary: #1e293b;
  --text-light: #f1f5f9;
  --text-muted: #94a3b8;
  --border-color: #334155;
  --success: #10b981;
  --error: #ef4444;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.4);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-secondary) 100%);
  color: var(--text-light);
  line-height: 1.6;
  min-height: 100vh;
}

/* ============================================
   Authentication Screen
   ============================================ */

.auth-screen {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 1rem;
}

.auth-screen.hidden {
  display: none;
}

.auth-container {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2rem;
  width: 100%;
  max-width: 360px;
  box-shadow: var(--shadow-lg);
}

.auth-container h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  text-align: center;
  color: var(--text-light);
}

.auth-subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

#auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#password-input {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-dark);
  color: var(--text-light);
  font-size: 1rem;
  transition: border-color 0.2s;
}

#password-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

#auth-form button {
  padding: 0.75rem 1rem;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

#auth-form button:hover {
  background: var(--primary-dark);
}

.auth-error {
  color: var(--error);
  font-size: 0.875rem;
  text-align: center;
}

/* ============================================
   Dashboard Screen
   ============================================ */

.dashboard-screen {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.dashboard-screen.hidden {
  display: none;
}

/* ============================================
   Header
   ============================================ */

.header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 1.5rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.header-content h1 {
  font-size: 1.75rem;
  margin-bottom: 0.25rem;
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.logout-btn {
  padding: 0.5rem 1rem;
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  color: var(--text-light);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.875rem;
  transition: all 0.2s;
  white-space: nowrap;
}

.logout-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

/* ============================================
   Main Dashboard
   ============================================ */

.dashboard {
  flex: 1;
  padding: 2rem 1rem;
  display: flex;
  justify-content: center;
}

.apps-container {
  width: 100%;
  max-width: 1200px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

/* ============================================
   App Card
   ============================================ */

.app-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  transition: all 0.3s ease;
  cursor: pointer;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  height: 100%;
}

.app-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2), var(--shadow-lg);
}

.app-card.coming-soon {
  opacity: 0.6;
  cursor: not-allowed;
}

.app-card.coming-soon:hover {
  transform: none;
  border-color: var(--border-color);
  box-shadow: none;
}

.app-icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.app-card[data-color="orange"] .app-icon {
  background: linear-gradient(135deg, #f97316, #ea580c);
}

.app-card[data-color="green"] .app-icon {
  background: linear-gradient(135deg, #10b981, #059669);
}

.app-card[data-color="purple"] .app-icon {
  background: linear-gradient(135deg, #a855f7, #9333ea);
}

.app-card[data-color="pink"] .app-icon {
  background: linear-gradient(135deg, #ec4899, #db2777);
}

.app-card[data-color="cyan"] .app-icon {
  background: linear-gradient(135deg, #06b6d4, #0891b2);
}

.app-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-light);
}

.app-description {
  font-size: 0.875rem;
  color: var(--text-muted);
  flex-grow: 1;
}

.app-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary-color);
  width: fit-content;
}

.app-badge.coming-soon {
  background: rgba(107, 114, 128, 0.2);
  color: var(--text-muted);
}

.app-link {
  color: var(--primary-color);
  font-size: 0.875rem;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.app-link:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* ============================================
   Footer
   ============================================ */

.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 768px) {
  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .logout-btn {
    align-self: flex-end;
    margin-top: -2rem;
  }

  .header-content h1 {
    font-size: 1.5rem;
  }

  .dashboard {
    padding: 1.5rem 1rem;
  }

  .apps-container {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .auth-container {
    padding: 1.5rem;
    max-width: 100%;
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .apps-container {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
}

/* ============================================
   Utilities
   ============================================ */

.hidden {
  display: none !important;
}

/* Smooth transitions */
* {
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
