/* Settings Modal Styles */

/* Field Styles */
.field {
  display: grid;
  grid-template-columns: 60% 1fr;
  align-items: center;
  margin-block: 1rem;
  padding: var(--spacing-xs) 0;
}

.field.field-full {
  grid-template-columns: 1fr;
}

/* Field Labels */
.field-label {
  display: flex;
  flex-direction: column;
  padding-right: 0.5em;
}

.field-title {
  font-weight: bold;
  color: var(--color-primary);
}

.field-description {
  color: var(--color-text);
  font-size: 0.875rem;
  opacity: 0.8;
  margin: 0.25rem 0 0.5rem 0;
}

/* Field Controls */
.field-control {
  width: 100%;
  display: flex;
  align-items: center;
}

/* Input Styles */
input[type="text"],
input[type="password"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: 0.25rem;
  background-color: var(--color-background);
  color: var(--color-text);
  font-family: "Rubik", Arial, Helvetica, sans-serif;
  outline: none;
  transition: all 0.3s ease;
}

textarea {
  min-height: 100px;
  font-family: 'Roboto Mono', monospace;
  scroll-behavior: smooth;
  resize: none;
  background-clip: border-box;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
textarea:focus {
  background-color: var(--color-background);
  filter: brightness(1.2);
}

.light-mode input[type="text"]:focus,
.light-mode input[type="number"]:focus,
.light-mode input[type="password"]:focus, 
.light-mode textarea:focus {
  filter: brightness(1.1);
}

/* Button Disabled State */
.btn-disabled,
.btn-ok.btn-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Toggle Switch Styles */
.toggle {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggler {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  border-radius: 34px;
  cursor: pointer;
  transition: 0.4s;
}

.toggler:before {
  content: "";
  position: absolute;
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  border-radius: 50%;
  transition: 0.4s;
}

input:checked + .toggler {
  background-color: #2196f3;
}

input:checked + .toggler:before {
  transform: translateX(26px);
}

/* Select Styles */
select {
  cursor: pointer;
}

select:disabled {
  background-color: var(--color-background);
  cursor: not-allowed;
}

/* Navigation Links */
#settings-sections {
  padding-bottom: 1rem;
}

nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}

nav ul li {
  display: flex;
  font-weight: 500;
}

nav ul li a {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  color: var(--color-text);
  opacity: 0.8;
  background-color: var(--color-panel);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1rem;
  width: 100%;
  transition: all 0.2s ease-in-out;
}

nav ul li a:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  background-color: var(--color-secondary);
}

nav ul li a img {
  width: 50px;
  height: 50px;
  margin-bottom: 0.5rem;
  filter: var(--svg-filter);
}

.light-mode nav ul li a {
  background-color: var(--color-panel-light);
}

.light-mode nav ul li a:hover {
  background-color: var(--color-secondary-light);
}

/* Responsive Design */
@media (max-width: 768px) {
  .field-control {
    width: 100%;
  }

  .field-description {
    padding-bottom: var(--spacing-sm);
  }

  .field {
    display: block;
    align-items: center;
    padding: var(--spacing-xs) 0;
  }
}

@media (max-width: 640px) {
  nav ul {
    grid-template-columns: repeat(2, 1.2fr);
  }
}

@media (max-width: 480px) {
  nav ul {
    grid-template-columns: 1fr;
  }

  nav ul li a {
    flex-direction: row;
    justify-content: flex-start;
    gap: 1rem;
    padding: 0.75rem 1rem;
  }

  nav ul li a img {
    margin-bottom: 0;
    width: 30px;
    height: 30px;
  }
}

/* Settings Tab Styles */
.settings-tabs-container {
  width: 100%;
  margin-bottom: 8px;
  padding: 0;
  margin-top: 20px;
  position: relative;
  overflow: visible;
}

.settings-tabs {
  display: flex;
  width: 100%;
  position: relative;
  gap: 5px;
  border-bottom: 3px solid var(--color-border);
  justify-content: flex-start;
  padding-left: 20px;
  padding-top: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
}

.settings-tabs::-webkit-scrollbar {
  display: none;
}

.settings-tabs::before,
.settings-tabs::after {
  content: '';
  position: absolute;
  top: 2px;
  bottom: 3px;
  width: 20px;
  pointer-events: none;
  z-index: 2;
  opacity: 0.7;
}

.settings-tabs::before {
  left: 0;
}

.settings-tabs::after {
  right: 0;
}

.settings-tab {
  padding: 8px 16px;
  cursor: pointer;
  position: relative;
  color: var(--color-text);
  border: 2px solid var(--color-border);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  transition: all 0.3s ease;
  background-color: var(--color-panel);
  margin-bottom: -3px;
  z-index: 1;
  min-width: min-content;
  width: auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 0;
}

.settings-tab:not(.active) {
  opacity: 0.8;
  border-bottom: 3px solid var(--color-border);
  background-color: var(--color-background);
}

.settings-tab.active {
  border-color: var(--color-border);
  /* box-shadow:
    0 -4px 8px -2px var(--color-border),
    4px 0 8px -2px var(--color-border),
    -4px 0 8px -2px var(--color-border); */
  font-weight: bold;
  background-color: var(--color-panel);
  min-width: min-content;
  max-width: 150px;
}


/* Responsive Design for Settings Tabs */
@media (max-width: 640px) {
  .settings-tabs {
    gap: 2px;
    padding-left: 10px;
  }

  .settings-tab {
    padding: 6px 12px;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .settings-tabs {
    padding-left: 5px;
  }

  .settings-tab {
    flex: 0 0 auto;
    text-align: center;
    min-width: min-content;
    max-width: 150px;
  }
  .settings-tab.active {
    min-width: min-content;
    max-width: 150px;
  }
}

/* Section Styles */
.section {
  margin-bottom: 2rem;
  padding: 1rem;
  padding-bottom: 0;
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  overflow-x: visible;
  width: 100%;
  min-width: min-content;
  display: block;
  box-sizing: border-box;
}

.section-title {
  font-size: 1.25rem;
  font-weight: bold;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}

.section-description {
  color: var(--color-text);
  margin-bottom: 1rem;
}

/* Scrollbar styling for sections */
.section::-webkit-scrollbar {
  height: 10px;
  background-color: rgba(0, 0, 0, 0.1);
}

.section::-webkit-scrollbar-thumb {
  background-color: rgba(155, 155, 155, 0.7);
  border-radius: 5px;
}

.section::-webkit-scrollbar-thumb:hover {
  background-color: rgba(155, 155, 155, 0.9);
}

@media (max-width: 1280px) {
  .section::-webkit-scrollbar {
    height: 10px;
    background-color: rgba(0, 0, 0, 0.1);
  }

  .section::-webkit-scrollbar-thumb {
    background-color: rgba(155, 155, 155, 0.7);
    border-radius: 5px;
  }

  .section::-webkit-scrollbar-thumb:hover {
    background-color: rgba(155, 155, 155, 0.9);
  }
}
