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

:root {
  --bg-gradient: linear-gradient(140deg, #f6d1e7, #d1e8f6);
  --container-bg: rgba(255, 255, 255, 0.85);
  --text-color: #333;
  --subtitle-color: #666;
  --card-bg: #fff;
  --shadow: rgba(0, 0, 0, 0.1);
}

body.dark {
  --bg-gradient: linear-gradient(135deg, #1e1e2f, #2a2a3d);
  --container-bg: rgba(40, 40, 55, 0.9);
  --text-color: #eee;
  --subtitle-color: #bbb;
  --card-bg: #2d2d42;
  --shadow: rgba(0, 0, 0, 0.4);
}

body {
  margin: 0;
  margin-top: 50px;
  margin-bottom: 20px;
  font-family: 'Poppins', sans-serif;
  background: var(--bg-gradient);
  color: var(--text-color);
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background 0.3s, color 0.3s;
}

.container {
  text-align: center;
  background: var(--container-bg);
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 8px 20px var(--shadow);
  width: 90%;
  max-width: 600px;
  transition: background 0.3s;
}

header {
  position: relative;
}

#theme-toggle {
  text-align: center;
}

h1 {
  font-weight: 700;
  margin-bottom: 10px;
}

.subtitle {
  font-weight: 300;
  color: var(--subtitle-color);
  margin-bottom: 30px;
}

#theme-toggle {
  position: center;
  background: none;
  border: none;
  font-size: 1.6em;
  cursor: pointer;
  transition: transform 0.3s;
  color: var(--text-color);
}

.toggle-card {
  background: var(--card-bg);
  border-radius: 15px;
  box-shadow: 0 4px 12px var(--shadow);
  padding: 20px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background 0.3s;
}

#theme-toggle:hover {
  transform: scale(1.2);
}

.app-grid {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
}

.app-card {
  background: var(--card-bg);
  border-radius: 15px;
  box-shadow: 0 4px 12px var(--shadow);
  padding: 20px;
  width: 130px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background 0.3s;
  display: flex;                /* Make card a flex container */
  flex-direction: column;       /* Stack icon and text vertically */
  justify-content: space-between; /* Push span to the bottom */
  align-items: center;          /* Center icon horizontally */
}


.app-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 15px var(--shadow);
}

.app-card img {
  width: 100%;
  height: auto;
  max-width: 420px; /* optional, keeps it tidy */
}

.app-card span {
  display: block;
  font-weight: 500;
  color: var(--text-color);
}

footer {
  margin-top: 40px;
  font-size: 0.9em;
  color: var(--subtitle-color);
}

footer a {
  color: var(--text-color);
  text-decoration: none;
}

/* --- Mobile & Tablet Responsiveness --- */
@media (max-width: 768px) {
  body {
    height: auto;
    padding: 20px;
    align-items: flex-start;
  }

  .container {
    width: 100%;
    max-width: 95%;
    padding: 25px;
    border-radius: 15px;
  }

  header h1 {
    font-size: 1.8em;
  }

  .subtitle {
    font-size: 0.95em;
    margin-bottom: 20px;
  }

  .app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
  }

  .app-card {
    width: 90%;
    padding: 15px;
  }

  .app-card img {
    width: 70%;
    max-width: 120px;
  }

  footer {
    margin-top: 30px;
    font-size: 0.8em;
  }
}

@media (max-width: 480px) {
  header h1 {
    font-size: 1.5em;
  }

  #theme-toggle {
    font-size: 1.4em;
  }

  .app-card span {
    font-size: 0.85em;
  }

  .app-card img {
    width: 60%;
  }

  footer {
    margin-top: 20px;
  }
}

/* Prevent theme toggle overlap on smaller screens */
@media (max-width: 768px) {
  header {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
  }

  #theme-toggle {
    position: static; /* remove absolute positioning */
    margin: 10px; /* spacing below header text */
    align-self: center;
    font-size: 1.6em;
  }
}

/* Optional: make it slightly smaller on very small phones */
@media (max-width: 480px) {
  #theme-toggle {
    font-size: 1.4em;
    margin-top: 8px;
  }
}

.coffee-button {
  margin-top: 25px;
  text-align: center;
}

.coffee-button img {
  height: 45px;
  border-radius: 10px;
  box-shadow: 0 4px 12px var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.coffee-button img:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 18px var(--shadow);
}
/* End of CSS file */