/* Optimized Y2K Frutiger Aero styles - Performance Enhanced */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, #e8f5e8 0%, #f0f8ff 50%, #f0fff0 100%);
  background-attachment: fixed;
  font-size: 0.9rem;
}

/* Simplified texture overlay */
body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 30% 70%, rgba(144, 238, 144, 0.08) 0%, transparent 60%),
    radial-gradient(circle at 70% 30%, rgba(173, 216, 230, 0.08) 0%, transparent 60%);
  pointer-events: none;
  z-index: -1;
}

/* Kanit Font Classes */
.kanit-thin {
  font-family: "Kanit", sans-serif;
  font-weight: 100;
  font-style: normal;
}

/* Header Section - Simplified chrome effect */
.header-section {
  background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 50%, #ffffff 100%);
  color: #2c3e50;
  padding: 1.2rem 1.5rem;
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(200, 220, 255, 0.4);
  position: relative;
}

/* Enhanced ATLACATL title - taller and more prominent */
.app-title {
  font-size: 2.2rem;
  font-weight: 200;
  letter-spacing: 1px;
  margin: 0;
  background: linear-gradient(135deg, #4a90e2 0%, #357abd 50%, #2c5aa0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-family: "Kanit", sans-serif;
  line-height: 1.1;
}

.trademark {
  font-size: 0.8rem;
  vertical-align: super;
  opacity: 0.7;
}

/* Panel Box Styling - Simplified chrome */
.panel-box {
  background: linear-gradient(135deg, #ffffff 0%, #f8fbff 50%, #ffffff 100%);
  border-radius: 16px;
  padding: 1.4rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(173, 216, 230, 0.4);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  display: flex;
  flex-direction: column;
  position: relative;
}

.panel-box:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transform: translateY(-1px);
}

/* Section Titles - Simplified */
.section-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 1.2rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid rgba(74, 144, 226, 0.3);
}

/* Form Labels */
.label-style {
  font-weight: 500;
  color: #4a5568;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}

/* Input and Textarea Styling - Simplified chrome inset */
.input-style,
.textarea-style {
  font-size: 0.9rem;
  border: 1px solid rgba(173, 216, 230, 0.5);
  background: linear-gradient(135deg, #fafbff 0%, #ffffff 100%);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
  border-radius: 10px;
}

.input-style:focus,
.textarea-style:focus {
  border-color: rgba(74, 144, 226, 0.7);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06), 0 0 0 3px rgba(74, 144, 226, 0.15);
  background: #f8f8ff;
}

/* Card Body - Reduced height */
#domCardBody {
  max-height: 100px;
  resize: vertical;
  overflow-y: auto;
}

/* Web Console - Simplified terminal */
.web-console,
#domWebConsole {
  background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%) !important;
  color: #00ff88 !important;
  font-family: "Courier New", monospace;
  font-size: 0.8rem;
  border: 1px solid #404040 !important;
  height: 55px;
  max-height: 55px;
  resize: none;
  overflow-y: auto;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
  border-radius: 8px;
}

#domWebConsole:focus {
  border-color: #606060 !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4), 0 0 0 2px rgba(0, 255, 136, 0.3) !important;
}

/* Button Styling - Simplified Y2K chrome */
.button-style {
  background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 50%, #ffffff 100%) !important;
  border: 1px solid rgba(173, 216, 230, 0.5) !important;
  color: #2c3e50 !important;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-size: 0.85rem;
  padding: 0.7rem 1.2rem;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  border-radius: 10px;
  position: relative;
}

.button-style:hover {
  background: linear-gradient(135deg, #f0f8ff 0%, #e8f4ff 50%, #f0f8ff 100%) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  color: #2c3e50 !important;
}

.button-style:active {
  transform: translateY(0px);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2), inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Result Grid Display Area - Simplified */
.result-grid-display-area {
  background: linear-gradient(135deg, #f0fff0 0%, #f0f8ff 50%, #f0fff0 100%);
  border: 2px solid rgba(173, 216, 230, 0.4);
  border-radius: 12px;
  padding: 1.2rem;
  overflow-y: auto;
  overflow-x: hidden;
  font-family: "Courier New", monospace;
  font-size: 0.8rem;
  line-height: 1.4;
  height: 320px;
  max-height: 320px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.2rem;
  align-content: start;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.06);
}

.result-grid-display-area:empty::before {
  content: "Los resultados aparecerán aquí...";
  color: #6c757d;
  font-style: italic;
  grid-column: 1 / -1;
  text-align: center;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Dynamic Result Cards - Simplified chrome panels */
.result-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8fbff 50%, #ffffff 100%);
  border: 1px solid rgba(173, 216, 230, 0.4);
  border-radius: 12px;
  padding: 1.2rem;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: all 0.2s ease;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  position: relative;
}

.result-card:hover {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transform: translateY(-2px);
  border-color: rgba(144, 238, 144, 0.6);
}

.result-card-header {
  font-size: 0.75rem;
  color: #4a5568;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(173, 216, 230, 0.3);
  padding-bottom: 0.4rem;
}

.result-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: #2c3e50;
  line-height: 1.3;
}

.result-card-body {
  font-size: 0.85rem;
  color: #4a5568;
  line-height: 1.4;
  flex-grow: 1;
  overflow-wrap: break-word;
}

.result-card-date {
  font-size: 0.7rem;
  color: #718096;
  font-weight: 400;
  text-align: right;
  border-top: 1px solid rgba(173, 216, 230, 0.2);
  padding-top: 0.5rem;
  margin-top: 0.3rem;
  font-style: italic;
}

/* Footer Section - Simplified */
.footer-section {
  background: linear-gradient(135deg, #ffffff 0%, #f8fbff 50%, #ffffff 100%);
  border-radius: 16px;
  padding: 1.2rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(173, 216, 230, 0.4);
  position: relative;
}

.about-button {
  background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 50%, #ffffff 100%);
  border: 1px solid rgba(173, 216, 230, 0.5);
  color: #2c3e50;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-size: 0.85rem;
  padding: 0.7rem 1.8rem;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  border-radius: 10px;
  text-decoration: none;
  display: inline-block;
}

.about-button:hover {
  background: linear-gradient(135deg, #f0f8ff 0%, #e8f4ff 50%, #f0f8ff 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  color: #2c3e50;
  text-decoration: none;
}

.about-button:active {
  transform: translateY(0px);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2), inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Mobile Layout Adjustments */
@media (max-width: 767px) {
  .left-column {
    order: 2;
  }

  .right-column {
    order: 1;
  }

  .row.mb-2 {
    display: block !important;
  }

  .row.mb-2 .col-sm-3,
  .row.mb-2 .col-sm-9 {
    width: 100% !important;
    padding: 0 !important;
  }

  .col-form-label {
    padding-bottom: 0.3rem;
    padding-top: 0;
  }

  .button-group-style {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
  }

  .button-group-style .btn {
    width: 100%;
    margin: 0 !important;
  }

  /* Mobile title adjustment */
  .app-title {
    font-size: 1.8rem;
  }

  .panel-box {
    padding: 1.2rem;
  }

  .result-grid-display-area {
    grid-template-columns: 1fr !important;
    gap: 1rem;
    padding: 1rem;
    min-width: 0;
    height: 280px;
    max-height: 280px;
  }

  .result-card {
    padding: 1rem;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
  }

  .result-card-title {
    font-size: 0.9rem;
  }

  .result-card-body {
    font-size: 0.8rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .result-card-date {
    font-size: 0.65rem;
    text-align: center;
  }

  .footer-section {
    padding: 1rem;
  }

  .about-button {
    font-size: 0.8rem;
    padding: 0.6rem 1.4rem;
  }

  /* Disable hover effects on mobile for better performance */
  .panel-box:hover,
  .result-card:hover,
  .button-style:hover,
  .about-button:hover {
    transform: none;
  }
}

/* Desktop optimizations */
@media (min-width: 768px) {
  .result-grid-display-area {
    height: 420px;
    max-height: 420px;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }

  .result-grid-section {
    min-height: 520px;
  }
}

/* Large desktop - more columns */
@media (min-width: 1200px) {
  .result-grid-display-area {
    height: 460px;
    max-height: 460px;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
}

/* Simplified Scrollbar Styling */
.textarea-style::-webkit-scrollbar,
.result-grid-display-area::-webkit-scrollbar {
  width: 8px;
}

.textarea-style::-webkit-scrollbar-track,
.result-grid-display-area::-webkit-scrollbar-track {
  background: #f0f0f0;
  border-radius: 4px;
}

.textarea-style::-webkit-scrollbar-thumb,
.result-grid-display-area::-webkit-scrollbar-thumb {
  background: #d0d0d0;
  border-radius: 4px;
}

.textarea-style::-webkit-scrollbar-thumb:hover,
.result-grid-display-area::-webkit-scrollbar-thumb:hover {
  background: #c0c0c0;
}

/* Web Console Scrollbar - Simple terminal style */
#domWebConsole::-webkit-scrollbar {
  width: 6px;
}

#domWebConsole::-webkit-scrollbar-thumb {
  background: #606060;
  border-radius: 3px;
}

#domWebConsole::-webkit-scrollbar-track {
  background: #3a3a3a;
  border-radius: 3px;
}

/* Card Body - Reduced height for comments too */
#domCommentBody {
  max-height: 100px;
  resize: vertical;
  overflow-y: auto;
}

/* Main card styling (when viewing comments) */
.main-card {
  border: 2px solid rgba(74, 144, 226, 0.6);
  background: linear-gradient(135deg, #f8f8ff 0%, #f0f0ff 100%);
  box-shadow: 0 4px 16px rgba(74, 144, 226, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

/* Comment card styling */
.comment-card {
  border-left: 4px solid rgba(74, 144, 226, 0.7);
  background: linear-gradient(135deg, #f0f8ff 0%, #e8f4ff 100%);
  margin-left: 1.2rem;
  box-shadow: 0 2px 8px rgba(74, 144, 226, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

/* Card Actions */
.card-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.6rem;
}

.like-button,
.comment-button,
.add-comment-button {
  font-size: 0.75rem;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.like-button:hover {
  background-color: rgba(220, 53, 69, 0.1);
  border-color: #dc3545;
  transform: translateY(-1px);
}

.comment-button:hover {
  background-color: rgba(13, 110, 253, 0.1);
  border-color: #0d6efd;
  transform: translateY(-1px);
}

.add-comment-button:hover {
  background-color: rgba(25, 135, 84, 0.1);
  border-color: #198754;
  transform: translateY(-1px);
}

/* Mobile adjustments for new elements */
@media (max-width: 767px) {
  .comment-card {
    margin-left: 0.6rem;
  }

  .card-actions {
    flex-direction: column;
    gap: 0.4rem;
  }

  /* Disable button hover animations on mobile */
  .like-button:hover,
  .comment-button:hover,
  .add-comment-button:hover {
    transform: none;
  }
}

/* Performance optimizations */
* {
  -webkit-transform: translateZ(0);
  -moz-transform: translateZ(0);
  -ms-transform: translateZ(0);
  -o-transform: translateZ(0);
  transform: translateZ(0);
}

/* Reduce repaints */
.result-card,
.panel-box,
.button-style {
  will-change: transform;
}

/* Optimize animations for 60fps */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}