/* Reset and General Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Arial', sans-serif;
  background-color: #1a1a1a;
  color: #ffffff;
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

body.light-mode {
  background-color: #f4f4f4;
  color: #333333;
}

/* Container */
.container {
  display: flex;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 20px;
}

/* Sidebar */
.sidebar {
  width: 300px;
  padding: 20px;
  background-color: #2c2c2c;
  border-radius: 8px;
  margin-right: 20px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

body.light-mode .sidebar {
  background-color: #ffffff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.logo img {
  max-width: 100%;
  height: auto;
  margin-bottom: 20px;
}

#logInput {
  width: 100%;
  height: 150px;
  margin-bottom: 10px;
  padding: 10px;
  border-radius: 5px;
  border: 1px solid #444444;
  background-color: #333333;
  color: #ffffff;
  resize: vertical;
}

body.light-mode #logInput {
  background-color: #ffffff;
  border-color: #cccccc;
  color: #333333;
}

#fileInput {
  margin-bottom: 10px;
  color: #ffffff;
}

body.light-mode #fileInput {
  color: #333333;
}

.mode-toggle, .theme-toggle {
  margin-bottom: 10px;
}

.mode-toggle label, .theme-toggle label {
  margin-right: 10px;
  font-size: 14px;
}

button {
  padding: 10px;
  margin: 5px 0;
  width: 100%;
  border: none;
  border-radius: 5px;
  background-color: #007bff;
  color: #ffffff;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

button:hover {
  background-color: #0056b3;
}

body.light-mode button {
  background-color: #0069d9;
}

body.light-mode button:hover {
  background-color: #004085;
}

#collapseLogsBtn {
  width: auto;
  margin-bottom: 10px;
  padding: 8px 16px;
}

/* Main Content */
.main-content {
  flex: 1;
  padding: 20px;
  background-color: #2c2c2c;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
}

body.light-mode .main-content {
  background-color: #ffffff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

#summary {
  margin-bottom: 20px;
  font-size: 1.1em;
  text-align: center;
}

#summary .filter-link {
  cursor: pointer;
  margin: 0 10px;
  color: #007bff;
  text-decoration: none;
  transition: color 0.3s ease;
}

#summary .filter-link:hover {
  text-decoration: underline;
}

#summary .filter-link.active {
  font-weight: bold;
  text-decoration: underline;
}

body.light-mode #summary .filter-link {
  color: #0056b3;
}

.error-count {
  color: #ff4d4d;
  font-weight: bold;
}

.warning-count {
  color: #ffcc00;
  font-weight: bold;
}

.info-count {
  color: #00ccff;
}

body.light-mode .error-count {
  color: #d32f2f;
}

body.light-mode .warning-count {
  color: #e0a800;
}

body.light-mode .info-count {
  color: #0288d1;
}

#faultSummary {
  width: 100%;
  max-width: 1000px;
  margin-bottom: 20px;
  padding: 10px;
  background-color: #444444;
  border-radius: 5px;
}

body.light-mode #faultSummary {
  background-color: #f0f0f0;
}

#faultSummary h3 {
  margin-bottom: 10px;
}

#faultSummary table {
  width: 100%;
  border-collapse: collapse;
}

#faultSummary th, #faultSummary td {
  padding: 8px;
  border: 1px solid #666666;
  text-align: left;
}

#faultSummary th {
  background-color: #555555;
}

body.light-mode #faultSummary th {
  background-color: #e0e0e0;
}

#faultSummary a {
  color: #007bff;
  text-decoration: none;
}

body.light-mode #faultSummary a {
  color: #0056b3;
}

#translatedLogs {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
}

.log-entry {
  display: flex;
  flex-direction: column;
  padding: 15px;
  margin-bottom: 15px;
  border-radius: 5px;
  background-color: #333333;
  border: 1px solid #444444;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

body.light-mode .log-entry {
  background-color: #ffffff;
  border-color: #cccccc;
}

.log-entry.error {
  background-color: #4d0000;
  border: 2px solid #ff4d4d;
}

body.light-mode .log-entry.error {
  background-color: #ffe6e6;
  border-color: #d32f2f;
}

.log-entry.warning {
  background-color: #4d3d00;
  border: 2px solid #ffcc00;
}

body.light-mode .log-entry.warning {
  background-color: #fff9e6;
  border-color: #e0a800;
}

.log-entry.info {
  border: 1px solid #00ccff;
}

body.light-mode .log-entry.info {
  border-color: #0288d1;
}

.log-entry .log-header {
  display: flex;
  align-items: center;
  margin-bottom: 5px;
}

.log-entry .toggle-icon {
  width: 20px;
  margin-right: 10px;
}

.log-entry .toggle-icon::before {
  content: '\f0da';
  font-family: 'Font Awesome 5 Free';
  font-weight: 900;
  color: #007bff;
}

body.light-mode .log-entry .toggle-icon::before {
  color: #0056b3;
}

.log-entry.active .toggle-icon::before,
.log-entry.auto-expand .toggle-icon::before {
  content: '\f0d7';
}

.log-entry .highlight {
  font-weight: bold;
  margin-right: 10px;
}

.log-entry .log-content {
  margin-left: 30px;
}

.log-entry .log-details {
  display: none;
  margin-top: 10px;
  padding: 10px;
  background-color: #444444;
  border-radius: 5px;
  font-size: 0.9em;
}

body.light-mode .log-entry .log-details {
  background-color: #f0f0f0;
}

.log-entry.active .log-details,
.log-entry.auto-expand .log-details {
  display: block;
}

.log-entry i.fas {
  margin-right: 8px;
  font-size: 16px;
}

.log-entry.error i.fas {
  color: #ff4d4d;
}

body.light-mode .log-entry.error i.fas {
  color: #d32f2f;
}

.log-entry.warning i.fas {
  color: #ffcc00;
}

body.light-mode .log-entry.warning i.fas {
  color: #e0a800;
}

.log-entry.info i.fas {
  color: #00ccff;
}

body.light-mode .log-entry.info i.fas {
  color: #0288d1;
}

#timeSyncWarning {
  display: none;
  background-color: #ff4d4d;
  color: #ffffff;
  padding: 10px;
  margin-bottom: 20px;
  border-radius: 5px;
  text-align: center;
  width: 100%;
  max-width: 1000px;
  font-weight: bold;
}

body.light-mode #timeSyncWarning {
  background-color: #d32f2f;
}

/* Terms Overlay */
#termsOverlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

#termsOverlay.show {
  display: flex;
}

.terms-content {
  background-color: #333333;
  padding: 20px;
  border-radius: 8px;
  max-width: 500px;
  text-align: center;
}

body.light-mode .terms-content {
  background-color: #ffffff;
}

.terms-content h2 {
  margin-bottom: 20px;
}

.terms-content p {
  margin-bottom: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    flex-direction: column;
    padding: 10px;
  }

  .sidebar {
    width: 100%;
    margin-right: 0;
    margin-bottom: 20px;
  }

  .main-content {
    width: 100%;
  }

  #translatedLogs {
    max-width: 100%;
  }

  #summary {
    font-size: 1em;
  }

  #summary .filter-link {
    margin: 0 5px;
  }

  #faultSummary {
    font-size: 0.9em;
  }

  #faultSummary table {
    font-size: 0.8em;
  }
}