/* SQL Practice Platform - Main Stylesheet */

/* Main Application Styles */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background-color: #f8f9fa;
}

/* Header Styles */
.container-fluid {
  max-width: 1400px;
}

.sql-editor-container {
  max-width: 1200px;
  margin: 0 auto;
}

/* Question and Editor Styles */
.card {
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  border: 1px solid rgba(0, 0, 0, 0.125);
}

.card-header {
  background-color: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.125);
}

#editor {
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
  min-height: 150px;
}

#editor:focus {
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Results Panel Styles */
#results {
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 12px;
  overflow: auto;
  max-height: 500px;
  background-color: #fff;
}

#results table {
  width: 100%;
  margin-bottom: 0;
}

#results table th {
  background-color: #e9ecef;
  font-weight: 600;
  border-bottom: 2px solid #dee2e6;
  padding: 8px 12px;
  text-align: left;
}

#results table td {
  padding: 6px 12px;
  border-bottom: 1px solid #dee2e6;
  vertical-align: top;
}

#results table tbody tr:nth-child(even) {
  background-color: #f8f9fa;
}

#results table tbody tr:hover {
  background-color: #e9ecef;
}

/* Hint and Explanation Styles */
.hint-box {
  background-color: #fff3cd;
  border: 1px solid #ffeaa7;
  border-radius: 0.375rem;
  padding: 15px;
  margin-top: 15px;
}

.hint-box h6 {
  color: #856404;
  margin-bottom: 10px;
}

.hint-box p {
  color: #856404;
  margin-bottom: 0;
}

.explanation-box {
  background-color: #d1ecf1;
  border: 1px solid #bee5eb;
  border-radius: 0.375rem;
  padding: 15px;
  margin-top: 15px;
}

.explanation-box h6 {
  color: #0c5460;
  margin-bottom: 10px;
}

.explanation-box p, .explanation-box code {
  color: #0c5460;
}

.explanation-box code {
  background-color: rgba(255, 255, 255, 0.5);
  padding: 2px 4px;
  border-radius: 3px;
}

/* Button Styles */
.btn {
  font-weight: 500;
}

.btn-primary {
  background-color: #0d6efd;
  border-color: #0d6efd;
}

.btn-primary:hover {
  background-color: #0b5ed7;
  border-color: #0a58ca;
}

/* Alert Styles */
.alert-success {
  background-color: #d1edcc;
  border-color: #badbcc;
  color: #0f5132;
}

.alert-danger {
  background-color: #f8d7da;
  border-color: #f5c2c7;
  color: #842029;
}

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

/* Error Message Styles */
.error-message {
  background-color: #f8d7da;
  color: #721c24;
  padding: 12px;
  border-radius: 0.375rem;
  border: 1px solid #f1aeb5;
  margin: 10px 0;
}

.error-message pre {
  background-color: rgba(255, 255, 255, 0.5);
  padding: 8px;
  border-radius: 3px;
  font-size: 12px;
  margin-top: 8px;
  margin-bottom: 0;
  overflow-x: auto;
}

/* Success Message Styles */
.success-message {
  background-color: #d1edcc;
  color: #0f5132;
  padding: 12px;
  border-radius: 0.375rem;
  border: 1px solid #badbcc;
  margin: 10px 0;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container-fluid {
    padding: 15px;
  }
  
  #editor {
    font-size: 12px;
  }
  
  #results {
    font-size: 11px;
  }
  
  #results table th,
  #results table td {
    padding: 4px 8px;
  }
  
  .btn {
    font-size: 14px;
    padding: 0.5rem 0.75rem;
  }
  
  .d-flex.gap-2 {
    flex-direction: column;
  }
  
  .d-flex.gap-2 .btn {
    width: 100%;
    margin-bottom: 0.5rem;
  }
}

/* Print styles */
@media print {
  .btn, .card-header {
    display: none !important;
  }
  
  .card {
    box-shadow: none;
    border: 1px solid #000;
  }
  
  #results {
    border: 1px solid #000;
  }
}

.query-results {
  max-height: 400px;
  overflow-y: auto;
}

.hint-box {
  border-left: 4px solid #0d6efd;
  background-color: #f8f9fa;
  padding: 15px;
  margin-top: 15px;
}

.loading-spinner {
  text-align: center;
  padding: 20px;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .sql-editor-container {
    padding: 10px;
  }
}

/* Embedded view fix - maintain desktop layout in Shopify iframe */
.embedded-view .row {
  display: flex !important; 
}

.embedded-view .col-lg-6 {
  width: 50% !important;
  max-width: 50% !important;
  flex: 0 0 50% !important;
}

.embedded-view .d-flex.gap-2 {
  flex-direction: row !important;
}

.embedded-view .d-flex.gap-2 .btn {
  width: auto !important;
  margin-bottom: 0 !important;
}
