:root {
    --bg: #f8fafc;
    --surface: #ffffff;
    --text-main: #1e293b;
    --text-light: #64748b;
    --accent: #3b82f6; /* Bright Blue */
    --accent-hover: #2563eb;
    --border: #e2e8f0;
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background-color: var(--bg);
    color: var(--text-main);
}

/* --- HEADER --- */
.app-header {
    padding: 40px 20px;
    text-align: center;
}

.app-header h1 {
    margin: 0;
    font-size: 2.5rem;
    font-weight: 900;
    letter-spacing: -1px;
}

/* --- GRID --- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-color: var(--accent);
}

.card h3 { margin-top: 0; font-size: 1.25rem; }
.card p { color: var(--text-light); font-size: 0.9rem; line-height: 1.5; }

/* --- POPUP OVERLAY --- */
.popup-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: var(--surface);
    z-index: 1000;
    display: none; /* Hidden by default */
    flex-direction: column;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* --- POPUP HEADER --- */
.popup-header {
    height: 60px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
}

.back-btn {
    background: none; border: none;
    font-size: 1rem; font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 8px;
}
.back-btn:hover { background: var(--bg); }

.github-link-btn {
    text-decoration: none;
    color: var(--accent);
    font-weight: 600;
    font-size: 0.9rem;
}

/* --- MARKDOWN CONTENT AREA --- */
#popup-content {
    flex: 1;
    overflow-y: auto;
    padding: 40px 20px;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

/* Styling the imported markdown tables */
#popup-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 0.9rem;
}

#popup-content th {
    background: var(--bg);
    text-align: left;
    padding: 12px;
    border-bottom: 2px solid var(--border);
}

#popup-content td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
}

#popup-content a { color: var(--accent); text-decoration: none; }
#popup-content a:hover { text-decoration: underline; }
#popup-content img { max-width: 100%; border-radius: 8px; }
