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

/* ========================
   VARIABLES
======================== */
:root {
  --bg: #f5f5f5;
  --form-bg: #f7f7f7;
  --card-bg: #ffffff;
  --btn-hover-bg: #45a29e;
  --footer-bg: #f5f5f5;
  --toggle-bg: rgba(15, 15, 15, 0.35);
  --primary: #45a29e;
  --secondary: #66fcf1;
  --accent: #0097a7;
  --text: #1b1b1b;
  --btn-text: #ffffff;
  --footer-text: #45a29e;
}

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

body {
  font-family: 'Poppins', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background 0.5s, color 0.5s;
}

/* LIGHT THEME */
body.light {
  --bg: #f5f5f5;
  --form-bg: #f7f7f7;
  --card-bg: #ffffff;
  --btn-hover-bg: #45a29e;
  --footer-bg: #f5f5f5;
  --toggle-bg: rgba(15, 15, 15, 0.35);
  --primary: #45a29e;
  --secondary: #66fcf1;
  --accent: #0097a7;
  --text: #1b1b1b;
  --btn-text: #ffffff;
  --footer-text: #45a29e;
}

body.dark {
  --bg: #0b0c10;
  --form-bg: #262626;
  --card-bg: #1f1f1f;
  --btn-hover-bg: #66fcf1;
  --footer-bg: #0b0c10;
  --toggle-bg: rgba(150, 94, 94, 0.543);
  --primary: #45a29e;
  --secondary: #66fcf1;
  --accent: #00fff5;
  --text: #c5c6c7;
  --btn-text: #ffffff;
  --footer-text: #45a29e;
}

#theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  border-radius: 8px;
  padding: 0.5rem 0.8rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 1000;
  color: var(--accent);
  transition: transform 0.3s;
}

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

/* ========================
   SECTIONS
======================== */
.section {
  padding: 100px 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: background 0.5s, color 0.5s;
}

.section h1,
.section h2 {
  color: var(--primary);
  margin-bottom: 20px;
}

.section p {
  margin-bottom: 40px;
}

/* ========================
   BUTTONS
======================== */
.btn {
  display: inline-block;
  background: var(--primary);
  color: var(--btn-text);
  padding: 12px 25px;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 500;
  transition: background 0.3s, color 0.3s;
}

.btn:hover {
  background: var(--btn-hover-bg);
  color: var(--bg);
}

/* ========================
   CARDS GRID
======================== */
.cards {
  display: flex;
  flex-wrap: wrap;
  gap: 25px;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  justify-content: center;
}

.cards>* {
  flex: 1 1 250px;
  max-width: 250px;
}

.card {
  background-color: var(--card-bg);
  color: var(--text);
  border-radius: 15px;
  padding: 30px 25px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s, background-color 0.5s, color 0.5s;
}

.card:hover {
  transform: translateY(-10px) scale(1.05);
  background-color: var(--primary);
  color: var(--btn-text);
}

/* ========================
   CONTACT FORM
======================== */
.contact-form {
  max-width: 500px;
  /* margin: 50px auto; */
  padding: 30px;
  background-color: var(--form-bg);
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  font-family: Arial, sans-serif;
  transition: background-color 0.5s, color 0.5s;
  color: var(--text);
}

.contact-form h2 {
  text-align: center;
  margin-bottom: 20px;
}

.contact-form label {
  display: block;
  text-align: start;
  margin-bottom: 5px;
  font-weight: bold;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 12px;
  margin-bottom: 15px;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 16px;
  box-sizing: border-box;
  background-color: inherit;
  color: inherit;
}

.contact-form button {
  width: 100%;
  padding: 15px;
  background-color: var(--primary);
  color: var(--btn-text);
  border: none;
  font-size: 16px;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s, color 0.3s;
}

.contact-form button:hover {
  background-color: var(--btn-hover-bg);
  color: var(--bg);
}

/* Button styling */
#sendBtn {
  position: relative;
  background: #58a6ff;
  color: #0d1117;
  font-weight: bold;
  padding: 0.9rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.3s ease;
  overflow: hidden;
}

#sendBtn[disabled]{
  background: #30363d;
  cursor: not-allowed;
}

#sendBtn:hover:not(.loading) {
  background: #1f6feb;
}

/* Hide loader by default */
.loader {
  display: none;
  width: 20px;
  height: 20px;
  border: 3px solid #0d1117;
  border-top-color: #58a6ff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: auto;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* When loading, hide text and show spinner */
#sendBtn.loading .btn-text {
  visibility: hidden;
}

#sendBtn.loading .loader {
  display: inline-block;
}

#sendBtn.loading {
  cursor: not-allowed;
  background: #30363d;
}

/* ========================
   FOOTER
======================== */
footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: 40px 10px;
  text-align: center;
  font-size: 0.9em;
  transition: background 0.5s, color 0.5s;
}

/* ========================
   RESPONSIVE HERO
======================== */
#home h1 {
  font-size: 2.8em;
  margin-bottom: 20px;
}

#home p {
  font-size: 1.2em;
  max-width: 700px;
}

@media (max-width: 768px) {
  #home h1 {
    font-size: 2.2em;
  }

  #home p {
    font-size: 1em;
  }

  .cards {
    gap: 20px;
  }

  .card {
    padding: 25px 20px;
  }
}

@media (max-width: 480px) {
  #home h1 {
    font-size: 1.8em;
  }

  #home p {
    font-size: 0.95em;
  }

  .btn {
    padding: 10px 20px;
    font-size: 0.9em;
  }
}
