:root {
  --navy: #00263e;
  --navy-soft: #003552;
  --teal: #00c4b3;
  --teal-dark: #00a89a;
  --purple: #410099;
  --purple-dark: #330080;
  --red: #f5333f;
  --yellow: #eba900;
  --light-gray: #f0fffe;
  --text-dark: #00161f;
  --text-light: #fff;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Arabic Typesetting', sans-serif;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-soft) 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  color: var(--text-dark);
}

/* RTL Support for Arabic */
html[lang="ar"] {
  direction: rtl;
  text-align: right;
}

html[lang="ar"] .info-box {
  border-left: none;
  border-right: 4px solid #3498db;
}

html[lang="ar"] .message.success {
  border-left: none;
  border-right: 4px solid #28a745;
}

html[lang="ar"] .message.error {
  border-left: none;
  border-right: 4px solid #f5222d;
}

html[lang="ar"] .form-group label {
  text-align: right;
}

html[lang="ar"] .amount-presets {
  direction: ltr;
}

html[lang="en"] {
  direction: ltr;
  text-align: left;
}

/* Language Toggle */
.language-toggle-center {
  text-align: center;
  padding: 15px 30px;
  border-top: 1px solid #e0e0e0;
  border-bottom: 1px solid #e0e0e0;
  background: rgba(240, 255, 254, 0.5);
}

.lang-btn {
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid var(--teal-dark);
  color: var(--navy);
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.lang-btn:hover {
  background: var(--teal-dark);
  color: var(--text-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 168, 154, 0.3);
}

.lang-btn .lang-text {
  display: block;
}

.container {
  width: 100%;
  max-width: 500px;
}

.donation-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.header {
  background: white;
  padding: 12px 20px;
  text-align: center;
  border-bottom: 1px solid #e0e0e0;
}

.header .logo {
  height: 60px;
  width: auto;
  max-width: 100%;
  margin: 8px 0;
  transition: all 300ms;
  animation: slideDown 0.6s ease-out;
}

.header h1 {
  font-size: 24px;
  margin: 8px 0 5px 0;
  font-weight: 700;
  color: var(--text-dark);
}

.header .subtitle {
  font-size: 13px;
  opacity: 0.85;
  line-height: 1.5;
  margin: 0;
  color: var(--text-dark);
}

.form {
  padding: 40px 30px;
}

.form-group {
  margin-bottom: 25px;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-dark);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 16px;
  transition: all 0.3s ease;
  font-family: inherit;
  color: var(--text-dark);
}

.form-group input:focus {
  outline: none;
  border-color: var(--teal-dark);
  box-shadow: 0 0 0 3px rgba(0, 168, 154, 0.1);
}

.form-group input::placeholder {
  color: #999;
}

.amount-presets {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 15px;
}

.amount-presets .preset {
  padding: 12px;
  border: 2px solid #e0e0e0;
  background: white;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-dark);
  transition: all 0.3s ease;
  font-size: 14px;
}

.amount-presets .preset:hover {
  border-color: var(--teal-dark);
  background: var(--light-gray);
  color: var(--navy);
}

.amount-presets .preset.active {
  background: var(--teal-dark);
  color: var(--text-light);
  border-color: var(--teal-dark);
}

.error {
  display: block;
  color: var(--red);
  font-size: 12px;
  margin-top: 5px;
  min-height: 18px;
}

.donate-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--purple) 0%, var(--purple-dark) 100%);
  color: var(--text-light);
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

.donate-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(65, 0, 153, 0.3);
  background: linear-gradient(135deg, var(--teal-dark) 0%, var(--teal) 100%);
}

.donate-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.loader {
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid white;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  animation: spin 1s linear infinite;
}

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

.info-box {
  background: var(--light-gray);
  padding: 15px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-dark);
  line-height: 1.6;
  border-left: 4px solid var(--teal-dark);
}

.info-box-content {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.dubaipay-logo {
  height: 130px;
  width: auto;
  max-width: 180px;
  flex-shrink: 0;
  margin-top: 0;
}

.info-box-text {
  flex: 1;
}

.info-box-text p {
  margin: 0 0 8px 0;
}

.info-box-text p:last-child {
  margin-bottom: 0;
}

.info-flow {
  font-size: 12px;
  color: var(--navy-soft);
  font-weight: 500;
}

.message {
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  display: none;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message h3 {
  margin-bottom: 10px;
  font-size: 16px;
}

.message p {
  font-size: 14px;
  line-height: 1.6;
}

.message.success {
  background: rgba(0, 196, 179, 0.1);
  color: var(--navy);
  border-left: 4px solid var(--teal);
}

.message.error {
  background: rgba(245, 51, 63, 0.1);
  color: var(--red);
  border-left: 4px solid var(--red);
}

.footer {
  text-align: center;
  padding: 20px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
}

.footer p {
  margin: 5px 0;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
  animation: pulse 2s infinite;
  margin: 0 5px;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Responsive */
@media (max-width: 600px) {
  .header {
    padding: 10px 15px;
  }

  .header .logo {
    height: 50px;
    margin: 6px 0;
  }

  .header h1 {
    font-size: 20px;
    margin: 6px 0 4px 0;
  }

  .header .subtitle {
    font-size: 12px;
  }

  .form {
    padding: 30px 20px;
  }

  .amount-presets {
    grid-template-columns: repeat(2, 1fr);
  }

  .donate-btn {
    padding: 12px;
    font-size: 14px;
  }

  .language-toggle-center {
    padding: 12px 20px;
  }

  .lang-btn {
    padding: 8px 16px;
    font-size: 12px;
  }

  .info-box-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .dubaipay-logo {
    height: 100px;
    margin-top: 0;
  }

  .info-box-text p {
    font-size: 12px;
  }

  .info-flow {
    font-size: 11px;
  }
}
