/*
 * Public Stylesheet for Exchange Plugin
 *
 * This file contains styles for the frontend exchange form and status tracker,
 * ensuring a clean, modern, and responsive user interface.
 *
 * @package Exchange_Plugin
 * @subpackage Assets/CSS
 */

/* Google Font: Inter (for modern UI) */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap");

body {
  font-family: "Inter", sans-serif;
  color: #333;
  line-height: 1.6;
}

/* --- General Form Elements Styling --- */

.exchange-plugin-form-wrap,
.exchange-plugin-status-wrap {
  background-color: #ffffff;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  max-width: 600px;
  margin: 30px auto;
  font-family: "Inter", sans-serif;
  color: #333;
}

.exchange-form-title,
.status-tracker-title {
  text-align: center;
  color: #2c3e50;
  margin-bottom: 10px;
  font-size: 2em;
  font-weight: 700;
}

.exchange-form-description,
.status-tracker-description {
  text-align: center;
  color: #7f8c8d;
  margin-bottom: 25px;
  font-size: 0.95em;
  line-height: 1.5;
}

/* Messages (success/error) */
#ep-messages,
#ep-status-messages {
  padding: 10px 20px;
  margin-bottom: 20px;
  border-radius: 8px;
  font-weight: 500;
  text-align: center;
  display: none; /* Controlled by JS */
}

#ep-messages.ep-success,
#ep-status-messages.ep-success {
  background-color: #e6ffe6;
  color: #27ae60;
  border: 1px solid #27ae60;
}

#ep-messages.ep-error,
#ep-status-messages.ep-error {
  background-color: #ffe6e6;
  color: #e74c3c;
  border: 1px solid #e74c3c;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #555;
}

.form-group select,
.form-group input[type="number"],
.form-group input[type="text"],
.form-group input[type="email"],
.form-group textarea {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #dcdcdc;
  border-radius: 6px;
  font-size: 1em;
  box-sizing: border-box; /* Include padding and border in the element's total width and height */
  transition: border-color 0.2s ease-in-out;
}

.form-group select:focus,
.form-group input[type="number"]:focus,
.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group textarea:focus {
  border-color: #3498db;
  outline: none;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.currency-label {
  margin-left: 5px;
  font-weight: 600;
  color: #666;
}

.exchange-limits,
.exchange-rate-display {
  font-size: 0.9em;
  color: #888;
  margin-top: 5px;
}

.estimated-amount {
  font-size: 1.8em;
  font-weight: 700;
  color: #27ae60;
  margin-top: 5px;
}

.gateway-info {
  background-color: #f8f8f8;
  border: 1px solid #eee;
  border-radius: 6px;
  padding: 15px;
  margin-top: 15px;
  font-size: 0.9em;
  color: #666;
}

.gateway-info p {
  margin-bottom: 5px;
}

.guest-info-section,
.user-info-section {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px dashed #eee;
}

.guest-info-section h3,
.user-info-section h3 {
  color: #2c3e50;
  margin-bottom: 15px;
  font-size: 1.4em;
}

.user-info-section p {
  font-size: 0.95em;
  color: #666;
}

.ep-phone-input-group {
  display: flex;
  align-items: center;
  gap: 5px;
}

.ep-country-code {
  background-color: #f2f2f2;
  padding: 12px 10px;
  border: 1px solid #dcdcdc;
  border-radius: 6px;
  font-size: 1em;
  color: #555;
  white-space: nowrap;
  cursor: default;
}

.submit-button {
  background-color: #3498db;
  color: #fff;
  padding: 15px 25px;
  border: none;
  border-radius: 8px;
  font-size: 1.1em;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.1s ease;
  width: 100%;
  margin-top: 30px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.submit-button:hover {
  background-color: #2980b9;
  transform: translateY(-2px);
}

.submit-button:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
  box-shadow: none;
}

/* --- Transaction Details Card (Status Tracker) --- */
.transaction-details-card {
  background-color: #fefefe;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 25px;
  margin-top: 30px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.transaction-details-card h3 {
  text-align: center;
  color: #2c3e50;
  margin-bottom: 20px;
  font-size: 1.6em;
}

.transaction-details-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

.transaction-details-table th,
.transaction-details-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.transaction-details-table th {
  background-color: #f9f9f9;
  font-weight: 600;
  color: #555;
  width: 40%; /* Adjust column width */
}

.transaction-details-table td {
  color: #333;
  word-break: break-all; /* For long keys */
}

.transaction-details-table tr:last-child th,
.transaction-details-table tr:last-child td {
  border-bottom: none;
}

/* --- Status Badges (Re-used from Admin) --- */
.ep-status-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: bold;
  color: #fff;
  font-size: 0.9em;
  text-transform: capitalize; /* Ensure first letter is capitalized */
}

.ep-status-pending {
  background-color: #ffb300; /* Amber */
}

.ep-status-completed {
  background-color: #4caf50; /* Green */
}

.ep-status-rejected {
  background-color: #f44336; /* Red */
}

.transaction-key-full-display {
  text-align: center;
}

.transaction-key-full-display code {
  background-color: #ecf0f1;
  padding: 8px 12px;
  border-radius: 4px;
  font-family: monospace;
  color: #34495e;
  word-break: break-all;
  display: inline-block;
  margin-top: 10px;
}

.ep-copy-key-button {
  margin-top: 15px;
  padding: 8px 15px;
  font-size: 0.9em;
  border-radius: 6px;
  background-color: #95a5a6;
  color: white;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.ep-copy-key-button:hover {
  background-color: #7f8c8d;
}

/* --- Custom Modal Styles (Consistent across Frontend and Admin) --- */
.ep-modal {
  display: none; /* Hidden by default */
  position: fixed; /* Stay in place */
  z-index: 100000; /* Sit on top */
  left: 0;
  top: 0;
  width: 100%; /* Full width */
  height: 100%; /* Full height */
  overflow: auto; /* Enable scroll if needed */
  background-color: rgba(0, 0, 0, 0.4); /* Black w/ opacity */
  justify-content: center; /* Center horizontally */
  align-items: center; /* Center vertically */
  display: flex; /* Use flexbox to center content */
}

.ep-modal-content {
  background-color: #fefefe;
  padding: 30px;
  border: 1px solid #ddd;
  width: 90%; /* Responsive width */
  max-width: 500px; /* Max width for desktop */
  border-radius: 10px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
  position: relative;
  text-align: center;
}

.ep-modal-close-button {
  color: #aaa;
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 32px;
  font-weight: bold;
  cursor: pointer;
}

.ep-modal-close-button:hover,
.ep-modal-close-button:focus {
  color: #555;
}

#ep-modal-title {
  color: #2c3e50;
  font-size: 1.8em;
  margin-bottom: 10px;
}

#ep-modal-message {
  font-size: 1.1em;
  color: #666;
  margin-bottom: 20px;
}

#ep-modal-transaction-key {
  background-color: #ecf0f1;
  padding: 10px 15px;
  border-radius: 6px;
  font-family: monospace;
  color: #34495e;
  word-break: break-all;
  margin-top: 15px; /* Added spacing */
  margin-bottom: 20px;
}

#ep-modal-ok-button,
.ep-modal-copy-button {
  padding: 12px 20px;
  margin: 5px;
  border: none;
  border-radius: 6px;
  font-size: 1em;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

#ep-modal-ok-button {
  background-color: #3498db;
  color: white;
}

#ep-modal-ok-button:hover {
  background-color: #2980b9;
}

.ep-modal-copy-button {
  background-color: #95a5a6;
  color: white;
}

.ep-modal-copy-button:hover {
  background-color: #7f8c8d;
}

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
  .exchange-plugin-form-wrap,
  .exchange-plugin-status-wrap {
    margin: 20px;
    padding: 20px;
  }
  .form-group select,
  .form-group input,
  .form-group textarea {
    font-size: 0.95em;
    padding: 10px;
  }
  .submit-button {
    font-size: 1em;
    padding: 12px 20px;
  }
  .ep-modal-content {
    margin: 5% auto;
    width: 95%;
    padding: 20px;
  }
  #ep-modal-title {
    font-size: 1.5em;
  }
  #ep-modal-message {
    font-size: 0.95em;
  }
  .transaction-details-table th,
  .transaction-details-table td {
    display: block;
    width: 100%;
    padding: 8px 12px;
    box-sizing: border-box;
  }
  .transaction-details-table th {
    text-align: left;
    background-color: #f0f0f0;
    border-bottom: none;
    padding-bottom: 0;
  }
  .transaction-details-table td {
    padding-top: 5px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
  }
  .transaction-details-table tr:last-child td {
    border-bottom: none;
  }
  .status-tracker-form input[type="text"] {
    width: 100%; /* Full width on small screens */
  }
}
