/* Universal Form Container */
.form-container {
    max-width: 450px;
    margin: 5rem auto;
    padding: 2.5rem;
    background: rgba(15, 23, 42, 0.6); /* Semi-transparent dark blue */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    color: #e2e8f0;
}

/* General body and link styles */
body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(-45deg, #0f172a, #1e293b, #334155, #475569);
    background-size: 400% 400%;
    animation: gradient 15s ease infinite;
    color: #e2e8f0;
}

@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

html, body {
    margin: 0;
    padding: 0;
}

.background {
    position: fixed;
    display: block;
    top: 0;
    left: 0;
    z-index: -1;
    width: 100%;
    height: 100%;
}

.hero-section {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cta-button {
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
}

.feature-card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 2rem;
  color: white;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 30px rgba(0, 0, 0, 0.2);
}

.how-it-works-section .step {
  max-width: 250px;
}

.step-number {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: bold;
  margin: 0 auto;
  border: 2px solid white;
}

.step-arrow {
  font-size: 2rem;
  color: #3b82f6;
}

html:not(.dark) body {
    background-color: #f4f4f4; /* Light gray for light mode background */
}

a {
    color: #38bdf8; /* A bright blue for links in dark mode */
}

/* Alert box styles */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 4px;
}

.alert-danger {
    color: #a94442;
    background-color: #f2dede;
    border-color: #ebccd1;
}

.alert-success {
    color: #3c763d;
    background-color: #dff0d8;
    border-color: #d6e9c6;
}

.alert-info {
    color: #31708f;
    background-color: #d9edf7;
    border-color: #bce8f1;
}

/* Form input and button styles */
input[type=text], input[type=password], input[type=email] {
    width: 100%;
    padding: 12px 15px;
    margin-top: 8px;
    background-color: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    box-sizing: border-box;
    transition: border-color 0.3s, box-shadow 0.3s;
}

input[type=text]:focus, input[type=password]:focus, input[type=email]:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5);
    outline: none;
}

input[type=submit] {
    width: 100%;
    background-color: #3b82f6;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s, box-shadow 0.3s;
}

input[type=submit]:hover {
    background-color: #2563eb;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.5);
}

/* Styles from app.html */
#mynetwork { width: 100%; height: 100%; border: 1px solid #374151; }
.modal { display: none; position: fixed; z-index: 50; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.6); backdrop-filter: blur(5px); }
.modal-content { background-color: #1f2937; margin: 10% auto; padding: 20px; border: 1px solid #4b5563; width: 80%; max-width: 600px; border-radius: 16px; box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37); }
.close, .close-upload-modal { color: #9ca3af; float: right; font-size: 28px; font-weight: bold; }
.close:hover, .close:focus, .close-upload-modal:hover, .close-upload-modal:focus { color: white; text-decoration: none; cursor: pointer; }
#context-menu { display: none; position: absolute; z-index: 100; background-color: #1f2937; min-width: 160px; box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); padding: 0; margin: 0; border: 1px solid #4b5563; border-radius: 5px; }
#context-menu a { color: #d1d5db; padding: 12px 16px; text-decoration: none; display: block; }
#context-menu a:hover { background-color: #374151; }
.main-content { flex-grow: 1; display: flex; flex-direction: column; }
#upload-container { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem; color: #d1d5db; }
.drop-zone { border: 2px dashed #4b5563; border-radius: 10px; padding: 40px 20px; text-align: center; cursor: pointer; margin-bottom: 20px; width: 100%; height: 150px; display: flex; align-items: center; justify-content: center;}
.drop-zone.dragover { border-color: #3b82f6; }
#file-list-container { margin-top: 20px; width: 100%; }
#file-list { list-style: none; padding: 0; }
#file-list li { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; padding: 10px; background-color: #374151; border-radius: 5px; }
#file-list li span { flex-grow: 1; }
#file-list li input { width: 60px; margin-left: 10px; text-align: center; background-color: #4b5563; border: 1px solid #6b7280; color: white; border-radius: 4px; }
.tab { overflow: hidden; border: 1px solid #4b5563; background-color: #1f2937; }
.tab button { background-color: inherit; float: left; border: none; outline: none; cursor: pointer; padding: 14px 16px; transition: 0.3s; color: #d1d5db; }
.tab button:hover { background-color: #374151; }
.tab button.active { background-color: #4b5563; }
.tabcontent { display: none; padding: 6px 12px; border: 1px solid #4b5563; border-top: none; height: 100%; }
#graph-area {
}
#chain-flow-network, #mynetwork, .bteq-view > div {
    width: 100%;
    height: 100%;
    border: 1px solid #374151;
}
#flow-container { display: flex; flex-direction: row; flex-grow: 1; }
#flow-main { width: 75%; display: flex; flex-direction: column; }
#metadata-sidebar { width: 25%; padding-left: 20px; border-left: 1px solid #374151; background-color: #111827; overflow-y: auto; }
#metadata-table { width: 100%; border-collapse: collapse; }
#metadata-table th, #metadata-table td { border: 1px solid #4b5563; padding: 8px; text-align: left; }
#metadata-table th { background-color: #374151; }

/* Dark mode styles for app.html */
.main-content { color: #d1d5db; }
.drop-zone { border-color: #4b5563; color: #d1d5db; }
.drop-zone p { color: #d1d5db; }
#file-list li { background-color: #374151; border-color: #4b5563; color: #d1d5db; }
#file-list li input { background-color: #4b5563; border-color: #6b7280; color: white; }
.tab { border-color: #4b5563; background-color: #1f2937; }
.tab button { color: #d1d5db; }
.tab button:hover { background-color: #374151; }
.tab button.active { background-color: #4b5563; }
.tabcontent { border-color: #4b5563; }
#mynetwork, #chain-flow-network { border-color: #4b5563; }
#metadata-table th, #metadata-table td { border-color: #4b5563; }
#metadata-table th { background-color: #374151; }
.modal-content { background-color: #1f2937; border-color: #4b5563; color: #d1d5db; }
.close { color: #9ca3af; }
.close:hover, .close:focus { color: white; }
#context-menu { background-color: #1f2937; border-color: #4b5563; }
#context-menu a { color: #d1d5db; }
#context-menu a:hover { background-color: #374151; }

/* Admin Panel Styles */
.admin-wrapper { display: flex; }
.sidebar { width: 250px; background-color: #343a40; color: white; min-height: 100vh; }
.sidebar h2 { text-align: center; padding: 20px 0; margin: 0; background-color: #454d55; }
.sidebar ul { list-style-type: none; padding: 0; margin: 0; }
.sidebar ul li a { display: block; color: #adb5bd; padding: 15px 20px; text-decoration: none; }
.sidebar ul li a:hover, .sidebar ul li a.active { background-color: #495057; color: white; }
.main-content { flex-grow: 1; padding: 40px; }
.main-content h1 { border-bottom: 2px solid #dee2e6; padding-bottom: 10px; }

/* Dark mode for admin panel */
.sidebar { background-color: #1f2937; border-right: 1px solid #374151; }
.sidebar h2 { background-color: #374151; }
.sidebar ul li a { color: #9ca3af; }
.sidebar ul li a:hover, .sidebar ul li a.active { background-color: #374151; color: white; }
.main-content { background-color: #111827; color: #d1d5db; }
.main-content h1 { border-bottom-color: #374151; }

/* Admin Form Styles */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: .5rem; font-weight: bold; }
.form-group input[type=text], .form-group textarea, .form-control { width: 100%; padding: .5rem; border: 1px solid #ced4da; border-radius: .25rem; box-sizing: border-box; }
.form-group textarea { min-height: 150px; }
.btn-primary { background-color: #007bff; color: white; padding: 10px 20px; border: none; border-radius: 5px; cursor: pointer; font-size: 1rem; }
.btn-primary:hover { background-color: #0056b3; }
.btn-secondary { background-color: #6c757d; color: white; }
.btn-success { background-color: #28a745; color: white; }
.btn-success:hover { background-color: #218838; }

/* Dark mode for admin forms */
.form-group label { color: #d1d5db; }
.form-group input[type=text], .form-group textarea, .form-control { background-color: #374151; border-color: #4b5563; color: white; }
.alert-success { color: #a3e635; background-color: #27272a; border-color: #3f3f46; }
.btn-secondary { background-color: #4b5563; }

/* Admin Suggestions Styles */
.suggestion-card { background-color: #fff; border: 1px solid #dee2e6; border-radius: 5px; padding: 20px; margin-bottom: 20px; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.suggestion-meta { font-size: 0.9rem; color: #6c757d; margin-bottom: 10px; border-bottom: 1px solid #eee; padding-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }
.suggestion-text { white-space: pre-wrap; }
.delete-btn { background-color: #dc3545; color: white; border: none; padding: 5px 10px; border-radius: 3px; cursor: pointer; font-size: 0.8rem; }
.delete-btn:hover { background-color: #c82333; }

/* Dark mode for admin suggestions */
.suggestion-card { background-color: #374151; border-color: #4b5563; }
.suggestion-meta { color: #9ca3af; border-bottom-color: #4b5563; }
.suggestion-text { color: #d1d5db; }

/* Admin Data Table Styles */
.user-table, .data-table { width: 100%; border-collapse: collapse; margin-top: 20px; }
.user-table th, .user-table td, .data-table th, .data-table td { border: 1px solid #dee2e6; padding: 12px; text-align: left; }
.user-table th, .data-table th { background-color: #e9ecef; font-weight: 600; }
.user-table tbody tr:nth-child(odd), .data-table tbody tr:nth-child(odd) { background-color: #f8f9fa; }
.user-table tbody tr:hover, .data-table tbody tr:hover { background-color: #e2e6ea; }
.btn { padding: 8px 12px; text-decoration: none; border-radius: 4px; color: white; }
.btn-primary { background-color: #007bff; }
.btn-danger { background-color: #dc3545; }
.btn-sm { font-size: 0.875rem; padding: 5px 10px; }
.action-links a { margin-right: 10px; }
.header-actions { display: flex; justify-content: space-between; align-items: center; }

/* Dark mode for admin data table */
.user-table th, .user-table td, .data-table th, .data-table td { border-color: #4b5563; }
.user-table th, .data-table th { background-color: #374151; }
.user-table tbody tr:nth-child(odd), .data-table tbody tr:nth-child(odd) { background-color: #1f2937; }
.user-table tbody tr:hover, .data-table tbody tr:hover { background-color: #374151; }

/* News Section Styles */
.news-section {
    padding: 20px;
    color: #d1d5db;
}

.news-content article {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    color: white;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.news-content article:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 25px rgba(0, 0, 0, 0.2);
}

.news-section h1,
.news-section h2,
.news-section h3,
.news-section h4,
.news-section h5,
.news-section h6 {
    color: #ffffff;
}

.news-section a {
    color: #38bdf8;
}

.news-section strong {
    color: #ffffff;
}

.news-section code {
    background-color: #374151;
    color: #e5e7eb;
    padding: 2px 4px;
    border-radius: 4px;
}

.news-section pre {
    background-color: #1f2937;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #374151;
    color: #e5e7eb;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Overriding dark mode styles for user-generated content */
.prose-invert p,
.prose-invert ul,
.prose-invert li,
.prose-invert em {
    color: #d1d5db;
}

.prose-invert blockquote {
    color: #9ca3af;
    border-left-color: #38bdf8;
}

.prose-invert hr {
    border-top-color: #374151;
}

.prose-invert h1, .prose-invert h2, .prose-invert h3, .prose-invert h4, .prose-invert h5, .prose-invert h6 {
  color: #ffffff;
}
.prose-invert a {
  color: #38bdf8;
}
.prose-invert strong {
  color: #ffffff;
}
.prose-invert code {
    background-color: #374151;
    color: #e5e7eb;
}
.prose-invert pre {
    background-color: #1f2937;
    color: #e5e7eb;
}

.prose-invert > :first-child {
  margin-top: 0;
}

.prose-invert > :last-child {
  margin-bottom: 0;
}

/* Styles for closable tabs */
.tab .bteq-tab {
    position: relative;
    padding-right: 30px; /* Make space for the close button */
}

.close-tab {
    position: absolute;
    top: 50%;
    right: 5px;
    transform: translateY(-50%);
    padding: 5px;
    line-height: 0.8;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
    border-radius: 50%;
}

.close-tab:hover {
    background-color: #5a636e;
}
