/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Ensure all buttons and submit inputs have pointer cursor */
button,
input[type="submit"],
input[type="button"] {
  cursor: pointer;
}

/* Enhanced touch interactions */
@media (hover: none) and (pointer: coarse) {
  /* Touch devices - increase tap targets */
  button,
  input[type="submit"],
  input[type="button"],
  a,
  [role="button"] {
    min-height: 44px !important;
    min-width: 44px !important;
  }
  
  /* Improve touch scrolling */
  textarea,
  .overflow-x-auto {
    -webkit-overflow-scrolling: touch;
  }
  
  /* Better input focus for touch */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  textarea {
    font-size: 16px !important; /* Prevents zoom on iOS */
  }
}

/* Tablet optimizations */
@media (min-width: 768px) and (max-width: 1024px) {
  /* Tablet portrait and landscape */
  .tablet-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* Better spacing for tablet */
  .tablet-padding {
    padding: 1.5rem;
  }
  
  /* Optimize text sizes for tablet */
  .tablet-text {
    font-size: 1.125rem;
    line-height: 1.6;
  }
}

/* Enhanced code blocks for mobile */
pre, code {
  -webkit-overflow-scrolling: touch;
}

/* Smooth scrolling for better UX */
html {
  scroll-behavior: smooth;
}

/* Better focus indicators for accessibility */
*:focus {
  outline: 2px solid #3B82F6;
  outline-offset: 2px;
}

/* Remove default focus styles for mouse users */
*:focus:not(:focus-visible) {
  outline: none;
}

/* Restore focus styles for keyboard users */
*:focus-visible {
  outline: 2px solid #3B82F6;
  outline-offset: 2px;
}

/* Landscape orientation optimizations */
@media screen and (orientation: landscape) and (max-height: 600px) {
  /* Reduce header size in landscape mobile */
  .landscape-compact {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
  }
  
  /* Smaller text in landscape mobile */
  .landscape-text {
    font-size: 0.875rem !important;
  }
}

/* Additional responsive improvements for content sections */
@media (max-width: 640px) {
  /* Prevent code overflow on small screens */
  pre:not(.trix-content pre) {
    font-size: 0.75rem !important;
    line-height: 1.2 !important;
    word-break: break-all;
    white-space: pre-wrap;
  }

  /* Better section spacing on mobile */
  .prose section {
    margin-bottom: 2rem;
  }

  /* Smaller headers on mobile - but not in trix-content */
  h1:not(.trix-content h1) {
    font-size: 1.75rem !important;
    line-height: 1.3 !important;
  }

  h2:not(.trix-content h2) {
    font-size: 1.5rem !important;
    line-height: 1.3 !important;
  }

  h3:not(.trix-content h3) {
    font-size: 1.25rem !important;
    line-height: 1.3 !important;
  }

  /* Better button spacing */
  .inline-flex {
    padding: 0.75rem 1rem !important;
    font-size: 0.875rem !important;
  }
}

/* Fix horizontal scroll on very small screens */
@media (max-width: 375px) {
  body {
    overflow-x: hidden;
  }

  pre, code {
    max-width: 100%;
    overflow-x: auto;
    font-size: 0.7rem !important;
  }

  /* Ensure containers don't overflow */
  .max-w-4xl,
  .max-w-6xl,
  .max-w-7xl {
    max-width: 100% !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
}

/* ========================================
   Markdown Content Styling
   ======================================== */

.markdown-content {
  line-height: 1.75;
  color: #1f2937;
}

.markdown-content h1 {
  font-size: 2rem !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
  margin-top: 2rem !important;
  margin-bottom: 1rem !important;
  color: #111827 !important;
}

.markdown-content h2 {
  font-size: 1.5rem !important;
  font-weight: 600 !important;
  line-height: 1.3 !important;
  margin-top: 1.75rem !important;
  margin-bottom: 0.875rem !important;
  color: #1f2937 !important;
}

.markdown-content h3 {
  font-size: 1.25rem !important;
  font-weight: 600 !important;
  line-height: 1.4 !important;
  margin-top: 1.5rem !important;
  margin-bottom: 0.75rem !important;
  color: #374151 !important;
}

.markdown-content p {
  margin-bottom: 1.25rem;
}

.markdown-content strong {
  font-weight: 600;
  color: #111827;
}

.markdown-content em {
  font-style: italic;
}

.markdown-content a {
  color: #4f46e5 !important;
  text-decoration: underline !important;
  transition: color 0.15s ease-in-out;
  font-weight: 500;
}

.markdown-content a:hover {
  color: #4338ca !important;
}

.markdown-content ul,
.markdown-content ol {
  margin-left: 1.5rem;
  margin-bottom: 1.25rem;
}

.markdown-content ul {
  list-style-type: disc;
}

.markdown-content ol {
  list-style-type: decimal;
}

.markdown-content li {
  margin-bottom: 0.5rem;
  padding-left: 0.25rem;
}

.markdown-content blockquote {
  border-left: 4px solid #6366f1;
  padding: 1.5rem;
  margin: 1.5rem 0;
  color: #4b5563;
  font-style: italic;
  background-color: #f9fafb;
  border-radius: 0.5rem;
}

.markdown-content pre {
  background-color: #1f2937;
  color: #f9fafb;
  padding: 1.5rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.875rem;
  line-height: 1.5;
}

.markdown-content code {
  background-color: #f3f4f6;
  color: #dc2626;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.875em;
}

.markdown-content pre code {
  background-color: transparent;
  color: inherit;
  padding: 0;
}

.markdown-content img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
  margin: 1.5rem auto;
  display: block;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

.markdown-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

.markdown-content table th,
.markdown-content table td {
  border: 1px solid #e5e7eb;
  padding: 0.75rem;
  text-align: left;
}

.markdown-content table th {
  background-color: #f9fafb;
  font-weight: 600;
}

/* ========================================
   Enhanced Code Block Styling (Atom One Dark)
   ======================================== */

/* Code block container styling */
.toastui-editor-contents pre,
.prose pre,
#blog-content pre {
  background: #282c34 !important;
  border-radius: 8px !important;
  padding: 1.5rem !important;
  margin: 1.5rem 0 !important;
  overflow-x: auto !important;
  font-size: 14px !important;
  line-height: 1.6 !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2) !important;
}

.toastui-editor-contents pre code,
.prose pre code,
#blog-content pre code {
  background: transparent !important;
  color: #abb2bf !important;
  padding: 0 !important;
  font-family: 'Fira Code', 'JetBrains Mono', 'Consolas', 'Monaco', 'Courier New', monospace !important;
  font-size: 14px !important;
  line-height: 1.6 !important;
}

/* Inline code */
.toastui-editor-contents code:not(pre code),
.prose code:not(pre code),
#blog-content code:not(pre code) {
  background: #f3f4f6 !important;
  color: #e06c75 !important;
  padding: 0.2em 0.4em !important;
  border-radius: 4px !important;
  font-size: 0.9em !important;
  font-family: 'Fira Code', 'JetBrains Mono', 'Consolas', 'Monaco', 'Courier New', monospace !important;
  font-weight: 500 !important;
}

/* Scrollbar styling for code blocks */
.toastui-editor-contents pre::-webkit-scrollbar,
.prose pre::-webkit-scrollbar,
#blog-content pre::-webkit-scrollbar {
  height: 10px;
}

.toastui-editor-contents pre::-webkit-scrollbar-track,
.prose pre::-webkit-scrollbar-track,
#blog-content pre::-webkit-scrollbar-track {
  background: #21252b;
  border-radius: 4px;
}

.toastui-editor-contents pre::-webkit-scrollbar-thumb,
.prose pre::-webkit-scrollbar-thumb,
#blog-content pre::-webkit-scrollbar-thumb {
  background: #4b5263;
  border-radius: 4px;
}

.toastui-editor-contents pre::-webkit-scrollbar-thumb:hover,
.prose pre::-webkit-scrollbar-thumb:hover,
#blog-content pre::-webkit-scrollbar-thumb:hover {
  background: #5c6370;
}

/* Ensure hljs theme is applied properly */
.hljs {
  background: #282c34 !important;
  color: #abb2bf !important;
}

/* ========================================
   Toast UI Viewer Content Styling
   ======================================== */

#blog-content .toastui-editor-contents {
  font-size: 21px;
  line-height: 32px;
  color: #1f2937;
}

#blog-content .toastui-editor-contents h1 {
  font-size: 2.5rem !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  margin-top: 3rem !important;
  margin-bottom: 1.5rem !important;
  color: #111827 !important;
  font-family: serif !important;
}

#blog-content .toastui-editor-contents h2 {
  font-size: 1.875rem !important;
  font-weight: 700 !important;
  line-height: 1.3 !important;
  margin-top: 2.5rem !important;
  margin-bottom: 1rem !important;
  color: #111827 !important;
  font-family: serif !important;
}

#blog-content .toastui-editor-contents h3 {
  font-size: 1.5rem !important;
  font-weight: 600 !important;
  line-height: 1.4 !important;
  margin-top: 2rem !important;
  margin-bottom: 0.75rem !important;
  color: #1f2937 !important;
  font-family: serif !important;
}

#blog-content .toastui-editor-contents p {
  font-size: 21px !important;
  line-height: 32px !important;
  /* margin-bottom: 2rem !important; */
  color: #1f2937 !important;
}

#blog-content .toastui-editor-contents a {
  color: #2563eb !important;
  text-decoration: underline !important;
  font-weight: 400 !important;
  font-size: inherit !important;
  transition: color 0.2s ease !important;
}

#blog-content .toastui-editor-contents a:hover {
  color: #1d4ed8 !important;
  text-decoration: underline !important;
}

#blog-content .toastui-editor-contents strong {
  font-weight: 600 !important;
  color: #111827 !important;
}

#blog-content .toastui-editor-contents code {
  background: #f3f4f6 !important;
  color: #e06c75 !important;
  padding: 0.2em 0.4em !important;
  border-radius: 4px !important;
  font-size: 0.9em !important;
}

#blog-content .toastui-editor-contents pre {
  background: #282c34 !important;
  border-radius: 8px !important;
  padding: 1.5rem !important;
  margin: 1.5rem 0 !important;
  overflow-x: auto !important;
}

#blog-content .toastui-editor-contents pre code {
  background: transparent !important;
  color: #abb2bf !important;
  padding: 0 !important;
  font-size: 14px !important;
  line-height: 1.6 !important;
}

#blog-content .toastui-editor-contents blockquote {
  border-left: 4px solid #111827 !important;
  padding-left: 1.5rem !important;
  margin: 1.5rem 0 !important;
  font-style: italic !important;
  color: #4b5563 !important;
  font-size: 1.25rem !important;
}

#blog-content .toastui-editor-contents ul,
#blog-content .toastui-editor-contents ol {
  margin: 1.5rem 0 !important;
  padding-left: 1.5em !important;
}

#blog-content .toastui-editor-contents li {
  margin: 0.25rem 0 !important;
  padding-left: 0.25em !important;
  line-height: 1.6 !important;
  font-size: 18px !important;
  display: list-item !important;
}

#blog-content .toastui-editor-contents li a {
  font-size: 18px !important;
  vertical-align: baseline !important;
}

#blog-content .toastui-editor-contents li::marker {
  font-size: 18px !important;
}

#blog-content .toastui-editor-contents img {
  border-radius: 0.5rem !important;
  margin: 2rem 0 !important;
  max-width: 100% !important;
}

#blog-content .toastui-editor-contents table {
  width: 100% !important;
  border-collapse: collapse !important;
  margin: 1.5rem 0 !important;
}

#blog-content .toastui-editor-contents table th,
#blog-content .toastui-editor-contents table td {
  border: 1px solid #e5e7eb !important;
  padding: 0.75rem !important;
  text-align: left !important;
}

#blog-content .toastui-editor-contents table th {
  background-color: #f9fafb !important;
  font-weight: 600 !important;
}

/* Hide editor UI elements on blog show page */
#blog-content .toastui-editor-toolbar,
#blog-content .toastui-editor-mode-switch,
#blog-content .toastui-editor-popup,
#blog-content .toastui-editor-dropdown-toolbar,
#blog-content .toastui-editor .ProseMirror,
#blog-content .toastui-editor-md-container,
#blog-content .toastui-editor-ww-container {
  display: none !important;
}

/* Ensure only viewer content is visible */
#blog-content .toastui-editor-contents {
  display: block !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* Remove editor wrapper styles */
#blog-content .toastui-editor {
  border: none !important;
  background: transparent !important;
}

#blog-content .toastui-editor-defaultUI {
  border: none !important;
}

#blog-content .toastui-editor-main {
  background: transparent !important;
}
.toastui-editor-contents ul>li:before {
    background-color: #ccc;
    border-radius: 50%;
    content: "";
    height: 5px;
    margin-left: -17px;
    margin-top: 17px !important;
    width: 5px
}