/* Header Bar */
.header-bar {
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
  background: #222;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
}

.header-left, .header-right {
  flex: 1;
  display: flex;
  align-items: center;
}

.header-right {
  justify-content: flex-end;
}

.header-title {
  font-weight: bold;
  font-size: 1.2em;
  letter-spacing: 0.05em;
  text-align: center;
}
/* Sidebar Toggle Button */
.sidebar-toggle {
  background: none;
  border: none;
  color: #ff9800;
  font-size: 1.5em;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  margin-right: 1rem;
  transition: transform 0.3s ease;
  outline: none;
}

.sidebar-toggle:hover {
  transform: scale(1.1);
}
/* Sidebar Overlay */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 90;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  right: -300px;
  width: 300px;
  height: 100vh;
  background-color: #1a1a1a;
  box-shadow: -2px 0 5px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
}

.sidebar.active {
  right: 0;
}

/* Sidebar Header */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.sidebar-header span {
  color: #ff9800;
  font-size: 1.2rem;
  font-weight: bold;
}

.sidebar-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
}

/* Fixed Categories Section */
.sidebar-categories-container {
  padding: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.sidebar-categories {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.sidebar-category {
  padding: 0.5rem 0.75rem;
  background-color: #2a2a2a;
  color: #fff;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
  display: inline-block;
  margin-bottom: 0.25rem;
}

.sidebar-category:hover {
  background-color: #333;
}

.sidebar-category.active {
  background-color: #333;
  color: #ff9800;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Scrollable Links Section */
.sidebar-links-container {
  padding: 1rem;
  overflow-y: auto;
  flex: 1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar-empty-message {
  color: #888;
  text-align: center;
  padding: 1rem;
  font-style: italic;
}

.sidebar-link-row {
  display: flex;
  align-items: center;
}

.sidebar-link-btn {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background-color: #232323;
  color: #ff9800;
  border-radius: 4px;
  text-decoration: none;
  width: 100%;
  gap: 0.6em;
  transition: background-color 0.2s;
}

.sidebar-link-btn:hover {
  background-color: #2a2a2a;
}

/* Fixed Footer/Settings Section */
.sidebar-footer {
  padding: 1rem;
  flex-shrink: 0;
}

.settings-section {
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-section-title {
  color: #ff9800;
  font-size: 1.1rem;
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-toggle-label {
  display: block;
  margin-bottom: 0.75rem;
  color: #fff;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.sidebar-toggle-label:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

/* Search Engine Selector */
.search-engine-selector {
  margin-top: 1rem;
  padding: 0.5rem;
  color: #fff;
}

.search-engine-selector label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: bold;
  color: #ddd;
}

.search-engine-dropdown {
  width: 100%;
  padding: 0.5rem;
  background-color: #333;
  color: #fff;
  border: 1px solid #444;
  border-radius: 4px;
  outline: none;
  cursor: pointer;
  font-family: inherit;
}

.search-engine-dropdown:focus {
  border-color: #ff9800;
  box-shadow: 0 0 0 2px rgba(255,152,0,0.18);
}

/* Body styles */
body {
  opacity: 0;
  transition: opacity 0.7s;
  background-color: #121212;
  color: #f0f0f0;
  font-family: 'Courier New', monospace;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  margin: 0;
  padding: 3.5rem 1rem 0;
  box-sizing: border-box;
  position: relative;
}
body.fade-in {
  opacity: 1;
}


.sfw-toggle-container {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 2.5rem;
  margin-bottom: 1.5rem;
}

.sfw-toggle-label {
  font-size: 1rem;
  color: #bbb;
  background: #181818;
  padding: 0.5em 1.2em;
  border-radius: 2em;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  display: flex;
  align-items: center;
  gap: 0.5em;
  cursor: pointer;
}

.sfw-toggle-label input[type="checkbox"] {
  accent-color: #ff9800;
  width: 1.1em;
  height: 1.1em;
  margin-right: 0.4em;
  vertical-align: middle;
}


.links-container {
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

h1 {
  font-size: 2.4em;
  margin-bottom: 0.5em;
  margin-top: 1em;
  text-align: center;
  font-family: 'Courier New', monospace;
  letter-spacing: 0.03em;
  font-weight: 700;
  color: #696969;
}
@media (min-width: 600px) {
  h1 {
    font-size: 3rem;
  }
} 
form {
  display: flex;
  flex-direction: row;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}

form input[type="text"] {
  background: #222;
  color: #eee;
  border: 1.5px solid #444;
  border-radius: 0.4em;
  padding: 0.7em 1em;
  font-size: 1em;
  transition: border 0.2s, box-shadow 0.2s;
  outline: none;
}
form input[type="text"]:focus, form input[type="text"]:hover {
  border-color: #ff9800;
  box-shadow: 0 0 0 2px rgba(255,152,0,0.18);
  background: #262626;
}

@media (max-width: 600px) {
  form {
    flex-direction: column;
    gap: 0.5rem;
    max-width: 100%;
  }
} 
input[type="text"] {
  padding: 0.75rem;
  font-size: 1rem;
  border: none;
  border-radius: 4px 0 0 4px;
  width: 100%;
  min-width: 0;
  flex: 1 1 0;
  box-sizing: border-box;
}
@media (max-width: 600px) {
  input[type="text"] {
    border-radius: 4px;
    width: 100%;
  }
} 
input[type="submit"] {
  padding: 0.75rem 1rem;
  font-size: 1rem;
  background-color: #ff5722;
  border: none;
  color: white;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
  min-width: 110px;
  transition: background 0.2s;
}
input[type="submit"]:hover, input[type="submit"]:focus {
  background-color: #ff784e;
  outline: none;
}
@media (max-width: 600px) {
  input[type="submit"] {
    border-radius: 4px;
    width: 100%;
    margin-top: 0.25rem;
  }
} 
.links {
  margin-top: 2rem;
}
.links-favorites {
  margin-top: 2.5em;
  margin-bottom: 1.5em;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.links-categories {
  margin-bottom: 1.5em;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.fav-section-title, .cat-section-title {
  width: 100%;
  text-align: center;
  margin-bottom: 0.5em;
  font-weight: bold;
  color: #fff;
  cursor: pointer;
  user-select: none;
  position: relative;
  padding: 0.3em 0;
}

/* Tab Navigation */
.category-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5em;
  margin-bottom: 1em;
  width: 100%;
}

.category-tab {
  padding: 0.5em 1em;
  background-color: #232323;
  color: #888;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  font-weight: bold;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.category-tab:hover {
  background-color: #2a2a2a;
  color: #aaa;
}

.category-tab.active {
  background-color: #333;
  color: #ff9800;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Links Container */
.links-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

/* Favorites Section */
.favorites-section {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5em 0.5em;
  width: 100%;
  margin-bottom: 1em;
  padding-bottom: 0.5em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* All Links Area */
.all-links-area {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5em 0.5em;
  width: 100%;
  transition: opacity 0.3s ease;
}

/* Link visibility */
.link-row {
  transition: opacity 0.3s ease, transform 0.2s ease;
}

.link-row.hidden {
  display: none;
}

.category-tab.active {
  background-color: #333;
  color: #ff9800;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.category-tab[data-category="all"] {
  background-color: #2a2a2a;
}

.links-categories {
  display: flex;
  flex-direction: column;
  gap: 1.2em 0;
  width: 100%;
  align-items: center;
}

.cat-section, .links-favorites > div:not(.fav-section-title) {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em 1em;
  margin-bottom: 0.5em;
  justify-content: center;
  width: 100%;
}
.link-row {
  display: inline-flex;
  align-items: center;
  margin-bottom: 0;
  margin-right: 0.5em;
  position: relative;
}
.link-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  position: relative;
  padding-top: 0;
  min-width: 100px;
  gap: 0.7em;
  color: #ff9800;
  padding: 0.75rem 0.9rem;
  font-size: 1rem;
  background-color: #232323;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  min-width: fit-content;
  width: auto;
  max-width: none;
  text-align: center;
  word-break: normal;
  box-sizing: border-box;
  flex: 0 1 auto;
  gap: 0.6em;
  overflow: visible;
}

.favicon {
  width: 20px;
  height: 20px;
  margin: 0;
  vertical-align: middle;
  flex-shrink: 0;
  border-radius: 4px;
  background: #181818;
  box-shadow: 0 1px 2px rgba(0,0,0,0.10);
  display: inline-block;
}
.btn-text {
  display: inline-block;
  vertical-align: middle;
  white-space: nowrap;
  overflow: visible;
  text-overflow: unset;
  min-width: 0;
}

.favicon {
  width: 20px;
  height: 20px;
  margin-right: 0.6em;
  vertical-align: middle;
  flex-shrink: 0;
  border-radius: 4px;
  background: #181818;
  box-shadow: 0 1px 2px rgba(0,0,0,0.10);
  display: inline-block;
}
.btn-text {
  display: inline-block;
  vertical-align: middle;
  white-space: nowrap;
  overflow: visible;
  text-overflow: unset;
}
@media (min-width: 601px) {
  .links {
    justify-content: center;
  }
  .link-btn {
    width: auto;
    max-width: 220px;
    flex: 1 1 110px;
  }
}

@media (max-width: 600px) {
  .links {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  .link-btn {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    font-size: 1.1rem;
    padding: 1rem;
    text-align: center;
    margin: 0;
    flex: none;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .btn-text {
    white-space: normal;
  }
}

.link-btn:hover, .link-btn:focus {
  background-color: #333333;
  color: #fff;
  outline: none;
}

.footer-links {
  width: 100%;
  text-align: center;
  margin: 2rem 0 0 0;
  font-size: 1rem;
  color: #888;
  letter-spacing: 0.02em;
}
.footer-links a {
  color: #888;
  text-decoration: none;
  margin: 0 0.2em;
  transition: color 0.2s;
}
.footer-links a:hover {
  color: #ff9800;
  text-decoration: underline;
}
