body,
html {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: Arial, sans-serif;
    background: linear-gradient(to bottom right, #e6f2ff, #f0e6ff);
}

.container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 20px;
    box-sizing: border-box;
}

h1 {
    text-align: center;
    color: #f0e6ff;
    margin: 0 0 20px 0;
}

.main-content {
    display: flex;
    flex: 1;
    gap: 20px;
    overflow: hidden;
}

.sidebar {
    width: 250px;
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #ddd;
    overflow-y: auto;
}

.middle-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#parseForm {
    display: flex;
    margin-bottom: 20px;
    width: 100%;
}

#urlInput {
    flex-grow: 1;
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    width: 100%;
    box-sizing: border-box;
}

#parseButton {
    padding: 10px 20px;
    font-size: 16px;
    background-color: #333333;
    /* Dark grey/black */
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;
    width: 100%;
}

#parseButton:hover {
    background-color: #4d4d4d;
    /* Slightly lighter on hover */
}

#parseButton:active {
    background-color: #1a1a1a;
    /* Darker when clicked */
    transform: scale(0.98);
    /* Slight scale down effect when clicked */
}

#resultContainer {
    display: flex;
    flex-direction: column;
    height: calc(100% - 40px);
    /* Adjust based on the height of your tab buttons */
}

#result,
#treeView {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#jsonContainer,
#treeContainer {
    flex: 1;
    overflow-y: auto;
    background-color: #f8f8f8;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
}

#jsonOutput,
#treeContainer {
    white-space: pre-wrap;
    word-break: break-all;
    font-family: monospace;
    font-size: 14px;
    margin: 0;
}

/* Styling for options */
#options label {
    display: block;
    margin-bottom: 10px;
}

#selectedTagsContainer,
#excludedTagsContainer {
    margin-top: 15px;
}

#selectedTagsContainer label,
#excludedTagsContainer label {
    display: inline-block;
    margin-right: 10px;
    margin-bottom: 5px;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
}

#selectedTagsContainer label {
    background-color: #e0e0e0;
    /* Light grey instead of light green */
}

#excludedTagsContainer label {
    background-color: #f0f0f0;
    /* Very light grey instead of light red */
}

/* Download buttons */
#downloadSection button {
    display: block;
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    font-size: 14px;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    background-color: #333333;
    /* Dark grey/black */
}

#downloadSection button:hover {
    background-color: #4d4d4d;
    /* Slightly lighter on hover */
}

#downloadSection button:active {
    background-color: #1a1a1a;
    /* Darker when clicked */
}

/* Remove individual button colors */
#downloadImages,
#downloadJSON,
#downloadHTML {
    background-color: #333333;
    /* Dark grey/black */
}

#downloadImages:hover,
#downloadJSON:hover,
#downloadHTML:hover {
    background-color: #4d4d4d;
    /* Slightly lighter on hover */
}

/* JSON styling */
.json-key {
    color: #333333;
}

.json-string {
    color: #666666;
}

.json-number {
    color: #4d4d4d;
}

.json-boolean {
    color: #1a1a1a;
}

.json-null {
    color: #999999;
}

/* Tree view styling */
.tree-node {
    color: #333333;
}

.tree-node[data-tag="div"],
.tree-node[data-tag="span"],
.tree-node[data-tag="p"] {
    color: #4d4d4d;
}

.tree-node[data-tag="a"] {
    color: #1a1a1a;
}

.tree-node[data-tag="img"] {
    color: #666666;
}

.tree-node[data-tag="h1"],
.tree-node[data-tag="h2"],
.tree-node[data-tag="h3"],
.tree-node[data-tag="h4"],
.tree-node[data-tag="h5"],
.tree-node[data-tag="h6"] {
    color: #333333;
}

.tree-node[data-tag="ul"],
.tree-node[data-tag="ol"],
.tree-node[data-tag="li"] {
    color: #4d4d4d;
}

/* Loading indicator */
#loadingIndicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 1000;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Responsive design for smaller screens */
@media (max-width: 1200px) {
    .container {
        height: auto;
        overflow-y: auto;
    }

    .main-content {
        flex-direction: column;
    }

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

    #resultContainer {
        flex-direction: column;
    }
}

/* Add these styles to your existing CSS */

/* Ensure the left panel doesn't scroll */
.w-1\/4.p-4.bg-gray-50 {
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Allow scrolling only within the tag selection containers */
#selectedTagsContainer,
#excludedTagsContainer {
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(39, 39, 39, 0.5) transparent;
}

#selectedTagsContainer::-webkit-scrollbar,
#excludedTagsContainer::-webkit-scrollbar {
    width: 6px;
}

#selectedTagsContainer::-webkit-scrollbar-track,
#excludedTagsContainer::-webkit-scrollbar-track {
    background: transparent;
}

#selectedTagsContainer::-webkit-scrollbar-thumb,
#excludedTagsContainer::-webkit-scrollbar-thumb {
    background-color: rgba(156, 163, 175, 0.5);
    border-radius: 3px;
}

/* Ensure the tag selection container fills available space */
.bg-white.p-4.rounded-lg.shadow.flex-grow {
    display: flex;
    flex-direction: column;
}

.grid.grid-cols-2.gap-4.h-full {
    flex-grow: 1;
    min-height: 0;
    /* This is crucial for nested flex containers */
}

/* Add these styles to your existing CSS */
.json-collapsible {
    cursor: pointer;
}

.json-toggle {
    display: inline-block;
    width: 20px;
    text-align: center;
}

.json-content {
    padding-left: 20px;
}

.json-bracket {
    color: #444;
}

/* Remove any existing styles that might interfere with the new layout */

/* Add these styles */
body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    height: 100vh;
}

.overflow-y-auto {
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(156, 163, 175, 0.5) transparent;
}

.overflow-y-auto::-webkit-scrollbar {
    width: 6px;
}

.overflow-y-auto::-webkit-scrollbar-track {
    background: transparent;
}

.overflow-y-auto::-webkit-scrollbar-thumb {
    background-color: rgba(156, 163, 175, 0.5);
    border-radius: 3px;
}

/* Keep your existing styles for JSON and tree view */

/* Custom scrollbar styles */
.custom-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: rgba(156, 163, 175, 0.5) transparent;
}

.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background-color: rgba(156, 163, 175, 0.5);
    border-radius: 3px;
    transition: background-color 0.3s ease;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background-color: rgba(156, 163, 175, 0.8);
}

/* Updated styles for minimalist black/white/grey look */
body {
    background-color: #f5f5f5;
    color: #333333;
}

.bg-primary {
    background-color: #333333;
}

.bg-primary-dark {
    background-color: #1a1a1a;
}

.bg-secondary {
    background-color: #4d4d4d;
}

.bg-secondary-dark {
    background-color: #666666;
}

.text-primary {
    color: #333333;
}

.text-secondary {
    color: #666666;
}

/* Updated JSON styling */
.json-key {
    color: #333333;
}

.json-string {
    color: #666666;
}

.json-number {
    color: #4d4d4d;
}

.json-boolean {
    color: #1a1a1a;
}

.json-null {
    color: #999999;
}

/* Updated Tree view styling */
.tree-node {
    color: #333333;
}

.tree-node[data-tag="div"],
.tree-node[data-tag="span"],
.tree-node[data-tag="p"] {
    color: #4d4d4d;
}

.tree-node[data-tag="a"] {
    color: #1a1a1a;
}

.tree-node[data-tag="img"] {
    color: #666666;
}

.tree-node[data-tag="h1"],
.tree-node[data-tag="h2"],
.tree-node[data-tag="h3"],
.tree-node[data-tag="h4"],
.tree-node[data-tag="h5"],
.tree-node[data-tag="h6"] {
    color: #333333;
}

.tree-node[data-tag="ul"],
.tree-node[data-tag="ol"],
.tree-node[data-tag="li"] {
    color: #4d4d4d;
}

/* Ensure tag selection container fills available space */
#selectedTagsContainer,
#excludedTagsContainer {
    height: calc(100% - 2rem);
    /* Adjust based on the height of the heading */
    overflow-y: auto;
}

/* Style for tag checkboxes */
#selectedTagsContainer,
#excludedTagsContainer {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;

}

#selectedTagsContainer label,
#excludedTagsContainer label {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    color: #4a5568;
}

#selectedTagsContainer input[type="checkbox"],
#excludedTagsContainer input[type="checkbox"] {
    margin-right: 0.5rem;
}

/* Ensure the tag selection containers fill the available space */
.grid.grid-cols-2.gap-4.h-full {
    height: calc(100% - 2rem);
    /* Adjust based on the height of the heading */
}

/* Add these styles to your existing CSS */

/* Style for checkboxes */
input[type="checkbox"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #333333;
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    position: relative;
    margin-right: 8px;
}

input[type="checkbox"]:checked {
    background-color: #333333;
}

input[type="checkbox"]:checked::after {
    content: '\2714';
    font-size: 14px;
    color: white;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Ensure the label text aligns with the checkbox */
label {
    display: flex;
    align-items: center;
}

/* Add these styles to your existing CSS */

/* Style for checkboxes */
#selectedTagsContainer input[type="checkbox"],
#excludedTagsContainer input[type="checkbox"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #333333;
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    position: relative;
    margin-right: 8px;
    vertical-align: middle;
}

#selectedTagsContainer input[type="checkbox"]:checked,
#excludedTagsContainer input[type="checkbox"]:checked {
    background-color: #333333;
}

#selectedTagsContainer input[type="checkbox"]:checked::after,
#excludedTagsContainer input[type="checkbox"]:checked::after {
    content: '\2714';
    font-size: 14px;
    color: white;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Subtle background colors for selected checkboxes */
#selectedTagsContainer label,
#excludedTagsContainer label {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    padding: 2px 5px;
    border-radius: 3px;
    transition: background-color 0.3s ease;
    cursor: pointer;
}

#selectedTagsContainer input[type="checkbox"]:checked+label {
    background-color: rgba(0, 255, 0, 0.2);
    /* Slightly more visible green */
}

#excludedTagsContainer input[type="checkbox"]:checked+label {
    background-color: rgba(255, 0, 0, 0.2);
    /* Slightly more visible red */
}

/* Ensure the label text aligns with the checkbox */
#selectedTagsContainer label span,
#excludedTagsContainer label span {
    margin-left: 5px;
}

/* Style for checkboxes and labels */
#selectedTagsContainer .tag-label,
#excludedTagsContainer .tag-label {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
    cursor: pointer;
}

#selectedTagsContainer .tag-label input[type="checkbox"],
#excludedTagsContainer .tag-label input[type="checkbox"] {
    margin-right: 8px;
}

#selectedTagsContainer .tag-label span,
#excludedTagsContainer .tag-label span {
    flex-grow: 1;
    padding: 2px 5px;
    border-radius: 3px;
    transition: background-color 0.3s ease;
}

/* We'll add these classes for JavaScript to toggle */
.selected-tag {
    background-color: rgba(0, 255, 0, 0.2);
    /* Subtle green */
}

.excluded-tag {
    background-color: rgba(255, 0, 0, 0.2);
    /* Subtle red */
}

/* Update these styles in your existing CSS */

#selectedTagsContainer .tag-label,
#excludedTagsContainer .tag-label,
#selectedTagsContainer .selected-tag,
#excludedTagsContainer .excluded-tag {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    padding: 2px 5px;
    border-radius: 4px;
    transition: background-color 0.3s ease, color 0.3s ease;
    cursor: pointer;
}

#selectedTagsContainer .tag-label input[type="checkbox"],
#excludedTagsContainer .tag-label input[type="checkbox"],
#selectedTagsContainer .selected-tag input[type="checkbox"],
#excludedTagsContainer .excluded-tag input[type="checkbox"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    min-width: 16px;
    min-height: 16px;
    border: 2px solid #333333;
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    margin-right: 6px;
    position: relative;
    flex-shrink: 0;
}

#selectedTagsContainer .tag-label span,
#excludedTagsContainer .tag-label span,
.selected-tag span,
.excluded-tag span {
    flex-grow: 1;
    padding: 2px;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* We'll update these classes for JavaScript to toggle */
.selected-tag {
    background-color: rgba(0, 255, 0, 0.5) !important;
    /* Green with 50% opacity */
}

.excluded-tag {
    background-color: rgba(255, 0, 0, 0.5) !important;
    /* Red with 50% opacity */
}

/* Keep text color black for unselected items */
#selectedTagsContainer .tag-label span,
#excludedTagsContainer .tag-label span {
    color: #000000;
    /* Black text for unselected items */
}

/* Change text color to black for selected items in selectedTagsContainer */
#selectedTagsContainer .selected-tag span {
    color: #000000 !important;
    /* Black text for selected items */
}

/* Change text color to white for selected items in excludedTagsContainer */
#excludedTagsContainer .excluded-tag span {
    color: #ffffff !important;
    /* White text for selected items */
}

/* Remove the border we added earlier for debugging */
.selected-tag,
.excluded-tag {
    border: none;
}

/* Add these styles to your existing CSS */
.tab-container {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
}

.tab {
    padding: 8px 16px;
    cursor: pointer;
    background-color: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-bottom: none;
    margin-right: 4px;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
}

.tab.active {
    background-color: #ffffff;
    border-bottom: 1px solid #ffffff;
    margin-bottom: -1px;
}

/* Add this to your styles.css file */
.adsbygoogle {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
    min-height: 90px;
}

/* Add this to your existing styles.css file */
@keyframes flash-glow {
    0% { box-shadow: 0 0 5px #ff0000; }
    50% { box-shadow: 0 0 20px #ff0000; }
    100% { box-shadow: 0 0 5px #ff0000; }
}

.flash-glow {
    animation: flash-glow 1s infinite;
}

#rateLimitBar {
    transition: width 0.3s ease-in-out;
    background-color: #808080; /* Default gray color */
}
