/* ========================================
   HAWATRI LOGS - OPTIMIZED STYLES
   Compressed but readable version
   ======================================== */

/* BASE STYLES */
body {
  font-family: "Indie Flower", cursive;
  transition: all 0.3s ease;
  background-color: white;
  color: black;
}

/* DARK MODE */
.dark body { 
  background-color: #1a1a1a; 
  color: #f0f0f0; 
}
.dark h1, .dark h2, .dark h3, .dark h4, .dark h5, .dark h6 { 
  color: #f0f0f0; 
}
.dark p { 
  color: #e0e0e0; 
}

/* LAYOUT COMPONENTS */
header div, nav, aside, #contentArea, footer div {
  background-color: white;
  border-color: black;
  transition: all 0.3s ease;
}

.dark header div, .dark nav, .dark aside, .dark #contentArea, .dark footer div {
  background-color: #2a2a2a;
  border-color: #f0f0f0;
}

/* NAVIGATION */
nav input {
  background-color: white;
  color: black;
  transition: all 0.3s ease;
}

.dark nav input {
  background-color: #2a2a2a;
  color: #f0f0f0;
}

.dark nav input::placeholder { 
  color: #999; 
}

nav button:hover, .hover\:bg-gray-100:hover {
  background-color: #f5f5f5;
}

.dark nav button:hover, .dark .hover\:bg-gray-100:hover {
  background-color: #3a3a3a;
}

/* SEARCH DROPDOWN */
#searchResults {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 50;
  background-color: white;
  border: 2px solid black;
  border-radius: 0.5rem;
  max-height: 400px;
  overflow-y: auto;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.dark #searchResults {
  background-color: #2a2a2a;
  border-color: #f0f0f0;
}
.search-result-item {
  display: block;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e5e7eb;
  color: black;
  transition: background-color 0.2s;
}
.dark .search-result-item {
  border-bottom-color: #4a4a4a;
  color: #f0f0f0;
}
.search-result-item:last-child {
  border-bottom: none;
}
.search-result-item:hover, .search-result-item.selected {
  background-color: #f3f4f6;
  text-decoration: none;
}
.dark .search-result-item:hover, .dark .search-result-item.selected {
  background-color: #3a3a3a;
}
.search-result-title {
  font-weight: bold;
  font-family: 'Indie Flower', cursive;
  font-size: 1.1rem;
}
.search-result-excerpt {
  font-size: 0.9rem;
  color: #4b5563;
  margin-top: 0.25rem;
}
.dark .search-result-excerpt {
  color: #9ca3af;
}
.search-no-results {
  padding: 1rem;
  text-align: center;
  color: #6b7280;
}
.dark .search-no-results {
  color: #9ca3af;
}

/* TEXT COLORS */
.text-gray-400 { color: #999; }
.text-gray-600 { color: #666; }
.text-gray-700 { color: #555; }

.dark .text-gray-400 { color: #666; }
.dark .text-gray-600 { color: #999; }
.dark .text-gray-700 { color: #ccc; }

/* LINKS */
.text-black.underline { color: black; }
.dark .text-black.underline { color: #f0f0f0; }

.text-black.underline:hover { color: #666; }
.dark .text-black.underline:hover { color: #ccc; }

/* SEARCH INPUT ENHANCEMENTS */
nav form {
  position: relative;
}

/* Search icon */
nav form svg {
  transition: color 0.3s ease;
}

.dark nav form svg {
  color: #999;
}

nav input:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.dark nav input:focus {
  box-shadow: 0 0 0 3px rgba(240, 240, 240, 0.1);
}

/* CONTENT TYPOGRAPHY */
#contentArea {
  font-size: 1.125rem;
  line-height: 1.7;
}

#contentArea h1 {
  font-size: 2.5rem;
  font-weight: bold;
  margin: 2rem 0 1.5rem 0;
  border-bottom: 3px solid black;
  padding-bottom: 0.5rem;
}

#contentArea h2 {
  font-size: 2rem;
  font-weight: bold;
  margin: 1.75rem 0 1rem 0;
  border-bottom: 2px solid black;
  padding-bottom: 0.25rem;
}

#contentArea h3 {
  font-size: 1.5rem;
  font-weight: bold;
  margin: 1.5rem 0 0.75rem 0;
}

#contentArea h4 {
  font-size: 1.25rem;
  font-weight: bold;
  margin: 1.25rem 0 0.5rem 0;
}

#contentArea h5, #contentArea h6 {
  font-size: 1.125rem;
  font-weight: bold;
  margin: 1rem 0 0.5rem 0;
}

.dark #contentArea h1, .dark #contentArea h2 {
  border-color: #f0f0f0;
}

#contentArea p {
  margin: 1rem 0;
  text-align: justify;
}

#contentArea strong { font-weight: 900; }
#contentArea em { font-style: italic; color: #333; }
.dark #contentArea em { color: #ccc; }

/* LISTS */
#contentArea ul, #contentArea ol {
  margin: 1.5rem 0;
  padding-left: 2rem;
}

#contentArea li {
  margin: 0.5rem 0;
  line-height: 1.6;
}

/* BLOCKQUOTES */
#contentArea blockquote {
  border-left: 4px solid black;
  background: #f8f9fa;
  padding: 1.5rem 2rem;
  margin: 2rem 0;
  font-style: italic;
  border-radius: 0 8px 8px 0;
}

.dark #contentArea blockquote {
  border-left-color: #f0f0f0;
  background: #2a2a2a;
  color: #e0e0e0;
}

/* CODE STYLING */
#contentArea code {
  background: #f1f5f9;
  color: #e11d48;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-family: 'Monaco', 'Cascadia Code', 'Roboto Mono', monospace;
  font-size: 0.9em;
  border: 1px solid #e2e8f0;
}

.dark #contentArea code {
  background: #2a2a2a;
  color: #fbbf24;
  border-color: #4a4a4a;
}

#contentArea pre {
  background: white;
  color: black;
  border: 2px solid black;
  border-radius: 8px;
  padding: 1.5rem;
  margin: 2rem 0;
  overflow-x: auto;
  font-family: 'Monaco', 'Cascadia Code', 'Roboto Mono', monospace;
  font-size: 0.9rem;
  line-height: 1.5;
  position: relative;
}

.dark #contentArea pre {
  border-color: #f0f0f0;
  background: transparent;
  color: white
}

#contentArea pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  display: block;
}

/* TABLES */
#contentArea table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  border: 2px solid black;
  border-radius: 8px;
  overflow: hidden;
}

#contentArea th, #contentArea td {
  border: 1px solid black;
  padding: 0.75rem 1rem;
  text-align: left;
}

#contentArea th {
  background: black;
  color: white;
  font-weight: bold;
}

#contentArea tr:nth-child(even) {
  background: #f8f9fa;
}

.dark #contentArea th, .dark #contentArea td {
  border-color: #f0f0f0;
}

.dark #contentArea th {
  background: #f0f0f0;
  color: black;
}

.dark #contentArea tr:nth-child(even) {
  background: #2a2a2a;
}

/* HORIZONTAL RULES */
#contentArea hr {
  border: none;
  height: 3px;
  background: linear-gradient(90deg, transparent, black, transparent);
  margin: 2.5rem 0;
  border-radius: 2px;
}

.dark #contentArea hr {
  background: linear-gradient(90deg, transparent, #f0f0f0, transparent);
}

/* IMAGES */
.blog-image {
  border: 2px solid black;
  border-radius: 0.5rem;
  overflow: hidden;
  margin: 1.5rem 0;
}

.dark .blog-image {
  border-color: #f0f0f0;
}

.blog-image img {
  width: 100%;
  height: auto;
  display: block;
}

.blog-image-caption {
  padding: 0.75rem;
  text-align: center;
  font-size: 0.9rem;
  color: #666;
  border-top: 1px solid #ddd;
  background-color: white;
}

.dark .blog-image-caption {
  color: #ccc;
  border-top-color: #555;
  background-color: #2a2a2a;
}

/* TAGS AND CATEGORIES */
.bg-gray-200 {
  background-color: #e5e7eb;
  color: #374151;
}

.dark .bg-gray-200 {
  background-color: #4b5563;
  color: #f9fafb;
}

/* FOCUS AND INTERACTION */
button:focus, input:focus {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.hover\:shadow-lg:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.dark .hover\:shadow-lg:hover {
  box-shadow: 0 10px 15px -3px rgba(255, 255, 255, 0.1);
}

/* RESPONSIVE DESIGN */
@media (max-width: 768px) {
  body { padding: 0.5rem; }
  
  header div {
    width: 200px !important;
    font-size: 1.5rem;
    padding: 0.5rem 1rem;
  }
  
  main {
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
  }

  aside {
    width: 100% !important;
    min-height: auto !important;
    padding: 1rem;
    order: 1;
  }

  #contentArea {
    width: 100%;
    padding: 1rem;
    min-height: 400px !important;
    order: 2;
  }
  
  nav {
    padding: 0.75rem;
    min-height: auto !important;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  nav ul {
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 1rem;
  }
  
  nav ul li {
    white-space: nowrap;
  }
  
  nav form {
    min-width: 150px;
    max-width: 200px;
    min-height: 36px !important;
    margin-left: 0;
    margin-top: 0.5rem;
    width: 100%;
  }
  
  #blogGrid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  #contentArea h1 { font-size: 2rem; }
  #contentArea h2 { font-size: 1.75rem; }
  #contentArea h3 { font-size: 1.5rem; }
  #contentArea p { font-size: 1rem; text-align: left; }
  #contentArea pre { padding: 1rem; font-size: 0.85rem; }
  
  /* Blog post cards on mobile */
  #blogGrid > div {
    margin-bottom: 1rem;
  }
  
  #blogGrid .h-48 {
    height: 200px;
  }
  
  /* Table responsiveness */
  #contentArea table {
    font-size: 0.875rem;
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
  
  #contentArea th, #contentArea td {
    padding: 0.5rem;
    min-width: 100px;
  }
}

@media (max-width: 480px) {
  body { padding: 0.25rem; }
  
  header div {
    width: 180px !important;
    font-size: 1.25rem;
    padding: 0.5rem;
  }
  
  nav {
    flex-direction: column;
    padding: 0.5rem;
    gap: 0.75rem;
    align-items: stretch;
  }

  nav ul {
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.25rem;
    font-size: 0.9rem;
  }
  
  nav form {
    width: 100%;
    max-width: none;
    margin: 0;
  }
  
  aside, #contentArea {
    padding: 0.75rem;
  }
  
  /* Typography adjustments for very small screens */
  #contentArea {
    font-size: 1rem;
    line-height: 1.6;
  }
  
  #contentArea h1 { 
    font-size: 1.75rem; 
    margin: 1.5rem 0 1rem 0;
  }
  
  #contentArea h2 { 
    font-size: 1.5rem; 
    margin: 1.25rem 0 0.75rem 0;
  }
  
  #contentArea h3 { 
    font-size: 1.25rem; 
    margin: 1rem 0 0.5rem 0;
  }
  
  #contentArea pre {
    padding: 0.75rem;
    font-size: 0.8rem;
    border-radius: 6px;
  }
  
  #contentArea blockquote {
    padding: 1rem;
    margin: 1.5rem 0;
    font-size: 0.95rem;
  }
  
  /* Blog grid improvements for small screens */
  #blogGrid .p-4 {
    padding: 0.75rem;
  }
  
  #blogGrid h3 {
    font-size: 1.125rem;
    line-height: 1.4;
  }
  
  #blogGrid .text-gray-700 {
    font-size: 0.9rem;
    line-height: 1.5;
  }
  
  /* Recent posts sidebar adjustments */
  aside h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
  }
  
  aside ul li {
    font-size: 0.9rem;
    line-height: 1.4;
  }
}

/* Additional responsive utilities */
@media (max-width: 640px) {
  /* Improve touch targets */
  nav a, nav button {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
  }
  
  /* Better spacing for touch interfaces */
  #blogGrid a, aside a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  
  /* Improve form elements */
  nav input {
    font-size: 16px; /* Prevents zoom on iOS */
    min-height: 44px;
  }
  
  nav button {
    min-width: 60px;
  }
}

/* Landscape orientation adjustments */
@media (max-width: 768px) and (orientation: landscape) {
  main {
    flex-direction: row;
  }
  
  aside {
    width: 300px !important;
    order: 1;
  }
  
  #contentArea {
    order: 2;
  }
  
  nav {
    flex-direction: row;
    flex-wrap: wrap;
  }
  
  nav form {
    margin-left: auto;
    margin-top: 0;
    width: auto;
  }
}

/* High DPI display optimizations */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  #contentArea pre {
    font-size: 0.85rem;
  }
  
  nav {
    border-width: 1px;
  }
  
  header div, aside, #contentArea, footer div {
    border-width: 1px;
  }
}

/* Default light mode dropdown */
select {
  background-color: white;
  color: black;
  transition: all 0.3s ease;
}

/* Dark mode dropdown */
.dark select {
  background-color: #2a2a2a;
  color: #f0f0f0;
  border-color: #f0f0f0;
}
