:root {
  --background-light: #ffffff;
  --background-dark: #121212;
  --text-light: #000000;
  --text-dark: #ffffff;
  --border-light: rgba(0, 0, 0, 0.1);
  --border-dark: rgba(255, 255, 255, 0.1);
  --button-color: #007bff;
  --accent-light: rgba(0, 123, 255, 0.1);
  --accent-dark: rgba(0, 123, 255, 0.2);
}

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: "Nunito", sans-serif;
  background-color: var(--background-light);
  color: var(--text-light);
  transition:
    background-color 0.3s,
    color 0.3s;
}

@media (prefers-color-scheme: dark) {
  body {
    background-color: var(--background-dark);
    color: var(--text-dark);
  }
}

main {
  text-align: center;
  padding: 2rem;
  width: 100%;
  max-width: 1200px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

h1 {
  font-size: 2.5em;
  margin-bottom: 2rem;
  font-weight: 700;
}

/* Button Container - Centered and responsive */
.button-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  max-width: 500px;
  align-items: center;
}

/* Desktop: side-by-side and perfectly centered */
@media (min-width: 641px) {
  .button-container {
    flex-direction: row;
    justify-content: center;
    gap: 1.5rem;
  }
}

/* Mobile adjustments */
@media (max-width: 640px) {
  main {
    padding: 1.5rem;
  }

  h1 {
    font-size: 2em;
    margin-bottom: 1.5rem;
  }

  .button-container {
    gap: 0.75rem;
  }
}

.button {
  padding: 0.9rem 2.5rem;
  min-width: 220px;
  font-size: 1.2em;
  font-weight: 700;
  color: var(--button-color);
  background: none;
  border: 2px solid var(--button-color);
  border-radius: 12px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: all 0.2s ease;
  flex: 1;
  max-width: 300px;
}

.button:hover,
.button:focus {
  background-color: var(--accent-light);
}

@media (prefers-color-scheme: dark) {
  .button:hover,
  .button:focus {
    background-color: var(--accent-dark);
  }
}

/* Modal Styles */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal-backdrop.visible {
  display: flex;
  opacity: 1;
}

.apps-section {
  background: var(--background-light);
  padding: 2rem;
  border-radius: 16px;
  width: 90%;
  max-width: 1000px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

@media (prefers-color-scheme: dark) {
  .apps-section {
    background: var(--background-dark);
  }
}

.close-modal {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 1.8rem;
  cursor: pointer;
  padding: 0.5rem;
  line-height: 1;
}

@media (prefers-color-scheme: dark) {
  .close-modal {
    color: var(--text-dark);
  }
}

/* Apps Grid */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  padding: 1rem;
}

@media (max-width: 640px) {
  .apps-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .apps-section {
    padding: 1.5rem;
    width: 95%;
  }

  .app-icon {
    width: 64px;
    height: 64px;
    border-radius: 14px;
  }
}

.app-card {
  background-color: var(--background-light);
  border-radius: 16px;
  padding: 1.5rem;
  text-align: left;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s;
}

@media (prefers-color-scheme: dark) {
  .app-card {
    background-color: var(--background-dark);
    border: 1px solid var(--border-dark);
    box-shadow: none;
  }
}

.app-card:hover {
  transform: translateY(-5px);
}

.app-icon {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  object-fit: cover;
  margin-bottom: 1rem;
}

.app-name {
  font-size: 1.2em;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.app-description {
  font-size: 0.9em;
  opacity: 0.8;
  margin-bottom: 1rem;
  line-height: 1.4;
}

.app-link {
  color: var(--button-color);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9em;
}

.app-link:hover {
  text-decoration: underline;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
