/* Modern 2025 Design Styles */

/* Light mode base styles */
html {
    color-scheme: light;
    background-color: #ffffff !important; /* pure white */
    color: #111827 !important; /* neutral-900 */
}

html:not(.dark) .feed-content .item
{
    border: 1px solid #eaeaea !important;
}

/* Dark mode base styles */
html.dark {
    color-scheme: dark;
    background-color: #111827 !important; /* neutral-900 */
    color: #f9fafb !important; /* neutral-50 */
}

html.dark .feed {
    background-color: #1f2937 !important; /* neutral-800 */
}

/* Custom scrollbar for modern browsers */
.scrollbar-thin::-webkit-scrollbar {
    width: 6px;
}

.scrollbar-thin::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.03); /* Lighter track */
    border-radius: 3px;
}

.scrollbar-thin::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15); /* Darker thumb for better visibility */
    border-radius: 3px;
}

html.dark .scrollbar-thin::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

html.dark .scrollbar-thin::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15); /* Slightly more visible in dark mode too */
    border-radius: 3px;
}

.scrollbar-thin::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25); /* Darker on hover */
}

html.dark .scrollbar-thin::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25); /* Brighter on hover */
}

/* Modern loader animation */
.loader {
    display: block;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    top: calc(50% - 24px);
    left: calc(50% - 24px);
    position: absolute;
    animation: pulse 1.5s ease-in-out infinite;
}

.loader:before, .loader:after {
    content: "";
    box-sizing: border-box;
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid transparent;
}

.loader:before {
    border-top-color: #0ea5e9;
    animation: spin 1s linear infinite;
}

.loader:after {
    border-bottom-color: #0ea5e9;
    animation: spin 1.5s linear infinite reverse;
}

html.dark .loader:before {
    border-top-color: #38bdf8;
}

html.dark .loader:after {
    border-bottom-color: #38bdf8;
}

@keyframes spin {
    100% {transform: rotate(360deg)}
}

@keyframes pulse {
    0%, 100% {transform: scale(0.8); opacity: 0.8;}
    50% {transform: scale(1); opacity: 1;}
}

/* Ensure feed opacity changes when content is loaded */
.feed:has(.feed-content:not(.loading)) {
    opacity: 1;
}

.feed:has(.feed-content:not(.loading)) > .loader {
    display: none;
}

/* Add loading class styling */
.feed-content.loading {
    opacity: 0.5;
}

/* Custom tooltip styling - modern glass morphism style */
#global-tooltip {
    visibility: hidden;
    position: fixed;
    background-color: rgba(255, 255, 255, 0.95); /* More opaque for better visibility */
    color: #111827; /* Darker text for better contrast */
    text-align: center;
    padding: 10px 14px; /* Slightly larger padding */
    border-radius: 12px;
    z-index: 1000;
    width: max-content;
    max-width: 320px;
    font-size: 0.875rem;
    line-height: 1.4;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    --arrow-top: 100%;
    --arrow-bottom: auto;
    --arrow-border-color: rgba(255, 255, 255, 0.95) transparent transparent transparent;
    transform: translate(-50%, -100%);
    backdrop-filter: blur(8px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15); /* Enhanced shadow */
    border: 1px solid rgba(0, 0, 0, 0.05); /* Subtle border */
    font-weight: 500; /* Medium weight for better readability */
}

html.dark #global-tooltip {
    background-color: rgba(31, 41, 55, 0.95); /* More opaque for better visibility */
    color: #f9fafb; /* Lighter text for better contrast */
    --arrow-border-color: rgba(31, 41, 55, 0.95) transparent transparent transparent;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3); /* Enhanced shadow */
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#global-tooltip::after {
    content: "";
    position: absolute;
    top: var(--arrow-top, 100%);
    bottom: var(--arrow-bottom, auto);
    left: 50%;
    margin-left: -6px;
    border-width: 6px;
    border-style: solid;
    border-color: var(--arrow-border-color);
    pointer-events: none;
}

/* Feed item styling */
.feed-content .item {
    transition: all 0.2s ease;
    border-radius: 8px;
    padding: 12px !important;
    margin-bottom: 8px;
    background-color: #ffffff !important; /* Pure white background for items */
    border: 1px solid rgba(0, 0, 0, 0.005) !important; /* Nearly invisible border */
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.005) !important; /* Extremely subtle shadow */
}

.feed-content .item:hover {
    background-color: #fafafa !important; /* Even lighter gray on hover */
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.01) !important; /* Very subtle shadow */
    transform: translateY(-1px); /* Subtle lift effect */
    border-color: rgba(0, 0, 0, 0.01) !important; /* Slightly more visible border on hover */
}

html.dark .feed-content .item {
    background-color: transparent !important; /* Keep dark mode as is */
    border: 1px solid rgba(255, 255, 255, 0.05) !important; /* Subtle border in dark mode */
    box-shadow: none !important;
}

html.dark .feed-content .item:hover {
    background-color: rgba(255, 255, 255, 0.05) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2) !important;
}

.feed-content .item a {
    font-weight: 600; /* Slightly bolder */
    color: #0284c7; /* primary-600 */
    text-decoration: none;
    transition: all 0.2s ease;
}

html.dark .feed-content .item a {
    color: #38bdf8; /* primary-400 */
}

.feed-content .item a:hover {
    color: #0369a1; /* primary-700 */
    text-decoration: underline;
}

html.dark .feed-content .item a:hover {
    color: #7dd3fc; /* primary-300 */
    text-decoration: underline;
}

.feed-content .item-description {
    margin-top: 6px;
    color: #1f2937; /* neutral-800 - even darker for better contrast */
    font-size: 0.875rem;
    line-height: 1.5;
}

html.dark .feed-content .item-description {
    color: #9ca3af; /* neutral-400 */
}

.feed-content .item-date {
    display: inline-block;
    margin-top: 2px;
    font-size: 0.75rem;
    color: #374151; /* neutral-700 - darker for better contrast */
    font-weight: 500; /* Medium weight for better readability */
}

html.dark .feed-content .item-date {
    color: #9ca3af; /* neutral-400 */
}

/* Animation for new items */
@keyframes highlightNew {
    0% { background-color: rgba(14, 165, 233, 0.2); box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.3); }
    50% { background-color: rgba(14, 165, 233, 0.1); box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.2); }
    100% { background-color: #ffffff !important; box-shadow: 0 1px 1px rgba(0, 0, 0, 0.005) !important; }
}

.feed-content .item.new-item {
    animation: highlightNew 3s ease-out forwards;
    border-color: rgba(14, 165, 233, 0.3); /* Colored border for new items */
}

html.dark .feed-content .item.new-item {
    animation: highlightNewDark 3s ease-out forwards;
    border-color: rgba(56, 189, 248, 0.3); /* Colored border for new items in dark mode */
}

@keyframes highlightNewDark {
    0% { background-color: rgba(56, 189, 248, 0.2); box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.3); }
    50% { background-color: rgba(56, 189, 248, 0.1); box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2); }
    100% { background-color: transparent; box-shadow: none; }
}
