:root {
    --bg-color: #0d1117;
    --card-bg: #161b22;
    --border-color: #30363d;
    --text-main: #c9d1d9;
    --text-muted: #8b949e;
    --accent-color: #58a6ff;
    --accent-hover: #1f6feb;
    --danger-color: #f85149;
    --success-color: #238636;
    --warning-color: #d29922;
    --glass-bg: rgba(22, 27, 34, 0.7);
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-family);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    text-decoration: underline;
    color: var(--accent-hover);
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Top Bar */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--glass-bg);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-weight: 700;
    font-size: 1.25rem;
    color: #fff;
}

.logo span {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.top-bar nav a {
    margin-left: 1.5rem;
    color: var(--text-muted);
    font-weight: 500;
}

.top-bar nav a:hover,
.top-bar nav a.active {
    color: #fff;
    text-decoration: none;
}

/* Hero */
.hero {
    text-align: center;
    margin: 4rem 0 3rem;
    animation: fadeIn 0.8s ease-out;
}

.minimal-hero {
    margin: 2rem 0;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: #fff;
}

.hero h1 .highlight {
    background: linear-gradient(90deg, #79c0ff, #d2a8ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p.subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* Search Box */
.search-box-container {
    max-width: 700px;
    margin: 0 auto 4rem;
    animation: slideUp 0.8s ease-out 0.2s backwards;
}

.search-form {
    display: flex;
    gap: 0.5rem;
    background: var(--card-bg);
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow);
    transition: box-shadow 0.3s, border-color 0.3s;
}

.search-form:focus-within {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.3);
}

.search-form input {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    outline: none;
    font-family: inherit;
}

.search-form button {
    background: var(--success-color);
    color: #fff;
    border: none;
    padding: 0 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 140px;
}

.search-form button:hover {
    background: #2ea043;
}

.search-form button:active {
    transform: scale(0.98);
}

.error-msg {
    color: var(--danger-color);
    margin-top: 1rem;
    text-align: center;
    font-weight: 500;
}

.hidden {
    display: none !important;
}

/* Results Grid */
.results-container {
    animation: fadeIn 0.5s ease-out;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.result-header h2 {
    font-size: 1.5rem;
    color: #fff;
}

.badge {
    background: rgba(56, 139, 253, 0.15);
    color: var(--accent-color);
    border: 1px solid rgba(56, 139, 253, 0.4);
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.grid-layout {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .grid-layout {
        grid-template-columns: 1fr;
    }
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: #8b949e;
}

.full-width {
    grid-column: 1 / -1;
}

.card-header {
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.card-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-body {
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* Specific Card Styles */
.security h3 { color: var(--danger-color); }
.pii h3 { color: var(--warning-color); }
.credentials h3 { color: #db6d28; } /* Orange */
.smell h3 { color: #e3b341; } /* Yellow */
.scale h3 { color: var(--accent-color); }

.list-item {
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px dashed var(--border-color);
}
.list-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.item-title {
    color: #fff;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.item-desc {
    font-size: 0.9rem;
}

.item-file {
    font-size: 0.8rem;
    color: var(--accent-color);
    margin-top: 0.25rem;
    font-family: monospace;
    background: rgba(110, 118, 129, 0.4);
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
}

/* History List */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.history-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.history-item:hover {
    background: #1f242c;
    border-color: var(--accent-color);
}

.history-info h3 {
    font-size: 1.1rem;
    color: var(--accent-color);
    margin-bottom: 0.25rem;
}

.history-info p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.history-actions a {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-main);
    font-size: 0.9rem;
    background: #21262d;
    transition: 0.2s;
}

.history-actions a:hover {
    background: #30363d;
    text-decoration: none;
    border-color: #8b949e;
}

/* Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
