/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f8f9fa;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.header {
  background: linear-gradient(135deg, #000091, #1e3a8a);
  color: white;
  padding: 2rem 0;
  text-align: center;
}

.header h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.header p {
  font-size: 1.2rem;
  opacity: 0.9;
}

/* Main Content */
.main {
  padding: 2rem 0;
  min-height: 60vh;
}

.dashboard {
  background: white;
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.dashboard h2 {
  color: #000091;
  margin-bottom: 2rem;
  font-size: 2rem;
}

.dashboard h3 {
  color: #333;
  margin-bottom: 1rem;
  font-size: 1.5rem;
  border-bottom: 2px solid #e9ecef;
  padding-bottom: 0.5rem;
}

/* Sections */
.config-section,
.token-section,
.actions-section,
.instructions-section {
  margin-bottom: 2rem;
}

.config-item {
  margin-bottom: 0.5rem;
  padding: 0.5rem;
  background: #f8f9fa;
  border-radius: 4px;
}

/* Status Badges */
.status-badge {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: bold;
  margin-bottom: 1rem;
}

.status-success {
  background: #d4edda;
  color: #155724;
}

.status-error {
  background: #f8d7da;
  color: #721c24;
}

.status-valid {
  color: #155724;
  font-weight: bold;
}

.status-expired {
  color: #721c24;
  font-weight: bold;
}

/* Token Info */
.token-info {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 1.5rem;
  border: 1px solid #e9ecef;
}

.token-details {
  margin-top: 1rem;
}

.token-field {
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.token-field strong {
  min-width: 120px;
  color: #555;
}

.token-display {
  background: #2d3748;
  color: #e2e8f0;
  padding: 0.5rem;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
}

.btn-primary {
  background: #007bff;
  color: white;
}

.btn-primary:hover {
  background: #0056b3;
}

.btn-success {
  background: #28a745;
  color: white;
}

.btn-success:hover {
  background: #1e7e34;
}

.btn-danger {
  background: #dc3545;
  color: white;
}

.btn-danger:hover {
  background: #c82333;
}

.inline-form {
  display: inline-block;
}

/* Alerts */
.alert {
  padding: 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.alert-error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.alert-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.alert-info {
  background: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

.config-link {
  color: #007bff;
  text-decoration: none;
  font-weight: bold;
}

.config-link:hover {
  text-decoration: underline;
}

/* Instructions */
.instructions-section ol {
  margin-left: 2rem;
}

.instructions-section li {
  margin-bottom: 0.5rem;
}

.instructions-section code {
  background: #f8f9fa;
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
}

/* Footer */
.footer {
  background: #343a40;
  color: white;
  text-align: center;
  padding: 1rem 0;
  margin-top: 2rem;
}

/* Market Form */
.market-form-section {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 1.5rem;
  border: 1px solid #e9ecef;
  margin-bottom: 1rem;
}

.market-form-section h4 {
  color: #333;
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.market-form .form-group {
  margin-bottom: 1rem;
}

.market-form label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: #555;
}

.market-form .required {
  color: #dc3545;
}

.market-form input,
.market-form select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 1rem;
  transition: border-color 0.2s;
}

.market-form input:focus,
.market-form select:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.market-form input::placeholder {
  color: #6c757d;
}

/* Markets section */
.markets-section {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 1.5rem;
  border: 1px solid #e9ecef;
  margin-bottom: 2rem;
}

.markets-list {
  margin-top: 15px;
}

.market-card {
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 15px;
  margin-bottom: 15px;
}

.market-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

.market-header h4 {
  margin: 0;
  color: #343a40;
  font-size: 1.1rem;
}

.market-status {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
}

.market-status-created {
  background-color: #fff3cd;
  color: #856404;
}

.market-status-completed {
  background-color: #d1edff;
  color: #0c5460;
}

.market-details {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.market-field {
  font-size: 14px;
}

.market-field code {
  background-color: #e9ecef;
  padding: 2px 4px;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
}

/* Responsive */
@media (max-width: 768px) {
  .header h1 {
    font-size: 2rem;
  }
  
  .header p {
    font-size: 1rem;
  }
  
  .dashboard {
    padding: 1rem;
  }
  
  .token-field {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .token-field strong {
    min-width: auto;
  }
  
  .market-form-section {
    padding: 1rem;
  }
}

/* Market Actions */
.market-actions {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #e9ecef;
  background-color: #f8f9fa;
  padding: 15px;
  border-radius: 4px;
}

.market-actions h5 {
  margin: 0 0 10px 0;
  color: #495057;
  font-size: 14px;
  font-weight: 600;
}

.application-form {
  margin: 0;
}

.form-group-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.form-group-inline label {
  font-size: 14px;
  font-weight: 500;
  color: #495057;
  margin: 0;
  white-space: nowrap;
}

.form-group-inline input[type="text"] {
  padding: 6px 10px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 14px;
  font-family: 'Courier New', monospace;
  min-width: 150px;
}

.form-group-inline input[type="text"]:focus {
  outline: none;
  border-color: #80bdff;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

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

.btn-info {
  background-color: #17a2b8;
  border-color: #17a2b8;
}

.btn-info:hover {
  background-color: #138496;
  border-color: #117a8b;
}

@media (max-width: 768px) {
  .form-group-inline {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .form-group-inline input[type="text"] {
    width: 100%;
    min-width: auto;
  }
}