/* http://meyerweb.com/eric/tools/css/reset/
   v2.0 | 20110126
   License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
  padding: 0;
  margin: 0;
  font: inherit;
  font-size: 100%;
  vertical-align: baseline;
  border: 0;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
  display: block;
}
body { line-height: 1; }
ol, ul { list-style: none; }
blockquote, q { quotes: none; }
blockquote:before, blockquote:after,
q:before, q:after { content: ''; content: none; }
table { border-spacing: 0; border-collapse: collapse; }

/* LAYOUT STYLES */
body {
  font-family: 'Inter', sans-serif;
  font-size: 16px; /* adjust as needed */
  font-size: 1em;
  line-height: 1.5;
  color: #6d6d6d;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
  background: #e7e7e7 url(../images/body-bg.png) 0 0 repeat;
}
a { color: #d5000d; }
a:hover { color: #c5000c; }

header {
  padding-top: 35px;
  padding-bottom: 25px;
}
.header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #eee;
}

header h1 {
  font-family: 'Chivo', 'Helvetica Neue', Helvetica, Arial, serif;
  font-size: 48px; font-weight: 900;
  line-height: 1.2;
  color: #303030;
  letter-spacing: -1px;
}
header h2 {
  font-size: 24px;
  font-weight: normal;
  line-height: 1.3;
  color: #aaa;
  letter-spacing: -1px;
}

#container {
  min-height: 595px;
  background: transparent url(../images/highlight-bg.jpg) 50% 0 no-repeat;
}
#container .inner {
  width: 90%; /* or 1400px if you want more */
  margin: 0 auto;
}
#container .inner img { max-width: 100%; }

#downloads { margin-bottom: 40px; }

a.button {
  display: block;
  float: left;
  width: 179px;
  padding: 12px 8px 12px 8px;
  margin-right: 14px;
  font-size: 15px;
  font-weight: bold;
  line-height: 25px;
  color: #303030;
  background: #fdfdfd; /* Old browsers */
  background: -moz-linear-gradient(top,  #fdfdfd 0%, #f2f2f2 100%);
  background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#fdfdfd), color-stop(100%,#f2f2f2));
  background: -webkit-linear-gradient(top,  #fdfdfd 0%,#f2f2f2 100%);
  background: -o-linear-gradient(top,  #fdfdfd 0%,#f2f2f2 100%);
  background: -ms-linear-gradient(top,  #fdfdfd 0%,#f2f2f2 100%);
  background: linear-gradient(top,  #fdfdfd 0%,#f2f2f2 100%);
  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fdfdfd', endColorstr='#f2f2f2',GradientType=0 );
  border-top: solid 1px #cbcbcb;
  border-right: solid 1px #b7b7b7;
  border-bottom: solid 1px #b3b3b3;
  border-left: solid 1px #b7b7b7;
  border-radius: 30px;
  -webkit-box-shadow: 10px 10px 5px #888;
  -moz-box-shadow: 10px 10px 5px #888;
  box-shadow: 0px 1px 5px #e8e8e8;
  -moz-border-radius: 30px;
  -webkit-border-radius: 30px;
}
a.button:hover {
  background: #fafafa;
  background: -moz-linear-gradient(top,  #fdfdfd 0%, #f6f6f6 100%);
  background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#fdfdfd), color-stop(100%,#f6f6f6));
  background: -webkit-linear-gradient(top,  #fdfdfd 0%,#f6f6f6 100%);
  background: -o-linear-gradient(top,  #fdfdfd 0%,#f6f6f6 100%);
  background: -ms-linear-gradient(top,  #fdfdfd 0%,#f6f6f6 100%);
  background: linear-gradient(top,  #fdfdfd 0%,#f6f6f6, 100%);
  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fdfdfd', endColorstr='#f6f6f6',GradientType=0 );
  border-top: solid 1px #b7b7b7;
  border-right: solid 1px #b3b3b3;
  border-bottom: solid 1px #b3b3b3;
  border-left: solid 1px #b3b3b3;
}

a.button span {
  display: block;
  height: 23px;
  padding-left: 50px;
}
#download-zip span { background: transparent url(../images/zip-icon.png) 12px 50% no-repeat; }
#download-tar-gz span { background: transparent url(../images/tar-gz-icon.png) 12px 50% no-repeat; }
#view-on-github span { background: transparent url(../images/octocat-icon.png) 12px 50% no-repeat; }
#view-on-github { margin-right: 0; }

code, pre {
  margin-bottom: 30px;
  font-family: Monaco, "Bitstream Vera Sans Mono", "Lucida Console", Terminal;
  font-size: 14px;
  color: #222;
}
code {
  padding: 0 3px;
  background-color: #f2f2f2;
  border: solid 1px #ddd;
}
pre {
  padding: 20px;
  overflow: auto;
  color: #f2f2f2;
  text-shadow: none;
  background: #303030;
}
pre code {
  padding: 0;
  color: #f2f2f2;
  background-color: #303030;
  border: none;
}

ul, ol, dl { margin-bottom: 20px; }

/* COMMON STYLES */
hr {
  height: 1px;
  padding-bottom: 1em;
  margin-top: 1em;
  line-height: 1px;
  background: transparent url('../images/hr.png') 50% 0 no-repeat;
  border: none;
}
strong { font-weight: bold; }
em { font-style: italic; }
table { width: 100%; border: 1px solid #ebebeb; }
th { font-weight: 500; }
td { font-weight: 300; text-align: center; border: 1px solid #ebebeb; }
form { padding: 20px; background: #f2f2f2; }

/* GENERAL ELEMENT TYPE STYLES */
h1 { font-size: 32px; }
h2 { margin-bottom: 8px; font-size: 22px; font-weight: bold; color: #303030; }
h3 { margin-bottom: 8px; font-size: 18px; font-weight: bold; color: #d5000d; }
h4 { font-size: 16px; font-weight: bold; color: #303030; }
h5 { font-size: 1em; color: #303030; }
h6 { font-size: .8em; color: #303030; }
p { margin-bottom: 20px; font-weight: 300; }
a { text-decoration: none; }
p a { font-weight: 400; }
blockquote {
  padding: 0 0 0 30px;
  margin-bottom: 20px;
  font-size: 1.6em;
  border-left: 10px solid #e9e9e9;
}
ul li {
  list-style-position: inside;
  list-style: disc;
  padding-left: 20px;
}
ol li {
  list-style-position: inside;
  list-style: decimal;
  padding-left: 3px;
}
dl dt { color: #303030; }

footer {
  padding-top: 20px;
  padding-bottom: 30px;
  margin-top: 40px;
  font-size: 13px;
  color: #aaa;
  background: transparent url('../images/hr.png') 0 0 no-repeat;
}
footer a { color: #666; }
footer a:hover { color: #444; }

/* MISC */
.clearfix:after {
  display: block;
  height: 0;
  clear: both;
  visibility: hidden;
  content: '.';
}
.clearfix { display: inline-block; }
* html .clearfix { height: 1%; }
.clearfix { display: block; }

/* GRID */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
  align-items: stretch; /* ensures equal height rows */
}
@media (min-width: 1200px) {
  .grid { grid-template-columns: repeat(4, 1fr); }
}

h1, h2, h3, h4 {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
}

/* CARD */
.card {
  display: flex;
  flex-direction: column;
  justify-content: space-between; /* spreads content evenly */
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  background-color: #fff; /* use background-color (not shorthand) */
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  will-change: transform;
}
.card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 6px 14px rgba(0,0,0,0.15);
  z-index: 1;
}
.card h3 {
  margin-top: 0;
}
.card p { margin: 0.5rem 0; }
.card i { color: #555; margin-right: 4px; }
.card-content { flex: 1; }
.card-footer { margin-top: auto; }

/* SORT CONTROLS */
.sort-controls {
  text-align: center;
  margin-bottom: 1rem;
}
.sort-controls button {
  margin: 0 0.5rem;
  padding: 0.5rem 1rem;
  border: none;
  background: #0366d6;
  color: white;
  border-radius: 4px;
  cursor: pointer;
}
.sort-controls button:hover { background: #024c9a; }

/* FILTER CONTROLS */
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;        /* consistent spacing between controls */
  align-items: center;
}
.controls input,
.controls button,
.controls select {
  padding: 0.5rem 1rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 1rem;
  background-color: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.controls button {
  background: #0366d6;
  color: #fff;
  border: none;
  cursor: pointer;
}
.controls button:hover { background: #024ea2; }
.controls select {
  padding: 0.5rem 1rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 1rem;
  background-color: #fff;
  color: #333;
  transition: border-color 0.2s, box-shadow 0.2s;
  margin-left: 0.5rem;
}
.controls select:focus {
  border-color: #0366d6;
  box-shadow: 0 0 0 2px rgba(3,102,214,0.2);
  outline: none;
}
#clear-filters {
  background: #999;
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}
#clear-filters:hover { background: #666; }

/* NAVBAR */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.5rem;
  background-color: #fff;
  color: #333;
  border-bottom: 1px solid #eee;
  margin-bottom: 4px;       /* reduced spacing */
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
  transition: box-shadow 0.3s ease;
}

.site-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
  line-height: 1;         /* keeps title snug */
}
.navbar-right {
  display: flex;
  gap: 0.75rem;
  align-items: center;    /* vertically aligns controls with title */
}
.navbar-right input,
.navbar-right select,
.navbar-right button {
  padding: 0.45rem 0.75rem;  /* balanced height with title */
  border-radius: 4px;
  border: 1px solid #ccc;
  font-size: 0.9rem;
  background-color: #fff;
  color: #333;
  cursor: pointer;
}
.navbar-right button:hover { background-color: #f5f5f5; }

/* RESPONSIVE NAVBAR */
@media (max-width: 768px) {
  .navbar { flex-direction: column; align-items: flex-start; }
  .navbar-right {
    flex-wrap: wrap;
    margin-top: 0.5rem;
    width: 100%;
  }
  .navbar-right input,
  .navbar-right select,
  .navbar-right button { flex: 1; }
}

/* #Media Queries
================================================== */

/* Smaller than standard 960 (devices and browsers) */
@media only screen and (max-width: 959px) { }
/* Tablet Portrait size to standard 960 (devices and browsers) */
@media only screen and (min-width: 768px) and (max-width: 959px) { }
/* All Mobile Sizes (devices and browser) */
@media only screen and (max-width: 767px) {
  header { padding-top: 10px; padding-bottom: 10px; }
  #downloads { margin-bottom: 25px; }
  #download-zip, #download-tar-gz { display: none; }
  .inner { width: 94%; margin: 0 auto; }
}

/* BADGES */
.badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  margin: 0.25rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  background: #0366d6; /* GitHub blue */
  color: #fff;
}
.badge.javascript { background: #f1e05a; color: #000; }
.badge.python { background: #3572A5; color: #fff; }
.badge.css { background: #563d7c; color: #fff; }
.badge.html { background: #e34c26; color: #fff; }
.badge.topic {
  background: #eee;
  color: #333;
  border: 1px solid #ccc;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.badge.topic:hover {
  background: #0366d6;
  color: #fff;
  border-color: #0366d6;
}

.badge.ai {
  background: #ff4081;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  margin-left: 8px;
}

.ai-card {
  border: 2px solid #ff4081;
  box-shadow: 0 0 12px rgba(255,64,129,0.4);
}


/* Toggle switch container */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}
/* Hide default checkbox */
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
/* Slider track */
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 26px;
}
/* Slider knob */
.slider:before {
  position: absolute;
  content: "";
  height: 20px; width: 20px;
  left: 3px; bottom: 3px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}
/* Checked state */
.switch input:checked + .slider { background-color: #0366d6; }
.switch input:checked + .slider:before { transform: translateX(24px); }

/* DARK MODE */
body.dark-mode {
  background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
  color: #e0e0e0;
  text-shadow: none !important; /* remove global white glow */
}
body.dark-mode .navbar {
  background-color: #1e1e1e;
  border-bottom: 1px solid #333;
  color: #e0e0e0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.6);
}
body.dark-mode .card {
  background-color: #1e1e1e;
  color: #e0e0e0;
  border: none;
  outline: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.6);
}
body.dark-mode .navbar-right input,
body.dark-mode .navbar-right select,
body.dark-mode .navbar-right button {
  background-color: #2a2a2a;
  color: #e0e0e0;
  border: 1px solid #444;
}
/* Ensure no nested element adds light backgrounds in dark mode */
body.dark-mode .card-content,
body.dark-mode .card-footer,
body.dark-mode .card *,
body.dark-mode .card h3,
body.dark-mode .card p {
  background: transparent !important;
  text-shadow: none !important;
  box-shadow: none !important;
  -webkit-text-fill-color: inherit;
  -webkit-text-stroke: 0;
  filter: none;
}
/* Light mode baseline for titles */
.card h3 {
  color: #333;
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
  font-weight: 600;
}
/* Dark mode titles: off-white, no glow or inset */
body.dark-mode .card h3 {
  color: #eee;
  background: transparent;
  box-shadow: none;
  text-shadow: none;
  filter: none;
  -webkit-text-fill-color: #eee;
  -webkit-text-stroke: 0;
}

body.dark-mode header h1,
body.dark-mode .header h1 {
  color: #eee;                      /* clean off-white */
  background: transparent !important;
  text-shadow: none !important;    /* removes white glow */
  box-shadow: none !important;
  -webkit-text-fill-color: #eee !important;
  -webkit-text-stroke: 0 !important;
  filter: none !important;
}

body.dark-mode header,
body.dark-mode .header {
  background: transparent !important;
  border-bottom: 1px solid #333;   /* optional: keep structure */
}



/* Mobile Landscape Size to Tablet Portrait (devices and browsers) */
@media only screen and (min-width: 480px) and (max-width: 767px) { }
/* Mobile Portrait Size to Mobile Landscape Size (devices and browsers) */
@media only screen and (max-width: 479px) { }

body.dark-mode header,
body.dark-mode .header {
  background: transparent !important;
  border-bottom: 1px solid #333;
}


body.dark-mode .site-title,
body.dark-mode header h1,
body.dark-mode .header h1 {
  color: #eee !important;
  background: transparent !important;
  text-shadow: none !important;
  box-shadow: none !important;
  -webkit-text-fill-color: #eee !important;
  -webkit-text-stroke: 0 !important;
  filter: none !important;
}

body.dark-mode .site-title {
  color: #eee !important;
  background: transparent !important;
  text-shadow: none !important;
  box-shadow: none !important;
  -webkit-text-fill-color: #eee !important;
  -webkit-text-stroke: 0 !important;
  filter: none !important;
}

body.dark-mode #container {
  background: none !important;
}

/* Default (light mode) styles are already defined */

@media (prefers-color-scheme: dark) {
  body {
    background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
    color: #e0e0e0;
    text-shadow: none !important;
  }

  .navbar {
    background-color: #1e1e1e;
    border-bottom: 1px solid #333;
    color: #e0e0e0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.6);
  }

  .card {
    background-color: #1e1e1e;
    color: #e0e0e0;
    border: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.6);
  }

  .navbar-right input,
  .navbar-right select,
  .navbar-right button {
    background-color: #2a2a2a;
    color: #e0e0e0;
    border: 1px solid #444;
  }

  .card h3 {
    color: #eee;
  }

  .site-title {
    color: #eee !important;
  }
}
