* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* Layout */
.flex {
    display: flex;
}

/* Sidebar */
aside {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 280px;
    background: linear-gradient(180deg, #1a2942 0%, #0f172a 100%);
    color: white;
    padding: 2rem;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

nav.space-y-4 {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

nav button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

nav button:hover {
    background-color: rgba(255, 255, 255, 0.15);
    transform: translateX(5px);
}

/* Main Content */
main {
    margin-left: 280px;
    flex: 1;
    padding: 2rem;
    max-width: 1200px;
}

/* Section Containers */
.bg-white {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.hidden {
    display: none;
}

/* Typography */
h2.text-xl {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #1e293b;
}

/* Forms */
.space-y-4 {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

label.block {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #4b5563;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background-color: #f8fafc;
    transition: all 0.2s;
    font-size: 0.95rem;
}

input[type="text"]:focus,
input[type="password"]:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.5rem;
    accent-color: #3b82f6;
}

label.flex {
    display: flex;
    align-items: center;
}

button[type="submit"] {
    background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.2);
    align-self: flex-start;
}

button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(37, 99, 235, 0.25);
}

/* Keyword Input Area */
.border {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.75rem;
    min-height: 60px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    background-color: #f8fafc;
}

#keywordInput, #bulkKeywords {
    flex: 1;
    padding: 0.5rem;
    border: none;
    outline: none;
    background: transparent;
    min-width: 100px;
}

#bulkKeywords {
    min-height: 50px;
}

/* Keyword Chips */
.bg-gray-100 {
    background-color: #f1f5f9;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    display: flex;
    gap: 0.5rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.bg-gray-200 {
    background-color: #e2e8f0;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    color: #475569;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
}

.ml-1 {
    margin-left: 0.25rem;
    color: #64748b;
    cursor: pointer;
    font-weight: bold;
}

.ml-1:hover {
    color: #ef4444;
}

/* Article List */
.space-y-4 ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

li.p-4 {
    padding: 1.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
}

li.p-4:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

h1.text-xl,
h3.text-xl {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.text-sm {
    font-size: 0.875rem;
}

.text-green-600 {
    color: #16a34a;
}

.text-red-600 {
    color: #dc2626;
}

code.bg-gray-200 {
    background-color: #e2e8f0;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.875rem;
}

.prose {
    margin-top: 1rem;
    color: #475569;
}

.prose h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 1rem 0;
    color: #1e293b;
}

.prose h3 {
    font-size: 1.125rem;
    font-weight: 500;
    margin: 1rem 0;
    color: #1e293b;
}

.prose p {
    color: #475569;
    line-height: 1.7;
    margin: 0.75rem 0;
}

/* Loading Overlay */
#loadingOverlay {
    position: fixed;
    inset: 0;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 50;
    backdrop-filter: blur(5px);
}

#loadingOverlay img {
    width: 100px;
    height: 100px;
}

#loadingOverlay p {
    color: #475569;
    font-weight: 600;
    margin-top: 1rem;
    font-size: 1.125rem;
}

/* Tooltips */
.relative {
    position: relative;
}

.text-blue-500 {
    color: #3b82f6;
    cursor: pointer;
    margin-left: 0.25rem;
}

.absolute {
    position: absolute;
    background-color: #1e293b;
    color: white;
    font-size: 0.75rem;
    border-radius: 6px;
    padding: 0.5rem;
    width: 16rem;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 20;
    top: 100%;
    left: 0;
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

.group:hover .absolute {
    opacity: 1;
}

/* Links */
a.text-blue-500 {
    color: #3b82f6;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: normal;
    margin-left: 0.5rem;
}

a.text-blue-500:hover {
    text-decoration: underline;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    main {
        min-width: 140%;
    }
}

/* Article Card Styles */
.article-card {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
}

.article-header {
    padding: 1rem;
    background-color: #f8fafc;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.article-header:hover {
    background-color: #f1f5f9;
}

.article-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding: 0 1rem;
}

.article-content.expanded {
    max-height: 2000px;
    padding: 1rem;
    border-top: 1px solid #e2e8f0;
}

.expand-icon {
    transition: transform 0.3s ease;
}

.expand-icon.expanded {
    transform: rotate(180deg);
}

/* Modern Sidebar Styling */
/* Modern Sidebar Styling with Light Color Scheme */
aside {
    display: flex;
    flex-direction: column;
    width: 240px;
    background: rgba(240, 245, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1.25rem 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
    border-top-right-radius: 30px;
    border-bottom-right-radius: 30px;
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.05);
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    margin-bottom: 3rem;
    padding-bottom: 0;
    border-bottom: none;
    /* Removed line under EliteAI */
}

.sidebar-header a {
    margin: 0;
    font-weight: 700;
    background: linear-gradient(90deg, #3b82f6, #6366f1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
    font-size: 1.25rem;
    line-height: 12px;
}

.new-article-btn {
    margin-top: -10px;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.new-article-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.3);
}

nav.space-y-4 {
    margin-bottom: 1.5rem;
}

nav.space-y-4 button {
    background: transparent;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    color: rgba(30, 41, 59, 0.8);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    width: 100%;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

nav.space-y-4 button::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: transparent;
    transition: all 0.2s;
}

nav.space-y-4 button:hover {
    background-color: rgba(59, 130, 246, 0.08);
    color: #1e293b;
}

nav.space-y-4 button:hover::before {
    background: linear-gradient(180deg, #3b82f6, #6366f1);
}

.sidebar-footer {
    margin-top: auto;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding-top: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.settings-btn {
    background: rgba(59, 130, 246, 0.05);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    color: rgba(30, 41, 59, 0.8);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    width: auto;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.settings-btn:hover {
    background-color: rgba(59, 130, 246, 0.1);
    color: #1e293b;
}

.collapse-btn {
    background: rgba(59, 130, 246, 0.05);
    color: rgba(30, 41, 59, 0.8);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.collapse-btn:hover {
    background: rgba(59, 130, 246, 0.1);
    color: #1e293b;
}

.expand-sidebar-btn {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(240, 245, 255, 0.9);
    backdrop-filter: blur(8px);
    color: #1e293b;
    width: 28px;
    height: 48px;
    border-radius: 0 8px 8px 0;
    display: none;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
    z-index: 99;
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.05);
}

.expand-sidebar-btn:hover {
    background: rgba(240, 245, 255, 1);
}

.sidebar-collapsed {
    width: 0;
    padding: 0;
    overflow: hidden;
}

main {
    margin-left: 240px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 1.5rem;
}

main.expanded {
    margin-left: 0;
}

#loadingOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.loading-container {
    text-align: center;
    max-width: 300px;
}

.loading-container p {
    margin-top: 20px;
    color: #1e293b;
    font-weight: 500;
}

.loading-bar {
    height: 4px;
    width: 100%;
    background-color: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.loading-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 30%;
    background: linear-gradient(90deg, #3b82f6, #6366f1);
    border-radius: 4px;
    animation: loading 1.5s infinite ease-in-out;
}

@keyframes loading {
    0% {
        left: -30%;
    }

    100% {
        left: 100%;
    }
}