/* ========================================
   BASE STYLES
   ======================================== */
html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* ================================================= */
/*                 PRISM SPARK STYLES               */
/* ================================================= */

/* Language Sections */
.language-section {
  margin: 2rem 0;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.language-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 1rem;
  font-weight: bold;
  font-size: 1.1rem;
}

/* Code Containers */
.code-container {
  position: relative;
  background: #f8f9fa;
  max-height: 500px;
  overflow: auto;
}

.code-container pre {
  margin: 0;
  padding: 1rem;
  background: transparent;
  border: none;
}

.code-container code {
  font-family: "Courier New", Consolas, "Ubuntu Mono", monospace;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Live Editor Styles */
.live-editor-section {
  margin: 3rem 0;
  padding: 2rem;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
}

.editor-controls {
  margin-bottom: 1rem;
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.editor-controls select {
  width: auto;
  min-width: 150px;
}

#live-editor {
  font-family: "Courier New", Consolas, "Ubuntu Mono", monospace;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  resize: vertical;
}

.code-preview {
  background: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 1rem;
  margin-bottom: 1rem;
  min-height: 100px;
  max-height: 400px;
  overflow: auto;
}

.code-preview pre {
  margin: 0;
  background: transparent;
  border: none;
}

/* Validation Controls and Results */
.validation-controls {
  padding: 1rem;
  background: #f1f3f4;
  border-top: 1px solid #e0e0e0;
}

.validation-controls .btn {
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
}

.validation-result {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 4px;
  min-height: 50px;
}

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

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

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

/* Statistics Container */
.stats-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
  padding: 2rem;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  border-radius: 8px;
}

.stat-card {
  text-align: center;
  padding: 1.5rem;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.stat-number {
  font-size: 2rem;
  font-weight: bold;
  color: #667eea;
  margin-bottom: 0.5rem;
}

.stat-label {
  color: #666;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Syntax Highlighting Token Styles */
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
  color: #6a737d;
  font-style: italic;
}

.token.punctuation {
  color: #24292e;
}

.token.property,
.token.tag,
.token.constant,
.token.symbol,
.token.deleted {
  color: #d73a49;
}

.token.boolean,
.token.number {
  color: #005cc5;
}

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
  color: #032f62;
}

.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string,
.token.variable {
  color: #e36209;
}

.token.atrule,
.token.attr-value,
.token.function,
.token.class-name {
  color: #6f42c1;
}

.token.keyword {
  color: #d73a49;
  font-weight: bold;
}

.token.regex,
.token.important {
  color: #e90;
}

.token.important,
.token.bold {
  font-weight: bold;
}

.token.italic {
  font-style: italic;
}

.token.entity {
  cursor: help;
}

/* Loading Indicator */
.loading {
  position: relative;
  pointer-events: none;
}

.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #ccc;
  border-top-color: #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Modal Styles for Format Result */
.modal-xl {
  max-width: 90%;
}

#formatted-code-container {
  font-family: "Courier New", Consolas, "Ubuntu Mono", monospace;
  font-size: 0.85rem;
  line-height: 1.4;
}

.formatted-code-display {
  margin: 0;
  background: transparent !important;
  border: none !important;
  padding: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.formatted-code-display code {
  background: transparent !important;
  padding: 0;
  border: none;
  font-size: inherit;
  color: inherit;
}

/* Modal Button Animations */
.modal-footer .btn,
.modal-header .btn,
.modal-body .btn {
  transition: all 0.2s ease-in-out;
}

.modal-footer .btn:hover,
.modal-header .btn:hover,
.modal-body .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Badge Styling */
.modal-body .badge {
  font-size: 0.8rem;
  padding: 0.5rem 1rem;
}

/* Copy Button Success State */
.btn.btn-success {
  transition: all 0.3s ease;
}
