@import url(https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css);

:root {
  --background-color: #1e1e1e;
  --text-color: #d4d4d4;
  --primary-color: #0e639c;
  --primary-hover-color: #17b;
  --danger-color: #c0392b;
  --danger-hover-color: #e74c3c;
  --container-bg-color: #252526;
  --border-color: #3c3c3c;
  --input-bg-color: #3a3a3a;
  --warning-bg-color: #443813;
  --warning-border-color: #b89b4b;
}

body {
  background-color: var(--background-color);
  color: var(--text-color);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 0;
}

.container {
  width: 100%;
  max-width: 1400px;
  margin: 2rem auto;
  padding: 2rem;
  background-color: var(--container-bg-color);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

header {
  text-align: center;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.5rem;
  position: relative;
}

header h1 {
  margin: 0 0 0.5rem 0;
  color: var(--primary-hover-color);
}

header p {
  margin: 0;
  font-size: 1.1em;
  color: #a0a0a0;
}

#how-to-use-link {
    position: absolute;
    top: 0;
    right: 0;
    color: var(--primary-hover-color);
    text-decoration: none;
    font-size: 1em;
    transition: color 0.2s;
}

#how-to-use-link:hover {
    color: #fff;
    text-decoration: underline;
}

#how-to-use-link .fas {
    margin-right: 0.5rem;
}


.warning {
  margin-top: 1rem;
  padding: 0.8rem 1rem;
  background-color: var(--warning-bg-color);
  border: 1px solid var(--warning-border-color);
  color: #f0e6d2;
  border-radius: 4px;
  text-align: left;
}

.main-content {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.sidebar {
  flex: 1;
  max-width: 400px;
  position: sticky;
  top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  background-color: #2d2d30;
  padding: 1.5rem;
  border-radius: 6px;
  width: 100%;
  box-sizing: border-box;
}

.control-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  width: 100%;
}

.credentials-group {
  background-color: #252526;
  padding: 1rem;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

.control-group.button-row {
  flex-direction: row;
  justify-content: flex-start;
  flex-wrap: wrap;
}

#folder-info {
  font-style: italic;
  color: #a0a0a0;
  text-align: left;
}

button {
  background: var(--primary-color);
  color: #fff;
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1em;
  font-weight: bold;
  transition: background-color 0.2s;
}

button:hover:not(:disabled) {
  background: var(--primary-hover-color);
}

button:disabled {
  background-color: #555;
  cursor: not-allowed;
  opacity: 0.7;
}

#stop-btn {
  background-color: var(--danger-color);
}
#stop-btn:hover:not(:disabled) {
  background-color: var(--danger-hover-color);
}


#download-btn {
  background-color: #3e8e41; /* Green */
}

#download-btn:hover:not(:disabled) {
  background-color: #4caf50;
}

#download-valid-btn {
  background-color: #007bff; /* Blue */
}

#download-valid-btn:hover:not(:disabled) {
  background-color: #0069d9;
}

input[type="text"],
input[type="password"],
select {
  background-color: var(--input-bg-color);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  padding: 0.7rem;
  border-radius: 4px;
  font-size: 1em;
  width: 100%;
  box-sizing: border-box;
}

#status {
  text-align: left;
  font-size: 1.1em;
  min-height: 1.5em;
  padding: 1rem;
  background-color: #2d2d30;
  border-radius: 6px;
  line-height: 1.6;
}

#status.success {
  color: #2ecc71;
  font-weight: bold;
}

#status.error, #status .error {
  color: #e74c3c;
  font-weight: bold;
}

#status code {
  background-color: var(--background-color);
  padding: 2px 5px;
  border-radius: 3px;
  font-family: Consolas, monaco, monospace;
}

.help-text {
  font-size: 0.9em;
  color: #a0a0a0;
  margin-top: 0.25rem;
}

.help-text a {
  color: var(--primary-hover-color);
  text-decoration: none;
}

.help-text a:hover {
  text-decoration: underline;
}

.results-panel {
  flex: 3;
  min-width: 0;
}

.results-category {
  border-top: 1px solid var(--border-color);
  padding-top: 1.5rem;
  margin-bottom: 2rem;
}

.results-category h2 {
  margin-top: 0;
  color: var(--primary-hover-color);
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
}

.result-item {
  background-color: #2d2d30;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  transition: transform 0.2s, box-shadow 0.2s;
}

.result-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.result-item img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
}

.result-info {
  padding: 1rem;
  font-size: 0.9em;
}

.result-info p {
  margin: 0 0 0.5rem 0;
  word-wrap: break-word;
}

.result-info .path {
  font-style: italic;
  color: #a0a0a0;
}

.result-info .reason {
  font-weight: bold;
  color: #ff9999;
}

#progress-container {
  width: 100%;
  padding: 1rem;
  background-color: #2d2d30;
  border-radius: 6px;
  box-sizing: border-box;
}

#progress-text {
  margin-bottom: 0.5rem;
  font-size: 0.9em;
  color: #a0a0a0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.progress-bar-wrapper {
  width: 100%;
  background-color: var(--input-bg-color);
  border-radius: 4px;
  height: 10px;
  overflow: hidden;
}

#progress-bar {
  width: 0%;
  height: 100%;
  background-color: var(--primary-color);
  border-radius: 4px;
  transition: width 0.2s ease-in-out;
}

.input-with-button {
  display: flex;
  width: 100%;
  gap: 0.5rem;
  align-items: center;
}

.input-with-button input {
  flex-grow: 1;
}

.input-with-button button {
  flex-shrink: 0;
  padding: 0.7rem 1rem;
  background-color: #555;
  font-size: 0.9em;
  font-weight: normal;
}

.input-with-button button:hover:not(:disabled) {
  background-color: #666;
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background-color: var(--container-bg-color);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.5);
  text-align: center;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.access-modal {
  width: 90%;
  max-width: 400px;
}

.access-modal h2 {
    color: var(--primary-hover-color);
}

.access-modal input {
    margin-top: 1rem;
}

.access-modal button {
    margin-top: 1rem;
    width: 100%;
}

.error-text {
    color: var(--danger-color);
    margin-top: 1rem;
    height: 1.2em;
}

.how-to-use-modal {
    width: 90%;
    max-width: 800px;
    text-align: left;
    line-height: 1.7;
}

.how-to-use-modal h2, .how-to-use-modal h4 {
    color: var(--primary-hover-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-top: 1.5rem;
}

.how-to-use-modal h2 .fas, .how-to-use-modal h5 .fas {
    margin-right: 0.75rem;
}


.how-to-use-modal ul, .how-to-use-modal ol {
    padding-left: 20px;
}

.how-to-use-modal li {
    margin-bottom: 0.5rem;
}

.close-modal-btn {
  position: absolute;
  top: 10px;
  right: 15px;
  background: none;
  border: none;
  color: #aaa;
  font-size: 2rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.close-modal-btn:hover {
  color: #fff;
}

.engine-info {
    background-color: #2d2d30;
    border-left: 4px solid var(--primary-color);
    padding: 1rem 1.5rem;
    margin: 1rem 0;
    border-radius: 4px;
}

.engine-info h5 {
    margin: 0 0 0.5rem 0;
    color: var(--text-color);
}
