/* ===== Root Variables ===== */
:root {
  --background-color: #128C7E;          /* WhatsApp green */
  --text-color: #000;                   /* black text on white cards */
  --card-bg: #ffffff;
  --border-color: #ccc;
  --input-bg: #ffffff;
  --input-border: #ccc;
  --button-bg: #25D366;                 /* WhatsApp light green */
  --button-text: #fff;
  --button-hover-bg: #20bd5a;
  --toast-bg: #25D366;
  --toast-text: #fff;
  --link-color: #128C7E;
}

/* ===== Base Layout ===== */
body {
  background-color: var(--background-color);
  color: var(--text-color);
  font-family: 'Source Sans Pro', sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  margin: 0;
  line-height: 1.6;
  transition: background-color 0.3s, color 0.3s;
}

.container {
  background-color: var(--card-bg);
  padding: 30px 20px;
  border-radius: 14px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  max-width: 400px;
  width: 90%;
  margin: auto;
}

/* ===== Inputs ===== */
.input-group {
  margin-bottom: 20px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
  color: var(--text-color);
}

input[type="tel"],
select {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--input-border);
  border-radius: 5px;
  font-size: 1em;
  background-color: var(--input-bg);
  color: var(--text-color);
  font-family: 'Source Sans Pro', sans-serif;
  box-sizing: border-box;
  transition: border-color 0.3s, background-color 0.3s, color 0.3s;
}

input[type="tel"]:focus,
select:focus {
  outline: none;
  border-color: var(--button-bg);
  box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

select option {
  color: #000;
  background-color: #fff;
}

/* ===== Output (WhatsApp Link) ===== */
#resultArea {
  padding: 20px;
  text-align: center;
  transition: background-color 0.3s, border-color 0.3s;
}

#resultArea.hidden {
  display: none;
}

#generatedLink {
  display: block;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--input-border);
  border-radius: 5px;
  font-size: 1em;
  background-color: var(--input-bg);
  color: var(--link-color);
  text-align: center;
  text-decoration: none;
  box-sizing: border-box;
  margin-bottom: 15px;
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  transition: border-color 0.3s, background-color 0.3s, color 0.3s;
}

#generatedLink:hover {
  border-color: var(--button-bg);
  box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

#countryInfo {
  display: block;
  margin-top: -5px;
  margin-bottom: 15px;
  font-size: 0.9em;
  color: #666;
}

/* ===== Button ===== */
#copyLinkBtn {
  background-color: var(--button-bg);
  color: var(--button-text);
  padding: 12px 25px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1.1em;
  width: 100%;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  transition: background-color 0.2s ease, transform 0.1s ease;
}

#copyLinkBtn:hover {
  background-color: var(--button-hover-bg);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#copyLinkBtn:active {
  transform: translateY(0);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* ===== Toast ===== */
.toast {
  visibility: hidden;
  min-width: 250px;
  background-color: var(--toast-bg);
  color: var(--toast-text);
  text-align: center;
  border-radius: 5px;
  padding: 16px;
  position: fixed;
  z-index: 1;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transition: visibility 0s, opacity 0.5s ease-in-out;
}

.toast.show {
  visibility: visible;
  opacity: 1;
}

.toast.error {
  background-color: #e74c3c;
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
  .container {
    margin: 20px;
    padding: 20px;
  }
}

/* Input/Select field loses focus = light gray */
input[type="tel"],
select {
  background-color: #f3f3f3; /* light gray when not focused */
}

/* Input/Select field focused = default white */
input[type="tel"]:focus,
select:focus {
  background-color: #ffffff; /* pure white when focused */
}

input[type="tel"],
select {
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

/* --- Language Switcher Styles --- */
#languageSwitcher {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 10px; /* Add some padding below the switcher */
    border-bottom: 1px solid #eee; /* Optional: a subtle separator line */
}

#languageSwitcher a {
    text-decoration: none;
    color: #666; /* Default color for inactive links */
    font-weight: normal; /* Default font weight */
    padding: 5px 10px; /* Add padding for better click area and spacing */
    transition: color 0.2s ease, font-weight 0.2s ease;
}

#languageSwitcher a:hover {
    color: #333; /* Slightly darker on hover for inactive */
}

#languageSwitcher span {
    color: #ccc; /* Color for the separator */
    margin: 0 5px; /* Space around the separator */
}

/* Styles for the active language link */
#languageSwitcher a.active-lang {
    color: #128C7E; /* The "active" color from your original inline style */
    font-weight: bold; /* The "active" font weight from your original inline style */
    /* You can add more styles here for active state, e.g., border-bottom */
    border-bottom: 2px solid #128C7E;
}

#languageSwitcher a.active-lang:hover {
    color: #128C7E; /* Keep active color on hover */
}

/* Responsive adjustments */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 20px;
        border-radius: 8px;
    }

    h1 {
        font-size: 1.5em;
        margin-bottom: 20px;
    }

    .btn {
        font-size: 1em;
        padding: 10px 15px;
    }
}