/* ====================================
   Cashfree Payment Gateway Styles
   ==================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #1f2937;
  --secondary-color: #3b82f6;
  --success-color: #10b981;
  --error-color: #ef4444;
  --warning-color: #f59e0b;
  --bg-light: #f9fafb;
  --border-color: #e5e7eb;
  --text-dark: #1f2937;
  --text-light: #6b7280;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: var(--text-dark);
  line-height: 1.6;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
}

/* Header */
header {
  text-align: center;
  color: white;
  margin-bottom: 40px;
  padding: 30px 0;
}

header h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
  font-size: 1.1rem;
  opacity: 0.9;
}

/* Environment Switcher */
.environment-switcher {
  display: flex;
  gap: 15px;
  justify-content: center;
  align-items: center;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.env-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.3s ease;
  background: white;
  color: var(--text-dark);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.env-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.env-btn.active {
  background: var(--secondary-color);
  color: white;
  box-shadow: 0 8px 16px rgba(59, 130, 246, 0.3);
}

.env-status {
  background: white;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  color: var(--primary-color);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Main Content */
main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-bottom: 40px;
}

@media (max-width: 768px) {
  main {
    grid-template-columns: 1fr;
  }
}

/* Sections */
.payment-section,
.info-section {
  background: white;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

section h2 {
  font-size: 1.5rem;
  margin-bottom: 25px;
  color: var(--primary-color);
  border-bottom: 3px solid var(--secondary-color);
  padding-bottom: 15px;
}

/* Form Styles */
.payment-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-weight: 600;
  color: var(--text-dark);
  font-size: 0.95rem;
}

.form-group input {
  padding: 12px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.3s ease;
  font-family: inherit;
}

.form-group input:focus {
  outline: none;
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group input:invalid:not(:placeholder-shown) {
  border-color: var(--error-color);
}

/* Button */
.btn-submit {
  padding: 14px 30px;
  background: linear-gradient(135deg, var(--secondary-color), #667eea);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
}

.btn-submit:active {
  transform: translateY(0);
}

.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Info Section */
.credentials {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 768px) {
  .credentials {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--bg-light);
  padding: 20px;
  border-radius: 8px;
  border-left: 4px solid var(--secondary-color);
}

.card h3 {
  font-size: 1.1rem;
  margin-bottom: 15px;
  color: var(--primary-color);
}

.card ul {
  list-style: none;
}

.card li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.95rem;
}

.card li:last-child {
  border-bottom: none;
}

.card strong {
  color: var(--primary-color);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background-color: white;
  margin: 5% auto;
  padding: 30px;
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-content h3 {
  margin-bottom: 20px;
  color: var(--primary-color);
  font-size: 1.3rem;
}

.modal-close {
  color: var(--text-light);
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.3s ease;
}

.modal-close:hover {
  color: var(--text-dark);
}

#responseContent {
  background: var(--bg-light);
  padding: 15px;
  border-radius: 8px;
  border-left: 4px solid var(--secondary-color);
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 20px;
  max-height: 300px;
  overflow-y: auto;
}

.btn-close {
  padding: 10px 20px;
  background: var(--secondary-color);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  width: 100%;
}

.btn-close:hover {
  background: #2563eb;
}

/* Loading Overlay */
.loading-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: 20px;
}

.loading-overlay p {
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
}

.spinner {
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid white;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Toast Notifications */
.toast {
  position: fixed;
  bottom: -100px;
  left: 50%;
  transform: translateX(-50%);
  padding: 15px 25px;
  border-radius: 8px;
  font-weight: 600;
  z-index: 3000;
  transition: all 0.3s ease;
  max-width: 400px;
}

.toast.show {
  bottom: 30px;
}

.toast-success {
  background: var(--success-color);
  color: white;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.toast-error {
  background: var(--error-color);
  color: white;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.toast-info {
  background: var(--secondary-color);
  color: white;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.toast-warning {
  background: var(--warning-color);
  color: white;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

/* Responsive Design */
@media (max-width: 640px) {
  .container {
    padding: 15px;
  }

  header h1 {
    font-size: 1.8rem;
  }

  .subtitle {
    font-size: 0.95rem;
  }

  .modal-content {
    width: 95%;
    margin: 50% auto;
    padding: 20px;
  }

  .credentials {
    grid-template-columns: 1fr;
  }
}
