/* Modern Light Theme for Word Frequency Counter */

h1 {
  margin: 0;
  color: #1a1a1a;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-weight: 700;
  font-size: 2.5rem;
  letter-spacing: -0.025em;
}

h2 {
  color: #374151;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-weight: 600;
  font-size: 1.5rem;
  margin: 1.5rem 0 1rem 0;
}

body {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  min-height: 100vh;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  color: #1f2937;
  line-height: 1.6;
}

textarea {
  min-height: 15em !important;
  background: #ffffff;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 1rem;
  font-family: 'JetBrains Mono', 'Fira Code', 'Monaco', monospace;
  font-size: 14px;
  line-height: 1.5;
  color: #374151;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  resize: vertical;
}

textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1), 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

[data-button] {
  display: block;
  font-size: 16pt !important;
  width: auto !important;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 12px 24px;
  font-weight: 600;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.3);
  margin: 1rem 0;
}

[data-button]:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
  transform: translateY(-1px);
  box-shadow: 0 8px 15px -3px rgba(59, 130, 246, 0.4);
}

[data-button]:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px -1px rgba(59, 130, 246, 0.4);
}

a {
  text-shadow: none;
  color: #3b82f6;
  text-decoration: none;
}

a:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

/* Table Styles */
table,
table *,
table *:before,
table *:after {
  box-sizing: border-box;
  -moz-box-sizing: border-box;
  -webkit-box-sizing: border-box;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-kerning: auto;
}

table {
  display: table;
  width: auto;
  margin: 1em 0 !important;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

table caption {
  display: table-caption;
  width: auto;
}

table thead {
  display: table-header-group;
  width: auto;
}

table tbody {
  display: table-row-group;
  width: auto;
}

table tfoot {
  display: table-footer-group;
  width: auto;
}

table tr {
  display: table-row;
  width: auto;
}

table th,
table td {
  display: table-cell;
  width: auto;
}

/* Default Light Theme */
[data-theme*=default] {
  color: #374151;
  background: white;
  border: none !important;
  font-size: 14px;
  border-collapse: separate !important;
  border-spacing: 0;
}

[data-theme*=default] thead th,
[data-theme*=default] tfoot th {
  color: #1f2937;
  background: #f8fafc;
  font-weight: 600;
}

[data-theme*=default] caption {
  padding: .5em;
}

[data-theme*=default] th,
[data-theme*=default] td {
  padding: 12px 16px;
  border: none;
  border-bottom: 1px solid #f3f4f6;
}

[data-theme*=default] thead {
  display: table-header-group;
}

[data-theme*=default] tfoot {
  display: table-footer-group;
}

[data-theme*=default] td:before {
  display: none;
}

/* Zebra Light Theme */
[data-theme*=zebra] tbody tr:nth-of-type(even) {
  background: #f9fafb;
}

[data-theme*=zebra] tbody tr:hover {
  background: #f3f4f6;
  transition: background-color 0.2s ease;
}

/* Dark theme overrides for light theme */
[data-theme*=dark] {
  color: #374151;
  background: white;
  font-size: 14px;
  border-collapse: separate !important;
  border-spacing: 0;
}

[data-theme*=dark] thead th,
[data-theme*=dark] tfoot th {
  color: #1f2937;
  background: #f8fafc;
  font-weight: 600;
}

[data-theme*=dark] caption {
  padding: .5em;
}

[data-theme*=dark] th,
[data-theme*=dark] td {
  padding: 12px 16px;
  background: white;
  border: none;
  border-bottom: 1px solid #f3f4f6;
}

[data-theme*=dark][data-theme*=zebra] tbody tr:nth-of-type(even) td {
  background: #f9fafb !important;
}

/* DataTables Styling */
.dataTables_wrapper {
  font-size: 14px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_processing,
.dataTables_wrapper .dataTables_paginate {
  color: #6b7280;
  font-weight: 500;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  color: #6b7280 !important;
  border: 1px solid #e5e7eb;
  background: white;
  border-radius: 6px;
  margin: 0 2px;
  padding: 6px 12px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  color: #3b82f6 !important;
  background: #f0f9ff;
  border-color: #3b82f6;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  color: white !important;
  background: #3b82f6;
  border-color: #3b82f6;
}

/* Input and Select Styling */
textarea,
.dataTables_wrapper input,
.dataTables_wrapper select {
  margin: 0;
  margin-bottom: .5em !important;
  padding: 10px 14px;
  width: 100% !important;
  height: 44px;
  outline: none !important;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  background: white;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  color: #374151;
  font-weight: 400;
  font-size: 14px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-appearance: none;
  appearance: none;
  -moz-appearance: none;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

.dataTables_wrapper input:focus,
.dataTables_wrapper select:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1), 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.dataTables_wrapper select {
  color: #6b7280;
  background: white;
  padding-right: 2.5em;
  background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="%236b7280"><path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd"/></svg>') !important;
  background-repeat: no-repeat !important;
  background-position: calc(100% - 12px) 50% !important;
  background-size: 16px !important;
  text-indent: 0.01px;
  text-overflow: '';
}

.dataTables_wrapper select:active {
  background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="%233b82f6"><path fill-rule="evenodd" d="M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z" clip-rule="evenodd"/></svg>');
}

.dataTables_wrapper select::-ms-expand {
  display: none;
}

/* Collapsible Section Styling */
input[type='checkbox'] {
  display: none;
}

.wrap-collabsible {
  margin: 2rem 0;
}

.lbl-toggle {
  display: block;
  font-weight: 600;
  font-size: 1.1rem;
  text-transform: none;
  text-align: center;
  color: #374151;
  background: white;
  cursor: pointer;
  border-radius: 10px;
  padding: 12px 20px;
  border: 2px solid #e5e7eb;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.lbl-toggle:hover {
  color: #1f2937;
  border-color: #d1d5db;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.lbl-toggle::before {
  content: ' ';
  display: inline-block;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 5px solid currentColor;
  vertical-align: middle;
  margin-right: .7rem;
  transform: translateY(-2px);
  transition: transform .3s ease-out;
}

.toggle:checked + .lbl-toggle::before {
  transform: rotate(90deg) translateX(-3px);
}

.toggle:checked + .lbl-toggle {
  color: #3b82f6;
  border-color: #3b82f6;
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0;
  background: #f0f9ff;
}

.collapsible-content {
  max-height: 0px;
  overflow: hidden;
  transition: max-height .4s cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle:checked + .lbl-toggle + .collapsible-content {
  max-height: 400px;
}

.collapsible-content .content-inner {
  background: white;
  border: 2px solid #3b82f6;
  border-top: none;
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
  padding: 1.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.collapsible-content p {
  margin-bottom: 0;
  color: #4b5563;
  line-height: 1.7;
}

/* Additional modern touches */
.article {
  font-size: 15px;
  line-height: 1.7;
}

/* Responsive improvements */
@media (max-width: 768px) {
  h1 {
    font-size: 2rem;
  }
  
  textarea {
    min-height: 12em !important;
  }
  
  [data-button] {
    font-size: 14pt !important;
    padding: 10px 20px;
  }
}