:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-dark: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --success: #22c55e;
    --danger: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Dynamic Background Blobs */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    filter: blur(80px);
}

.blob {
    position: absolute;
    border-radius: 50%;
    opacity: 0.4;
    animation: move 20s infinite alternate;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: #4f46e5;
    top: -100px;
    left: -100px;
}

.blob-2 {
    width: 300px;
    height: 300px;
    background: #7c3aed;
    bottom: -50px;
    right: -50px;
    animation-delay: -5s;
}

.blob-3 {
    width: 250px;
    height: 250px;
    background: #db2777;
    top: 50%;
    left: 60%;
    animation-delay: -10s;
}

@keyframes move {
    from { transform: translate(0, 0); }
    to { transform: translate(100px, 100px); }
}

.dashboard {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo .icon {
    font-size: 2rem;
}

.logo h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
}

.logo h1 span {
    color: var(--primary);
}

.status-badge {
    background: var(--card-bg);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid var(--glass-border);
}

.status-badge .dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--success);
}

/* Search Section */
.search-section {
    margin-bottom: 3rem;
}

.search-container {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    padding: 0.5rem;
    border-radius: 1.5rem;
    display: flex;
    gap: 0.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.search-container:focus-within {
    transform: translateY(-2px);
    border-color: var(--primary);
}

#ai-input {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    outline: none;
}

#search-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0 2rem;
    border-radius: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
}

#search-btn:hover {
    background: var(--primary-hover);
    transform: scale(1.02);
}

.suggestions {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    padding-left: 1rem;
}

.suggestion {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 0.3rem 0.8rem;
    border-radius: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.suggestion:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-muted);
}

/* Results Section */
.results-section {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 2rem;
    padding: 2rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.results-header h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
}

#result-count {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-left: 0.5rem;
}

.query-display {
    font-family: monospace;
    font-size: 0.75rem;
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    padding: 0.4rem 0.8rem;
    border-radius: 0.5rem;
}

.table-container {
    width: 100%;
    overflow-x: auto;
    position: relative;
    min-height: 200px;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th {
    padding: 1rem;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--glass-border);
}

td {
    padding: 1.2rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.95rem;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.status-pill {
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-pill.open { background: rgba(34, 197, 94, 0.1); color: #4ade80; }
.status-pill.closed { background: rgba(239, 68, 68, 0.1); color: #f87171; }

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.2;
}

/* Loader */
.loader {
    width: 20px;
    height: 20px;
    border: 2px solid white;
    border-bottom-color: transparent;
    border-radius: 50%;
    display: none;
    animation: rotation 1s linear infinite;
}

@keyframes rotation {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@media (max-width: 768px) {
    .dashboard { padding: 1rem; }
    .search-container { flex-direction: column; border-radius: 1rem; }
    #search-btn { width: 100%; padding: 1rem; }
    .results-header { flex-direction: column; align-items: flex-start; gap: 1rem; }
}
