/* Modern UI Styles for EDID Reader */

:root {
  /* Modern Color Palette */
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --secondary-color: #64748b;
  --accent-color: #10b981;
  --background-color: #f8fafc;
  --surface-color: #ffffff;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
}

/* Typography */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

/* Layout Improvements */
#wrap {
  max-width: 1400px;
  width: 95%;
  margin: 0 auto;
  padding: 20px;
  background: transparent;
}

/* Modern Navigation */
.navbar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border: none;
  box-shadow: var(--shadow-md);
  border-radius: var(--radius-lg);
  margin-bottom: 2rem;
}

.navbar-inner {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0 2rem;
}

.navbar .brand {
  color: var(--primary-color);
  font-weight: 700;
  font-size: 1.5rem;
  text-decoration: none;
  padding: 1rem 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.navbar .brand svg {
  color: var(--primary-color);
}

.navbar .nav > li > a {
  color: var(--text-primary);
  font-weight: 500;
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.navbar .nav > li > a:hover {
  background-color: var(--primary-color);
  color: white;
}

.navbar .nav > li > a svg {
  transition: transform 0.2s ease;
}

.navbar .nav > li > a:hover svg {
  transform: scale(1.1);
}

/* Main Content Area */
#main {
  width: 100%;
  float: none;
  min-height: auto;
}

/* Modern Card Layout */
#edidWrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  width: 100%;
}

#inputTextBox, #edidParsed {
  background: var(--surface-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  float: none;
  width: auto;
  position: relative;
}

/* Input Section Styling */
#inputTextBox h3 {
  margin-top: 0;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
}

/* Modern Textarea */
#inputEdid, #outputEdid {
  width: 100%;
  min-height: 300px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  font-family: 'JetBrains Mono', 'Fira Code', Consolas, 'Liberation Mono', Courier, monospace;
  font-size: 13px;
  line-height: 1.5;
  background-color: #f8fafc;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  resize: vertical;
}

#inputEdid:focus, #outputEdid:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Modern Checkbox Group */
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  position: relative;
}

.checkbox-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkmark {
  position: relative;
  height: 18px;
  width: 18px;
  background-color: var(--surface-color);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  margin-right: 0.5rem;
  transition: all 0.2s ease;
}

.checkbox-label:hover .checkmark {
  border-color: var(--primary-color);
}

.checkbox-label input[type="checkbox"]:checked ~ .checkmark {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.checkmark:after {
  content: "";
  position: absolute;
  display: none;
  left: 5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox-label input[type="checkbox"]:checked ~ .checkmark:after {
  display: block;
}

/* Modern Button */
#parseButton, .btn-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  border: none;
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  position: static;
  margin-top: 1rem;
  font-size: 14px;
}

#parseButton:hover, .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

#parseButton svg {
  transition: transform 0.2s ease;
}

#parseButton:hover svg {
  transform: scale(1.1);
}

/* Parsed Data Section */
#edidParsed {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.parsed-section {
  background: transparent;
}

.parsed-section h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 1.125rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.parsed-section h3:before {
  content: "";
  width: 4px;
  height: 1.5rem;
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  border-radius: 2px;
}

#edidTreeviewWrapper {
  background: #f8fafc;
  border-radius: var(--radius-md);
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  width: auto;
  float: none;
  max-height: 400px;
  overflow-y: auto;
}

#edidDataWrapper {
  background: #f8fafc;
  border-radius: var(--radius-md);
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  width: auto;
  float: none;
  max-height: 400px;
  overflow-y: auto;
}

/* Custom scrollbar */
#edidTreeviewWrapper::-webkit-scrollbar,
#edidDataWrapper::-webkit-scrollbar {
  width: 6px;
}

#edidTreeviewWrapper::-webkit-scrollbar-track,
#edidDataWrapper::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 3px;
}

#edidTreeviewWrapper::-webkit-scrollbar-thumb,
#edidDataWrapper::-webkit-scrollbar-thumb {
  background: var(--secondary-color);
  border-radius: 3px;
}

#edidTreeviewWrapper::-webkit-scrollbar-thumb:hover,
#edidDataWrapper::-webkit-scrollbar-thumb:hover {
  background: var(--primary-color);
}

/* Tree View Improvements */
.angular-treeview {
  font-size: 14px;
}

.angular-treeview .tree-branch {
  padding: 0.25rem 0;
}

.angular-treeview .tree-label {
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  transition: background-color 0.2s ease;
}

.angular-treeview .tree-label:hover {
  background-color: var(--border-color);
}

/* Footer */
#footer {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-lg);
  margin-top: 3rem;
  padding: 2rem;
  text-align: center;
  color: var(--text-secondary);
  box-shadow: var(--shadow-md);
}

/* Responsive Design */
@media (max-width: 1024px) {
  #edidWrapper {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  #wrap {
    width: 98%;
    padding: 15px;
  }
}

@media (max-width: 768px) {
  .navbar-inner {
    padding: 0 1rem;
  }
  
  #inputTextBox, #edidParsed {
    padding: 1.5rem;
  }
  
  #inputEdid, #outputEdid {
    min-height: 200px;
  }
}

/* Loading States */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Success/Error States */
.success {
  border-color: var(--accent-color) !important;
}

.error {
  border-color: #ef4444 !important;
}

/* Animation Utilities */
.fade-in {
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  :root {
    --background-color: #0f172a;
    --surface-color: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: #334155;
  }
  
  body {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  }
  
  #inputEdid, #outputEdid {
    background-color: #0f172a;
    color: var(--text-primary);
  }
  
  #edidTreeviewWrapper, #edidDataWrapper {
    background: #0f172a;
  }
}