:root {
    --color-red: #FF4136;
    --color-blue: #0074D9;
    --color-yellow: #FFDC00;
    --color-green: #2ECC40;
    --bg-color: #f0f4f8;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.5);
    --text-primary: #333;
    --text-secondary: #666;
}

body {
    background-color: var(--bg-color);
    /* Subtle grid pattern for "lab notebook" feel */
    background-image: radial-gradient(#e0e0e0 1px, transparent 1px);
    background-size: 20px 20px;
    font-family: 'Outfit', sans-serif;
    color: var(--text-primary);
    margin: 0;
    padding: 20px;
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding-bottom: 50px;
}

/* --- Header --- */
.whimsical-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px;
    background: var(--glass-bg);
    border-radius: 15px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
    backdrop-filter: blur(4px);
    border: 1px solid var(--glass-border);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0% {
        transform: translatey(0px);
    }

    50% {
        transform: translatey(-10px);
    }

    100% {
        transform: translatey(0px);
    }
}

h1 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 3.5rem;
    margin: 0;
    background: linear-gradient(90deg, var(--color-red), var(--color-blue), var(--color-green));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-family: 'Outfit', sans-serif;
    font-weight: 300;
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-top: 5px;
}

.header-actions {
    margin-top: 20px;
}

.btn-sheet-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background-color: white;
    color: #1d804e;
    /* Google Sheets green */
    text-decoration: none;
    font-weight: 600;
    border-radius: 50px;
    border: 2px solid #1d804e;
    transition: all 0.2s;
    font-size: 1rem;
}

.btn-sheet-link:hover {
    background-color: #1d804e;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(29, 128, 78, 0.2);
}

/* --- Grids --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
    margin-bottom: 30px;
}

.interaction-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 768px) {

    .dashboard-grid,
    .interaction-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Cards --- */
.card {
    background: var(--glass-bg);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 2px solid white;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: var(--accent-color, #ccc);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

h2 {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    margin-top: 5px;
    color: #444;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.icon {
    font-size: 1.5rem;
}

/* --- Stats --- */
.stat-number {
    font-size: 4rem;
    font-weight: 700;
    color: var(--color-blue);
    text-align: center;
    line-height: 1.2;
    font-family: 'Outfit', sans-serif;
}

.stats-card p {
    text-align: center;
    color: var(--text-secondary);
}

.chart-container {
    height: 200px;
    position: relative;
}

/* --- Forms --- */
.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    font-weight: 500;
    margin-bottom: 5px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

input,
select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1rem;
    font-family: 'Outfit', sans-serif;
    transition: all 0.2s;
    background-color: rgba(255, 255, 255, 0.7);
    box-sizing: border-box;
    /* Fix padding expanding width */
}

input:focus,
select:focus {
    border-color: var(--color-blue);
    outline: none;
    box-shadow: 0 0 0 4px rgba(68, 138, 255, 0.1);
}

.btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 12px;
    font-size: 1.2rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: filter 0.2s;
    color: white;
}

.btn-red {
    background-color: var(--color-red);
    box-shadow: 0 4px 10px rgba(255, 65, 54, 0.3);
}

.btn-red:hover {
    filter: brightness(110%);
}

.btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    box-shadow: none;
}

.success-msg {
    color: var(--color-green);
    text-align: center;
    margin-top: 10px;
    font-weight: bold;
    font-family: 'Outfit', sans-serif;
}

/* --- Search Results --- */
.search-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.search-bar {
    flex: 2;
}

.filter-select {
    flex: 1;
}

.btn-view-all {
    background-color: var(--color-blue);
    padding: 0 20px;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    border: none;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    transition: filter 0.2s;
    white-space: nowrap;
}

.btn-view-all.active {
    background-color: var(--color-red);
}

.btn-view-all:hover {
    filter: brightness(110%);
}

.results-area {
    max-height: 300px;
    overflow-y: auto;
    padding-right: 5px;
}

/* Scrollbar aesthetic */
.results-area::-webkit-scrollbar {
    width: 6px;
}

.results-area::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 3px;
}

.result-item {
    background: white;
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 10px;
    border-left: 4px solid var(--color-green);
    /* Default fallback */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.badge {
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: bold;
    color: white;
    background: #999;
}

.delete-btn {
    background: none;
    border: none;
    color: var(--color-red);
    cursor: pointer;
    font-size: 1rem;
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, opacity 0.2s;
    opacity: 0.5;
}

.delete-btn:hover {
    transform: scale(1.2);
    opacity: 1;
}

.result-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.badge[data-type="Article"] {
    background: var(--color-red);
}

.badge[data-type="Document"] {
    background: var(--color-blue);
}

.badge[data-type="Other"] {
    background: var(--color-green);
}

.result-details {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    gap: 15px;
}

.empty-state {
    text-align: center;
    color: #999;
    padding: 20px;
    font-style: italic;
}