@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Outfit:wght@600;700;800&display=swap');

:root {
    --primary: #0f172a;
    --accent: #6366f1;
    --border: rgba(255, 255, 255, 0.1);
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    --card-bg: rgba(255, 255, 255, 0.03);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-gradient);
    color: var(--text-main);
    min-height: 100vh;
}

.navbar {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    height: 60px;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container { width: 100%; max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; }
.nav-logo h2 { font-family: 'Outfit', sans-serif; font-size: 1.4rem; color: #fff; }
.nav-menu { list-style: none; display: flex; gap: 20px; }
.nav-link { text-decoration: none; color: var(--text-muted); font-weight: 500; transition: 0.3s; }
.nav-link:hover, .nav-link.active { color: white; }

/* Search Hero Section */
.search-hero {
    padding: 80px 20px;
    display: flex;
    justify-content: center;
    background: radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
}

.search-container { width: 100%; max-width: 800px; text-align: center; }
.search-header h1 { font-family: 'Outfit', sans-serif; font-size: 2.5rem; margin-bottom: 10px; }
.search-header p { color: var(--text-muted); margin-bottom: 40px; }

.search-box-wrapper { position: relative; width: 100%; }
#dbSearch {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    padding: 18px 25px;
    border-radius: 16px;
    color: white;
    font-size: 1.1rem;
    outline: none;
    transition: all 0.3s;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
}

#dbSearch:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
}

.trending-tags { margin-top: 20px; display: flex; gap: 10px; justify-content: center; align-items: center; }
.trending-tags span { font-size: 0.85rem; color: var(--text-muted); }
.trending-tags button {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 5px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: 0.3s;
}
.trending-tags button:hover { background: var(--accent); color: white; }

/* Suggestions */
.suggestions {
    position: absolute; top: 100%; left: 0; width: 100%; background: #1e293b; 
    border: 1px solid var(--border); border-radius: 12px; margin-top: 5px;
    z-index: 10; overflow: hidden; display: none;
}
.suggestion-item { padding: 12px 20px; cursor: pointer; text-align: left; display: flex; align-items: center; font-size: 0.9rem; }
.suggestion-item:hover { background: var(--accent); }
.type-tag { font-size: 0.6rem; padding: 2px 5px; border-radius: 4px; margin-right: 8px; font-weight: 800; }
.local { background: rgba(16, 185, 129, 0.2); color: #10b981; }
.cloud { background: rgba(99, 102, 241, 0.2); color: #818cf8; }
.remote { background: rgba(245, 158, 11, 0.2) !important; color: #f59e0b !important; }
.cloud-search { border-top: 1px solid rgba(255,255,255,0.05); background: rgba(99, 102, 241, 0.05); font-style: italic; }

/* Results Section */
.results-section { padding: 40px 20px; animation: slideUp 0.5s ease-out; }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.results-container { max-width: 1000px; margin: 0 auto; background: var(--card-bg); border-radius: 24px; padding: 40px; border: 1px solid var(--border); backdrop-filter: blur(20px); }

.substance-header { margin-bottom: 40px; }
.title-group { display: flex; align-items: baseline; gap: 15px; flex-wrap: wrap; }
.title-group h2 { font-family: 'Outfit', sans-serif; font-size: 2.2rem; }
.title-group #res-formula { color: var(--accent); font-weight: 700; font-size: 1.2rem; }
.cas-tag { font-size: 0.9rem; background: rgba(99, 102, 241, 0.2); color: #818cf8; padding: 4px 10px; border-radius: 6px; }

.property-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 40px; }
.prop-card { background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border); padding: 20px; border-radius: 16px; }
.prop-label { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.05em; }
.prop-val { font-family: 'Outfit', sans-serif; font-size: 1.5rem; font-weight: 700; color: white; }
.prop-unit { font-size: 0.75rem; color: var(--text-muted); margin-left: 5px; }

.detail-panels { display: grid; grid-template-columns: 1fr 1fr; gap: 25px; }
.detail-box { background: rgba(0, 0, 0, 0.2); border-radius: 16px; padding: 25px; }
.detail-box h3 { font-size: 1rem; margin-bottom: 15px; display: flex; align-items: center; gap: 10px; }
.prop-list { list-style: none; }
.prop-list li { padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.05); color: #cbd5e1; font-size: 0.9rem; display: flex; justify-content: space-between; }
.prop-list li span { font-weight: 600; color: white; }

@media (max-width: 768px) {
    .detail-panels { grid-template-columns: 1fr; }
    .search-header h1 { font-size: 1.8rem; }
}
