/* ===== Variables and Themes ===== */
:root {
  --background-color: #f1f1f1;
  --text-color: #333;
  --container-bg: white;
  --output-bg: #eee;
  --button-bg: #007bff;
  --button-hover: #0056b3;
  --button-text: white;
  --nav-hover-bg: #f8f9fa;
  --box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
  --background-color: #222;
  --text-color: #f1f1f1;
  --container-bg: #333;
  --output-bg: #444;
  --button-bg: #0056b3;
  --button-hover: #007bff;
  --button-text: white;
  --nav-hover-bg: #444;
  --box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
}

/* ===== Base Elements ===== */
html {
  scroll-behavior: smooth;
}

body {
  font-family: sans-serif;
  background: var(--background-color);
  color: var(--text-color);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  transition: background-color 0.3s, color 0.3s;
}

/* ===== Header and Navigation ===== */
header {
  width: 100%;
  background-color: var(--container-bg);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 1);
  border-radius: 0 0 12px 12px;
  margin-bottom: 20px;
  padding: 0.5rem 1rem;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  width: 100%;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.logo a {
  text-decoration: none;
  color: var(--text-color);
  font-size: 1.5rem;
  font-weight: bold;
  transition: color 0.3s;
}

.logo a:hover {
  color: var(--button-hover);
}

/* --- Navigation & Dropdown Fix --- */
.header-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}


.nav-link,
.dropbtn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 15px;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-color);
  background-color: transparent;
  text-decoration: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
  transition: background-color 0.2s, color 0.2s;
  margin: 0;
}

.nav-link:hover,
.dropbtn:hover {
  background-color: var(--nav-hover-bg);
  color: var(--button-hover);
}

/* Dropdown Container */
.dropdown {
  position: relative;
  display: flex;
  align-items: center;
}



.dropdown-content::before {
  content: "";
  position: absolute;
  top: -20px; 
  left: 0;
  width: 100%;
  height: 20px; 
  background: transparent;
  display: block;
}


.dropbtn::after {
  content: "▼";
  font-size: 0.7em;
  margin-left: 6px;
  position: relative;
  top: 1px;
}


.dropdown-content {
  display: none;
  position: absolute;
  background-color: var(--container-bg);
  min-width: 200px;
  box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
  border-radius: 8px;
  z-index: 1001;
  top: 100%;
  left: 0;
  margin-top: 5px;
  overflow: hidden;
  text-align: left;
}

.dropdown-content a {
  color: var(--text-color);
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  font-size: 0.95rem;
  transition: background-color 0.2s;
}

.dropdown-content a:hover {
  background-color: var(--nav-hover-bg);
  color: var(--button-hover);
}

.dropdown:hover .dropdown-content {
  display: block;
}

/* Indicator Tool Activ */
.active-tool {
  font-weight: bold;
  border-left: 4px solid var(--button-bg);
  background-color: var(--nav-hover-bg);
}

/* ===== Main Layout ===== */
main {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.container {
  background: var(--container-bg);
  padding: 20px;
  border-radius: 12px;
  box-shadow: var(--box-shadow);
  width: 100%;
  max-width: 600px;
  transition: background-color 0.3s, box-shadow 0.3s;
}

.container h2 {
  text-align: center;
  margin-bottom: 20px;
}

.info-section {
  width: 100%;
  max-width: 600px;
  margin: 20px auto;
  padding: 2rem;
  background: var(--container-bg);
  border-radius: 12px;
  box-shadow: var(--box-shadow);
  text-align: center;
}

.info-section ul {
  list-style-position: inside;
  text-align: left;
  padding-left: 0;
  margin-top: 1rem;
}

.info-section li {
  margin-bottom: 0.5rem;
}

/* ===== Footer ===== */
footer {
  width: 100%;
  text-align: center;
  padding: 1rem;
  background-color: var(--container-bg);
  box-shadow: var(--box-shadow);
  border-radius: 12px;
  margin-top: 20px;
}

footer a,
.info-section a {
  color: var(--button-bg);
  text-decoration: none;
  transition: color 0.3s;
}

footer a:hover,
.info-section a:hover {
  color: var(--button-hover);
  text-decoration: underline;
}

/* ===== Form Elements ===== */
label {
  display: block;
  margin-top: 10px;
  font-weight: bold;
}

input[type="number"],
input[type="text"] {
  width: 100%;
  padding: 10px;
  margin-top: 5px;
  background-color: var(--output-bg);
  color: var(--text-color);
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
}

input[type="number"] {
  width: 80px;
}

/* Output Universal */
.output {
  margin-top: 15px;
  padding: 10px;
  background: var(--output-bg);
  border-radius: 5px;
  transition: background-color 0.3s;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  word-break: break-all;
  min-height: 50px;
}

/* Specific QR */
#qrcode {
  min-height: 200px;
}

button {
  width: 100%;
  padding: 12px;
  margin-top: 20px;
  background: var(--button-bg);
  color: var(--button-text);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.3s;
}

button:hover {
  background: var(--button-hover);
}

.feedback {
  text-align: center;
  margin-top: 10px;
  color: green;
}

/* ===== Theme Switch ===== */
.theme-switch-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.theme-switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 30px;
  margin: 0 10px;
}

.theme-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

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

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

input:checked + .slider {
  background-color: #007bff;
}

input:checked + .slider:before {
  transform: translateX(30px);
}

.theme-icon {
  font-size: 18px;
}


@media (max-width: 768px) {
 
  .theme-switch-container {
    display: none;
  }


  .header-content {
    flex-direction: column;
    align-items: center;
    padding: 1rem 0.5rem;
    gap: 10px; 
  }

  .header-left {
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }


  .header-nav {
    width: 100%;
    justify-content: center; 
    gap: 5px; 
    flex-wrap: wrap; 
  }

 
  .nav-link, 
  .dropbtn {
    padding: 8px 10px;
    font-size: 0.95rem;
  }


  .container, 
  .info-section {
    padding: 15px;
    width: 95%;
  }
  

  h2 {
    font-size: 1.5rem;
  }
}

/* ===== Download Button (QR Specific) ===== */
.btn-download {
  display: none; 
  background-color: #28a745; 
  margin-top: 15px;
}

.btn-download:hover {
  background-color: #218838; 
}