/* Custom styling for FAVSYNC 2 Browser Bookmarks Tree View */

* {
    font-family: 'Jost', sans-serif;
    font-weight: 300;
    letter-spacing: 0.02em;
}

/* Glassmorphism base */
.glassmorphism {
    background: rgba(17, 24, 39, 0.7); /* gray-900/70 */
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

/* Custom background pattern for Dark Mode */
body {
    background-color: #0b0f19;
    background-image: 
        radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.07) 0, transparent 50%), 
        radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.05) 0, transparent 50%);
    background-attachment: fixed;
}

/* Scrollbars */
#bookmarks-tree::-webkit-scrollbar {
    width: 6px;
}
#bookmarks-tree::-webkit-scrollbar-track {
    background: transparent;
}
#bookmarks-tree::-webkit-scrollbar-thumb {
    background: rgba(156, 163, 175, 0.25);
    border-radius: 99px;
}
#bookmarks-tree::-webkit-scrollbar-thumb:hover {
    background: rgba(156, 163, 175, 0.4);
}

/* ==========================================================================
   Tree Node Structure & Styling
   ========================================================================== */

.tree-root {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.tree-node {
    margin-left: 1.25rem;
    position: relative;
}

/* Tree line connectors for visual nesting structure */
.tree-node::before {
    content: '';
    position: absolute;
    left: -0.85rem;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(75, 85, 99, 0.2);
}

/* Collapse bottom line for the last element in list */
.tree-node:last-child::before {
    height: 0.75rem;
    bottom: auto;
}

.tree-node::after {
    content: '';
    position: absolute;
    left: -0.85rem;
    top: 0.75rem;
    width: 0.6rem;
    height: 1px;
    background: rgba(75, 85, 99, 0.2);
}

.tree-root > .tree-node {
    margin-left: 0;
}
.tree-root > .tree-node::before,
.tree-root > .tree-node::after {
    display: none;
}

/* Node Item (the row itself) */
.node-item {
    display: flex;
    align-items: center;
    padding: 0.35rem 0.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 0.5rem;
    user-select: none;
}

.node-item:hover {
    background: rgba(59, 130, 246, 0.08);
}

/* Chevron */
.node-chevron {
    width: 1.25rem;
    height: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af; /* gray-400 */
    transition: transform 0.2s ease;
}
.node-chevron.expanded {
    transform: rotate(90deg);
}
.node-chevron.hidden-chevron {
    opacity: 0;
    pointer-events: none;
}

/* Icons styling */
.node-icon {
    font-size: 0.95rem;
    width: 1.1rem;
    text-align: center;
}
.node-icon.folder {
    color: #fbbf24; /* amber-400 */
}
.node-icon.bookmark {
    color: #60a5fa; /* blue-400 */
}
.node-icon.favicon-img {
    width: 1rem;
    height: 1rem;
    object-fit: contain;
    border-radius: 0.15rem;
}

/* Labels */
.node-label {
    font-size: 0.92rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 450px;
    font-weight: 300;
}
.node-item.is-folder .node-label {
    font-weight: 400;
    color: #f3f4f6; /* gray-100 */
}

/* Node children container */
.node-children {
    display: none;
}
.node-children.expanded {
    display: block;
}

/* Bookmark Count badge */
.node-count {
    font-size: 0.75rem;
    color: #6b7280; /* gray-500 */
    font-weight: 400;
}

/* Bookmark Link details */
.node-url {
    font-size: 0.75rem;
    color: #4b5563; /* gray-600 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 350px;
    opacity: 0;
    transition: opacity 0.2s ease;
    margin-left: 0.5rem;
}
.node-item:hover .node-url {
    opacity: 1;
}

.node-date {
    font-size: 0.72rem;
    color: #6b7280; /* gray-500 */
    margin-left: auto; /* Push date to the right margin */
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    user-select: none;
}

/* Search Highlights */
.search-match {
    background-color: rgba(245, 158, 11, 0.2); /* amber-500/20 */
    border-bottom: 1px dashed #f59e0b; /* amber-500 */
}
.node-item.has-match {
    background: rgba(245, 158, 11, 0.06);
    border-left: 2px solid #f59e0b;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* ==========================================================================
   BRIGHT SKIN THEME OVERRIDES (.skin-bright)
   ========================================================================== */
.skin-bright {
    background-color: #f3f4f6 !important;
    background-image: 
        radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.04) 0, transparent 50%), 
        radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.03) 0, transparent 50%) !important;
    color: #1f2937 !important;
}

.skin-bright .glassmorphism {
    background: rgba(255, 255, 255, 0.7) !important;
    border-color: #e2e8f0 !important;
}

.skin-bright #navbar {
    background: rgba(243, 244, 246, 0.85) !important;
    border-color: #cbd5e1 !important;
}

.skin-bright #logo-text {
    background-image: linear-gradient(to right, #2563eb, #7c3aed) !important;
}

.skin-bright #ext-status-badge {
    background-color: rgba(255, 255, 255, 0.6) !important;
    border-color: #e2e8f0 !important;
    color: #4b5563 !important;
}

.skin-bright #btn-theme-toggle,
.skin-bright #search-input,
.skin-bright #btn-expand-all,
.skin-bright #btn-collapse-all,
.skin-bright a[href="index.html"] {
    background-color: rgba(255, 255, 255, 0.8) !important;
    border-color: #cbd5e1 !important;
    color: #4b5563 !important;
}

.skin-bright #btn-theme-toggle:hover,
.skin-bright #btn-expand-all:hover,
.skin-bright #btn-collapse-all:hover,
.skin-bright a[href="index.html"]:hover {
    background-color: #f3f4f6 !important;
    color: #111827 !important;
    border-color: #94a3b8 !important;
}

.skin-bright #search-input {
    color: #1f2937 !important;
}
.skin-bright #search-input::placeholder {
    color: #94a3b8 !important;
}

.skin-bright #search-input:focus {
    border-color: #3b82f6 !important;
}

.skin-bright #tree-loading {
    color: #64748b !important;
}

.skin-bright .node-item:hover {
    background: rgba(59, 130, 246, 0.05);
}

.skin-bright .tree-node::before,
.skin-bright .tree-node::after {
    background: rgba(148, 163, 184, 0.3);
}

.skin-bright .node-item.is-folder .node-label {
    color: #1e293b !important;
    font-weight: 500;
}
.skin-bright .node-label {
    color: #475569;
}
.skin-bright a.node-label {
    color: #1d4ed8 !important;
}
.skin-bright a.node-label:hover {
    color: #1e40af !important;
    text-decoration: underline;
}

.skin-bright .node-icon.folder {
    color: #d97706 !important;
}
.skin-bright .node-icon.bookmark {
    color: #2563eb !important;
}

.skin-bright .node-url {
    color: #64748b;
}

.skin-bright .node-chevron {
    color: #475569 !important;
}

.skin-bright .node-count {
    color: #64748b !important;
}

.skin-bright .node-action-btn.edit {
    color: #475569 !important;
}
.skin-bright .node-action-btn.edit:hover {
    color: #1d4ed8 !important;
    background: rgba(59, 130, 246, 0.1) !important;
}
.skin-bright .node-action-btn.delete {
    color: #475569 !important;
}
.skin-bright .node-action-btn.delete:hover {
    color: #b91c1c !important;
    background: rgba(239, 68, 68, 0.1) !important;
}

/* ==========================================================================
   Node Hover Action Buttons
   ========================================================================== */
.node-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    opacity: 0;
    transition: opacity 0.2s ease;
    margin-left: 0.5rem;
}
.node-item:hover .node-actions {
    opacity: 1;
}
.node-action-btn {
    padding: 0.2rem 0.35rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    transition: all 0.2s ease;
    background: transparent;
    border: none;
    cursor: pointer;
}
.node-action-btn.edit {
    color: #9ca3af;
}
.node-action-btn.edit:hover {
    color: #60a5fa; /* blue-400 */
    background: rgba(59, 130, 246, 0.15);
}
.node-action-btn.delete {
    color: #9ca3af;
}
.node-action-btn.delete:hover {
    color: #ef4444; /* red-500 */
    background: rgba(239, 68, 68, 0.15);
}

/* ==========================================================================
   Modal Overrides for Bright Skin
   ========================================================================== */
.skin-bright #edit-modal .glassmorphism,
.skin-bright #delete-modal .glassmorphism {
    background: rgba(255, 255, 255, 0.95) !important;
    border-color: #cbd5e1 !important;
    color: #1f2937 !important;
}
.skin-bright #edit-modal input {
    background-color: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #1f2937 !important;
}
.skin-bright #edit-modal input:focus {
    border-color: #3b82f6 !important;
}
.skin-bright #edit-modal label {
    color: #4b5563 !important;
}
.skin-bright #delete-modal-msg {
    color: #374151 !important;
}
.skin-bright #edit-modal-title {
    color: #111827 !important;
}
.skin-bright .border-b {
    border-color: #cbd5e1 !important;
}
.skin-bright #btn-close-edit {
    color: #64748b !important;
}
.skin-bright #btn-close-edit:hover {
    color: #1e293b !important;
}
.skin-bright #btn-cancel-edit,
.skin-bright #btn-cancel-delete {
    background-color: #f1f5f9 !important;
    border-color: #e2e8f0 !important;
    color: #475569 !important;
}
.skin-bright #btn-cancel-edit:hover,
.skin-bright #btn-cancel-delete:hover {
    background-color: #e2e8f0 !important;
    color: #1e293b !important;
}

.skin-bright .node-date {
    color: #64748b !important;
}

/* ==========================================================================
   Recent View Modes and switchers
   ========================================================================== */
#view-mode-container button {
    outline: none;
}
.skin-bright #view-mode-container {
    background-color: rgba(0, 0, 0, 0.05) !important;
    border-color: #cbd5e1 !important;
}
.skin-bright #btn-view-tree:not(.bg-blue-600),
.skin-bright #btn-view-recent:not(.bg-blue-600) {
    color: #64748b !important;
}
.skin-bright #btn-view-tree:not(.bg-blue-600):hover,
.skin-bright #btn-view-recent:not(.bg-blue-600):hover {
    color: #1e293b !important;
}

.recent-group-header {
    font-size: 1.05rem;
    font-weight: 500;
    color: #a78bfa; /* purple-400 */
    border-bottom: 1px solid rgba(167, 139, 250, 0.15);
    padding-bottom: 0.5rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    user-select: none;
}
.skin-bright .recent-group-header {
    color: #7c3aed !important;
    border-color: #cbd5e1 !important;
}

.recent-bookmark-node {
    position: relative;
    margin-left: 0 !important;
}
.recent-bookmark-node::before,
.recent-bookmark-node::after {
    display: none !important;
}

.recent-bookmark-path {
    font-size: 0.72rem;
    color: #6b7280; /* gray-500 */
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.15rem;
    user-select: none;
}
.skin-bright .recent-bookmark-path {
    color: #94a3b8 !important;
}

.duplicates-group-header {
    font-size: 1.05rem;
    font-weight: 500;
    color: #f59e0b; /* amber-500 */
    border-bottom: 1px solid rgba(245, 158, 11, 0.15);
    padding-bottom: 0.5rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    user-select: none;
    word-break: break-all;
}
.skin-bright .duplicates-group-header {
    color: #d97706 !important;
    border-color: #cbd5e1 !important;
}

.skin-bright #btn-view-duplicates:not(.bg-blue-600) {
    color: #64748b !important;
}
.skin-bright #btn-view-duplicates:not(.bg-blue-600):hover {
    color: #1e293b !important;
}

.skin-bright #btn-view-dead:not(.bg-blue-600) {
    color: #64748b !important;
}
.skin-bright #btn-view-dead:not(.bg-blue-600):hover {
    color: #1e293b !important;
}

/* ==========================================================================
   Dead Links Badges
   ========================================================================== */
.dead-badge {
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
    font-weight: 500;
    white-space: nowrap;
    user-select: none;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}
.dead-badge.error-404 {
    background-color: rgba(239, 68, 68, 0.15); /* red-500/15 */
    color: #f87171; /* red-400 */
    border: 1px solid rgba(239, 68, 68, 0.25);
}
.dead-badge.error-timeout {
    background-color: rgba(245, 158, 11, 0.15); /* amber-500/15 */
    color: #fbbf24; /* amber-400 */
    border: 1px solid rgba(245, 158, 11, 0.25);
}
.dead-badge.error-offline {
    background-color: rgba(107, 114, 128, 0.15); /* gray-500/15 */
    color: #9ca3af; /* gray-400 */
    border: 1px solid rgba(107, 114, 128, 0.25);
}

.skin-bright .dead-badge.error-404 {
    background-color: rgba(239, 68, 68, 0.08) !important;
    color: #dc2626 !important;
    border-color: rgba(239, 68, 68, 0.2) !important;
}
.skin-bright .dead-badge.error-timeout {
    background-color: rgba(245, 158, 11, 0.08) !important;
    color: #d97706 !important;
    border-color: rgba(245, 158, 11, 0.2) !important;
}
.skin-bright .dead-badge.error-offline {
    background-color: rgba(107, 114, 128, 0.08) !important;
    color: #4b5563 !important;
    border-color: rgba(107, 114, 128, 0.2) !important;
}




