/* Base Reset and Layout */
body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  transition: background-color 0.3s, color 0.3s;
}
header, footer {
  text-align: center;
  padding: 2rem;
  background-color: var(--header-bg);
  color: var(--header-text);
}
nav {
  text-align: center;
  margin: 1rem 0;
}
a {
  text-decoration: none;
  color: var(--link);
}

button {
  padding: 0.6rem 1rem;
  font-size: 1rem;
  border: none;
  background-color: var(--button-bg);
  color: var(--button-text);
  border-radius: 6px;
  cursor: pointer;
}
button:hover {
  background-color: var(--button-hover);
}

/* Theme Toggle */
.theme-toggle-button {
  margin-top: 1rem;
}

/* Grid Layout */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  padding: 2rem;
}

/* Tool Cards */
.card {
  background-color: var(--card-bg);
  color: var(--card-text);
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  text-align: center;
}
.card h2 {
  margin-bottom: 0.8rem;
}

/* Modal Styles */
#modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-color: rgba(0,0,0,0.7);
  display: none;
  justify-content: center;
  align-items: center;
}
#modal-overlay.modal-hidden {
  display: none;
}
#modal-overlay.modal-visible {
  display: flex;
}
#modal-content {
  background-color: var(--modal-bg);
  padding: 1rem;
  border-radius: 8px;
  width: 80%;
  max-width: 900px;
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
  position: relative;
}
.modal-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background-color: transparent;
  font-size: 1.5rem;
  color: var(--text);
  border: none;
  cursor: pointer;
}
iframe {
  width: 100%;
  height: 600px;
  border: none;
}

/* Theme Variables */
:root {
  --bg: #f9f9f9;
  --text: #222;
  --link: #0077cc;
  --header-bg: #0077cc;
  --header-text: white;
  --button-bg: #0066bb;
  --button-text: white;
  --button-hover: #004499;
  --card-bg: white;
  --card-text: #222;
  --modal-bg: white;
}

[data-theme="dark"] {
  --bg: #121212;
  --text: #eee;
  --link: #6ab0f3;
  --header-bg: #222;
  --header-text: #eee;
  --button-bg: #333;
  --button-text: #eee;
  --button-hover: #555;
  --card-bg: #1e1e1e;
  --card-text: #eee;
  --modal-bg: #2c2c2c;
}
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  padding: 2rem;
  justify-items: center;
}
.card {
  transition: transform 0.2s ease;
}
.card:hover {
  transform: scale(1.05);
}
.card {
  transition: transform 0.3s ease;
}

.card:hover {
  transform: scale(1.05);
}
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  padding: 2rem;
  justify-items: center;
}
@media screen and (max-width: 600px) {
  .card {
    padding: 1rem;
    font-size: 0.95rem;
  }

  button {
    font-size: 0.9rem;
    padding: 0.5rem 0.8rem;
  }

  header h1 {
    font-size: 1.5rem;
  }

  header p {
    font-size: 1rem;
  }
}

iframe {
  width: 100%;
  height: 70vh;
}

