:root {
  --bg-color: #121212;
  --card-color: #1e1e1e;
  --text-color: #fff;
  --primary: #e53935;
  --secondary: #3f51b5;
  --input-bg: #2c2c2c;
}
body.light {
  --bg-color: #f3f3f3;
  --card-color: #ffffff;
  --text-color: #222;
  --input-bg: #f5f5f5;
}
body {
  margin: 0;
  font-family: 'Alexandria', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: background 0.4s, color 0.4s;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.container {
  max-width: 480px;
  margin: 25px auto 40px;
  background: var(--card-color);
  padding: 25px 20px;
  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.4);
  box-sizing: border-box;
}
h2 {
  text-align: center;
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 22px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  user-select: none;
}
h2 i {
  font-size: 26px;
  color: var(--primary);
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}
input, select, button {
  width: 100%;
  height: 48px;
  padding: 0 15px;
  margin: 10px 0;
  border: none;
  border-radius: 10px;
  font-size: 17px;
  font-family: 'Alexandria', sans-serif;
  background-color: var(--input-bg);
  color: var(--text-color);
  transition: background-color 0.3s ease, color 0.3s ease;
  box-sizing: border-box;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  user-select: text;
}
input::placeholder {
  color: #999;
}
select {
  cursor: pointer;
  background-image:
    url("data:image/svg+xml;charset=US-ASCII,%3Csvg width='14' height='8' viewBox='0 0 14 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L7 7L13 1' stroke='%23999' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
  background-size: 14px 8px;
}
button {
  background-color: var(--primary);
  color: white;
  font-weight: bold;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.25s ease;
}
button:hover, button:focus {
  background-color: #c62828;
  outline: none;
}
#searchBtn {
  background-color: var(--secondary);
}
#searchBtn:hover, #searchBtn:focus {
  background-color: #2c387e;
}
.result {
  background-color: var(--input-bg);
  padding: 14px;
  border-radius: 10px;
  margin-top: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  font-size: 16px;
  user-select: text;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.result div.phone {
  flex-grow: 1;
  font-weight: 600;
  direction: ltr;
  user-select: text;
}
.result div.location {
  flex-grow: 1;
  color: #aaa;
  font-size: 14px;
  margin-left: 12px;
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  direction: rtl;
  text-align: right;
}
.result a {
  text-decoration: none;
  color: var(--primary);
  font-size: 24px;
  margin-left: 15px;
  flex-shrink: 0;
  transition: color 0.3s ease;
  user-select: none;
  width: 38px;
  height: 38px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  border: 2px solid var(--primary);
  background-color: transparent;
}
.result a:hover,
.result a:focus {
  color: #b71c1c;
  border-color: #b71c1c;
  outline: none;
  background-color: rgba(183,28,28,0.1);
}
.status {
  text-align: center;
  margin-top: 12px;
  font-weight: bold;
  color: #ffcdd2;
  user-select: none;
}
.loader {
  border: 4px solid #eee;
  border-top: 4px solid var(--primary);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  animation: spin 1s linear infinite;
  margin: 15px auto;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.theme-toggle {
  position: fixed;
  top: 15px;
  left: 15px;
  width: 42px;
  height: 42px;
  background: var(--card-color);
  border: 2px solid var(--primary);
  border-radius: 50%;
  box-shadow: 0 3px 6px rgba(0,0,0,0.3);
  color: var(--primary);
  font-size: 22px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
  z-index: 1000;
}
.theme-toggle:hover,
.theme-toggle:focus {
  background-color: var(--primary);
  color: var(--card-color);
  border-color: var(--primary);
  outline: none;
}
.theme-toggle i {
  pointer-events: none;
  user-select: none;
}
hr {
  border: none;
  border-top: 1px solid #444;
  margin: 30px 0 20px;
  user-select: none;
}
footer {
  text-align: center;
  margin: 20px 0;
  color: var(--text-color);
  font-size: 14px;
  font-family: 'Alexandria', sans-serif;
  user-select: none;
}
@media (max-width: 480px) {
  .container {
    margin: 15px 10px 40px;
    padding: 20px 15px;
  }
  input, select, button {
    font-size: 16px;
    height: 46px;
  }
  .theme-toggle {
    width: 38px;
    height: 38px;
    font-size: 20px;
    top: 10px;
    left: 10px;
  }
}
